]> rtime.felk.cvut.cz Git - omk/sssa.git/blobdiff - snippets/linux.omk
Merge branch 'master' of sojka@rtime.felk.cvut.cz:/var/git/omk into sssa
[omk/sssa.git] / snippets / linux.omk
index 8be7045411f43cba43e94eddf8a1093e3fc4467b..29bba979dfccd9efee947140e433281dcf63439c 100644 (file)
@@ -23,7 +23,7 @@
 # xxx_CXXFLAGS     .. custom CXXFLAGS for .cpp/.cxx modules of target xxx (in addition to CXXFLAGS)
 # xxx_ASFLAGS      .. custom ASFLAGS for .S modules of target xxx (in addition to ASFLAGS)
 # xxx_LIBS         .. custom libraries for target xxx (in addition to LIBS)
-# xxx_DLFLAGS      .. custom LDFLAGS for target xxx (in addition to LDFLAGS)
+# xxx_LDFLAGS      .. custom LDFLAGS for target xxx (in addition to LDFLAGS)
 # lib_LOADLIBES    .. list of libraries linked to each executable
 # INCLUDES         .. additional include directories and defines for user-space
 # kernel_INCLUDES  .. additional include directories and defines for kernel-space
@@ -275,7 +275,7 @@ endef
 
 
 define COMPILE_idl_template
-$(2).c $(2)-stubs.c $(2)-skels.c $(2)-common.c $(2).h: $(1)
+$(2).c $(2)-stubs.c $(2)-skels.c $(2)-common.c $(2).h: $(1) $$(wildcard $$(firstword $$(idl_COMPILE)))
        @$(QUIET_CMD_ECHO) "  IDL     $$@"
        $(Q) $$(idl_COMPILE) $$($(2)_IDLFLAGS) $(1)
 endef
@@ -381,6 +381,7 @@ $(foreach src,$(filter %.S,$($(1)_SOURCES)$($(1)_GEN_SOURCES)),$(eval $(call COM
 $(OMK_WORK_DIR)/lib$(1).$(SOLIB_EXT).omkvar: $$($(1)_OBJSLO) FORCE
        $(Q)echo '$(1)_OBJSLO += $$$$(addprefix $(USER_OBJS_DIR)/,$$($(1)_OBJSLO))' > $$@.tmp; \
            echo '$(1)_libs += $$($(1)_LIBS) $$(lib_LOADLIBES)' >> $$@.tmp; \
+           echo '$(1)_ldflags += $$($(1)_LDFLAGS) $$(lib_LDFLAGS)' >> $$@.tmp; \
            echo 'shared_libs := $$$$(sort $(1) $$$$(shared_libs))' >> $$@.tmp; \
            if cmp -s $$@.tmp $$@; then rm $$@.tmp; else mv $$@.tmp $$@; fi
 endef
@@ -429,9 +430,9 @@ ifeq ($(MAKECMDGOALS),link-shared-libs)
 define solib_link_template
 $(1)_shared_libs = $$(patsubst %,$(USER_LIB_DIR)/lib%.$(SOLIB_EXT),$$(filter $$(shared_libs),$$($(1)_libs)))
 #$$(warning $(1)_shared_libs = $$($(1)_shared_libs))
-$(USER_LIB_DIR)/lib$(1).$(SOLIB_EXT): $$($(1)_shared_libs) $$($(1)_OBJSLO)
+$(USER_LIB_DIR)/lib$(1).$(SOLIB_EXT): $$($(1)_shared_libs) $$($(1)_objslo)
        @$(QUIET_CMD_ECHO) "  LINK    $$@"
-       $(Q)$(CC) --shared -Xlinker -soname=lib$(1).$(SOLIB_EXT) -o $$@ $$($(1)_OBJSLO) $$(LOADLIBES) $$($(1)_libs:%=-l%)
+       $(Q)$(CC) --shared -Xlinker -soname=lib$(1).$(SOLIB_EXT) -Wl,-Map,$(USER_OBJS_DIR)/lib$(1).$(SOLIB_EXT).map -o $$@ $$($(1)_objslo) $$(LOADLIBES) $$($(1)_libs:%=-l%) $$(lib_ldflags) $$($(1)_ldflags)
 endef
 
 -include $(shell true; find $(USER_BUILD_DIR) -name 'lib*.omkvar') # `true' is a hack for MinGW