From 1b64c0ca9f6438c5bb35f34a46344030b61b789a Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 28 Apr 2024 17:47:08 +0000 Subject: build system: imported sofort, a project-agnostic build system. --- sofort/exrules/_pe/pe_mdso_version_none.mk | 2 ++ sofort/exrules/_pe/pe_mdso_version_used.mk | 5 ++++ sofort/exrules/_pe/pe_version_none.mk | 7 +++++ sofort/exrules/_pe/pe_version_used.mk | 23 ++++++++++++++++ sofort/exrules/default.mk | 17 ++++++++++++ sofort/exrules/pe-common.mk | 42 ++++++++++++++++++++++++++++++ sofort/exrules/pe-dlltool.mk | 18 +++++++++++++ sofort/exrules/pe-mdso.mk | 11 ++++++++ sofort/exrules/pe-version.mk | 4 +++ 9 files changed, 129 insertions(+) create mode 100644 sofort/exrules/_pe/pe_mdso_version_none.mk create mode 100644 sofort/exrules/_pe/pe_mdso_version_used.mk create mode 100644 sofort/exrules/_pe/pe_version_none.mk create mode 100644 sofort/exrules/_pe/pe_version_used.mk create mode 100644 sofort/exrules/default.mk create mode 100644 sofort/exrules/pe-common.mk create mode 100644 sofort/exrules/pe-dlltool.mk create mode 100644 sofort/exrules/pe-mdso.mk create mode 100644 sofort/exrules/pe-version.mk (limited to 'sofort/exrules') diff --git a/sofort/exrules/_pe/pe_mdso_version_none.mk b/sofort/exrules/_pe/pe_mdso_version_none.mk new file mode 100644 index 0000000..cf5e350 --- /dev/null +++ b/sofort/exrules/_pe/pe_mdso_version_none.mk @@ -0,0 +1,2 @@ +# pe_mdso_version_none.mk: PE shared library rules for targets using mdso. +# this file is covered by COPYING.SOFORT. diff --git a/sofort/exrules/_pe/pe_mdso_version_used.mk b/sofort/exrules/_pe/pe_mdso_version_used.mk new file mode 100644 index 0000000..fac0246 --- /dev/null +++ b/sofort/exrules/_pe/pe_mdso_version_used.mk @@ -0,0 +1,5 @@ +# pe_mdso_version_used.mk: PE shared library rules for targets using mdso. +# this file is covered by COPYING.SOFORT. + +$(IMPLIB_SONAME): $(IMPLIB_DEF) + $(MDSO) -m $(CC_BITS) -i $(IMPLIB_SONAME) -n $(DSO_SONAME) $(IMPLIB_DEF) diff --git a/sofort/exrules/_pe/pe_version_none.mk b/sofort/exrules/_pe/pe_version_none.mk new file mode 100644 index 0000000..df33976 --- /dev/null +++ b/sofort/exrules/_pe/pe_version_none.mk @@ -0,0 +1,7 @@ +# pe_version_none.mk: handling of PE shared library versioning schemes. +# this file is covered by COPYING.SOFORT. + +package-implib-soname: +package-implib-solink: +package-install-implib-soname: +package-install-implib-solink: diff --git a/sofort/exrules/_pe/pe_version_used.mk b/sofort/exrules/_pe/pe_version_used.mk new file mode 100644 index 0000000..8710dae --- /dev/null +++ b/sofort/exrules/_pe/pe_version_used.mk @@ -0,0 +1,23 @@ +# pe_version_used.mk: handling of PE shared library versioning schemes. +# this file is covered by COPYING.SOFORT. + +package-implib-soname: implib-soname +package-implib-solink: implib-solink +package-install-implib-soname: install-implib-soname +package-install-implib-solink: install-implib-solink + + +$(IMPLIB_SOLINK): $(IMPLIB_SONAME) + rm -f $(IMPLIB_SOLINK).tmp + ln -s $(IMP_SONAME) $(IMPLIB_SOLINK).tmp + mv $(IMPLIB_SOLINK).tmp $(IMPLIB_SOLINK) + +install-implib-soname: implib-soname + mkdir -p $(DESTDIR)$(LIBDIR) + cp $(IMPLIB_SONAME) $(DESTDIR)$(LIBDIR) + +install-implib-solink: implib-soname + mkdir -p $(DESTDIR)$(LIBDIR) + rm -f $(IMPLIB_SOLINK).tmp + ln -s $(IMP_SONAME) $(IMPLIB_SOLINK).tmp + mv $(IMPLIB_SOLINK).tmp $(DESTDIR)$(LIBDIR)/$(IMP_SOLINK) diff --git a/sofort/exrules/default.mk b/sofort/exrules/default.mk new file mode 100644 index 0000000..9844f37 --- /dev/null +++ b/sofort/exrules/default.mk @@ -0,0 +1,17 @@ +# default.mk: default shared library rules. +# this file is covered by COPYING.SOFORT. + +DSO_REF_VER = $(SHARED_LIB) +DSO_REF_SONAME = $(SHARED_SONAME) +DSO_REF_SOLINK = $(SHARED_SOLINK) + +LDFLAGS_SHARED += -Wl,-soname +LDFLAGS_SHARED += -Wl,$(DSO_SONAME) + +implib: + +install-implib: + +clean-implib: + +.PHONY: $(IMPLIB_DEF) $(IMPLIB_VER) $(IMPLIB_SONAME) $(IMPLIB_SOLINK) diff --git a/sofort/exrules/pe-common.mk b/sofort/exrules/pe-common.mk new file mode 100644 index 0000000..3e132a9 --- /dev/null +++ b/sofort/exrules/pe-common.mk @@ -0,0 +1,42 @@ +# pe-common.mk: common PE shared library rules. +# this file is covered by COPYING.SOFORT. + +DSO_REF_VER = $(IMPLIB_VER) +DSO_REF_SONAME = $(IMPLIB_SONAME) +DSO_REF_SOLINK = $(IMPLIB_SOLINK) + +LDFLAGS_IMPLIB += -Wl,--output-def +LDFLAGS_IMPLIB += -Wl,$(IMPLIB_DEF) + +LDFLAGS_SONAME += -Wl,-soname +LDFLAGS_SONAME += -Wl,$(DSO_SONAME) +LDFLAGS_SHARED += $(LDFLAGS_SONAME) + +DSO_LIBPATH ?= loader +PE_SUBSYSTEM ?= windows +LDFLAGS_COMMON += -Wl,--subsystem=$(PE_SUBSYSTEM) + +implib: implib-ver package-implib-soname package-implib-solink + +implib-ver: shared-lib $(IMPLIB_VER) + +implib-soname: shared-lib $(IMPLIB_SONAME) + +implib-solink: shared-lib $(IMPLIB_SOLINK) + +$(IMPLIB_DEF): shared-lib + +install-implib: install-implib-ver \ + package-install-implib-soname \ + package-install-implib-solink + +install-implib-ver: implib-ver + mkdir -p $(DESTDIR)$(LIBDIR) + cp $(IMPLIB_VER) $(DESTDIR)$(LIBDIR) + +clean-implib: + rm -f $(SHARED_LIB) + rm -f $(IMPLIB_DEF) + rm -f $(IMPLIB_VER) + rm -f $(IMPLIB_SONAME) + rm -f $(IMPLIB_SOLINK) diff --git a/sofort/exrules/pe-dlltool.mk b/sofort/exrules/pe-dlltool.mk new file mode 100644 index 0000000..0fc1adf --- /dev/null +++ b/sofort/exrules/pe-dlltool.mk @@ -0,0 +1,18 @@ +# pe-dlltool.mk: PE shared library rules for targets using dlltool. +# this file is covered by COPYING.SOFORT. + +include $(PROJECT_DIR)/sofort/exrules/pe-common.mk + +$(IMPLIB_VER): $(IMPLIB_DEF) + $(DLLTOOL) -l $(IMPLIB_VER) -d $(IMPLIB_DEF) -D $(DSO_VER) + +ifeq ($(AVOID_VERSION),yes) + +else + +$(IMPLIB_SONAME): $(IMPLIB_DEF) + $(DLLTOOL) -l $(IMPLIB_SONAME) -d $(IMPLIB_DEF) -D $(DSO_SONAME) + +endif + +include $(PROJECT_DIR)/sofort/exrules/pe-version.mk diff --git a/sofort/exrules/pe-mdso.mk b/sofort/exrules/pe-mdso.mk new file mode 100644 index 0000000..0c380e0 --- /dev/null +++ b/sofort/exrules/pe-mdso.mk @@ -0,0 +1,11 @@ +# pe-mdso.mk: PE shared library rules for targets using mdso. +# this file is covered by COPYING.SOFORT. + +include $(PROJECT_DIR)/sofort/exrules/pe-common.mk + +$(IMPLIB_VER): $(IMPLIB_DEF) + $(MDSO) -m $(CC_BITS) -i $(IMPLIB_VER) -n $(DSO_VER) -l $(DSO_LIBPATH) $(IMPLIB_DEF) + +include $(PROJECT_DIR)/sofort/exrules/_pe/pe_mdso_version_$(VERSION_OPT).mk + +include $(PROJECT_DIR)/sofort/exrules/pe-version.mk diff --git a/sofort/exrules/pe-version.mk b/sofort/exrules/pe-version.mk new file mode 100644 index 0000000..7f5b658 --- /dev/null +++ b/sofort/exrules/pe-version.mk @@ -0,0 +1,4 @@ +# pe-version.mk: handling of PE shared library versioning schemes. +# this file is covered by COPYING.SOFORT. + +include $(PROJECT_DIR)/sofort/exrules/_pe/pe_version_$(VERSION_OPT).mk -- cgit v1.2.3