]> git.saurik.com Git - apt.git/blobdiff - buildlib/library.mak
Sparc64 and fixes
[apt.git] / buildlib / library.mak
index 1b814875fa644e19cedd6df01af64c7f0dc1549a..caf15606bf9b3b8701b7588ee66b7c09a4fb7889 100644 (file)
 # Some local definitions
 LOCAL := lib$(LIBRARY).so.$(MAJOR).$(MINOR)
 $(LOCAL)-OBJS := $(addprefix $(OBJ)/,$(addsuffix .opic,$(notdir $(basename $(SOURCE)))))
-$(LOCAL)-DEP := $(addprefix $(DEP)/,$(addsuffix .d,$(notdir $(basename $(SOURCE)))))
+$(LOCAL)-DEP := $(addprefix $(DEP)/,$(addsuffix .opic.d,$(notdir $(basename $(SOURCE)))))
 $(LOCAL)-HEADERS := $(addprefix $(INCLUDE)/,$(HEADERS))
 $(LOCAL)-SONAME := lib$(LIBRARY).so.$(MAJOR)
+$(LOCAL)-SLIBS := $(SLIBS)
+$(LOCAL)-LIBRARY := $(LIBRARY)
 
 # Install the command hooks
 headers: $($(LOCAL)-HEADERS)
@@ -32,7 +34,7 @@ veryclean: veryclean/$(LOCAL)
 clean/$(LOCAL):
        -rm -f $($(@F)-OBJS) $($(@F)-DEP)
 veryclean/$(LOCAL): clean/$(LOCAL)
-       -rm -f $($(@F)-HEADERS) $(LIB)/lib$(LIBRARY).so*
+       -rm -f $($(@F)-HEADERS) $(LIB)/lib$($(@F)-LIBRARY).so*
 
 # Build rules for the two symlinks
 .PHONY: $(LIB)/lib$(LIBRARY).so.$(MAJOR) $(LIB)/lib$(LIBRARY).so
@@ -43,9 +45,12 @@ $(LIB)/lib$(LIBRARY).so: $(LIB)/lib$(LIBRARY).so.$(MAJOR).$(MINOR)
        
 # The binary build rule
 $(LIB)/lib$(LIBRARY).so.$(MAJOR).$(MINOR): $($(LOCAL)-HEADERS) $($(LOCAL)-OBJS)
+       -rm -f $(LIB)/lib$($(@F)-LIBRARY).so* 2> /dev/null
        echo Building shared library $@
-       $(CXX) $(CXXFLAGS) $(LDFLAGS) $(PICFLAGS) $(LFLAGS) -o $@ \
-          -Wl,-soname -Wl,$($(@F)-SONAME) -shared $(filter %.opic,$^)
+       $(CXX) $(CXXFLAGS) $(LDFLAGS) $(PICFLAGS) $(LFLAGS) $(LFLAGS_SO)\
+          -o $@ $(SONAME_MAGIC)$($(@F)-SONAME) -shared \
+          $(filter %.opic,$^) \
+          $($(@F)-SLIBS) 
 
 # Compilation rules
 vpath %.cc $(SUBDIRS)