ifeq ($(words $(wildcard *)),0)
error-all/environment.mak:
echo You have a broken version of GNU Make - upgrade.
+ error-out-and-die
else
error-all/environment.mak:
echo Can't find the build directory in $(BUILD_POSSIBLE) -- use BUILD=
+ error-out-and-die
endif
# Force include below to come to the error target
endif
endif
+# Automatic -j support
ifeq ($(NUM_PROCS),1)
PARALLEL_RUN=no
endif
ifndef PARALLEL_RUN
PARALLEL_RUN=yes
.EXPORT: PARALLEL_RUN
+ # handle recursion
ifneq ($(NUM_PROCS),)
-# handle recursion
MAKEFLAGS += -j $(NUM_PROCS)
endif
endif
# Shim Headerfile control
HAVE_C9X = @HAVE_C9X@
HAVE_STATVFS = @HAVE_STATVFS@
+
+# Shared library things
+HOST_OS = @host_os@
+ifeq ($(HOST_OS),linux-gnu)
+ ONLYSHAREDLIBS = yes
+ SONAME_MAGIC=-Wl,-soname -Wl,
+ LFLAGS_SO=
+endif
+
$(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,$^) \
- $($(@F)-SLIBS)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) $(PICFLAGS) $(LFLAGS) $(LFLAGS_SO)\
+ -o $@ $(SONAME_MAGIC)$($(@F)-SONAME) -shared \
+ $(filter %.opic,$^) \
+ $($(@F)-SLIBS)
# Compilation rules
vpath %.cc $(SUBDIRS)