diff options
Diffstat (limited to 'sofort/exrules')
-rw-r--r-- | sofort/exrules/default.mk | 11 | ||||
-rw-r--r-- | sofort/exrules/pe-common.mk | 42 | ||||
-rw-r--r-- | sofort/exrules/pe-dlltool.mk | 18 | ||||
-rw-r--r-- | sofort/exrules/pe-mdso.mk | 18 | ||||
-rw-r--r-- | sofort/exrules/pe-version.mk | 34 |
5 files changed, 123 insertions, 0 deletions
diff --git a/sofort/exrules/default.mk b/sofort/exrules/default.mk new file mode 100644 index 0000000..b830cd0 --- /dev/null +++ b/sofort/exrules/default.mk @@ -0,0 +1,11 @@ +# 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) + +.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..9a3b941 --- /dev/null +++ b/sofort/exrules/pe-mdso.mk @@ -0,0 +1,18 @@ +# 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) $< + +ifeq ($(AVOID_VERSION),yes) + +else + +$(IMPLIB_SONAME): $(IMPLIB_DEF) + $(MDSO) -m $(CC_BITS) -i $(IMPLIB_SONAME) -n $(DSO_SONAME) $(IMPLIB_DEF) + +endif + +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..97ad4ca --- /dev/null +++ b/sofort/exrules/pe-version.mk @@ -0,0 +1,34 @@ +# pe-version.mk: handling of PE shared library versioning schemes. +# this file is covered by COPYING.SOFORT. + +ifeq ($(AVOID_VERSION),yes) + +package-implib-soname: +package-implib-solink: +package-install-implib-soname: +package-install-implib-solink: + +else + +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) + +endif |