2012-04-23 03:14:34 +02:00
|
|
|
#
|
|
|
|
# $Id: //poco/1.4/build/rules/lib#2 $
|
|
|
|
#
|
|
|
|
# lib
|
|
|
|
#
|
|
|
|
# Rule definitions for building libraries
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Target names
|
|
|
|
#
|
|
|
|
ifdef target_version
|
|
|
|
SHL_EXT = $(SHAREDLIBEXT)
|
|
|
|
else
|
|
|
|
SHL_EXT = $(SHAREDLIBLINKEXT)
|
|
|
|
endif
|
|
|
|
|
2015-11-17 19:36:10 +01:00
|
|
|
LIB_RELEASE_STATIC = $(LIBPATH)/$(LIBPREFIX)$(target).a
|
|
|
|
LIB_DEBUG_STATIC = $(LIBPATH)/$(LIBPREFIX)$(target)d.a
|
|
|
|
LIB_RELEASE_SHARED = $(LIBPATH)/$(LIBPREFIX)$(target)$(SHL_EXT)
|
|
|
|
LIB_DEBUG_SHARED = $(LIBPATH)/$(LIBPREFIX)$(target)d$(SHL_EXT)
|
|
|
|
LIB_RELEASE_SHARED_LINK = $(LIBPATH)/$(LIBPREFIX)$(target)$(SHAREDLIBLINKEXT)
|
|
|
|
LIB_DEBUG_SHARED_LINK = $(LIBPATH)/$(LIBPREFIX)$(target)d$(SHAREDLIBLINKEXT)
|
2012-04-23 03:14:34 +02:00
|
|
|
|
2015-11-17 19:36:10 +01:00
|
|
|
TARGET_LIBS_DEBUG = $(foreach l,$(target_libs),-l$(l)d)
|
|
|
|
TARGET_LIBS_RELEASE = $(foreach l,$(target_libs),-l$(l))
|
2012-04-23 03:14:34 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Include the compile rules
|
|
|
|
#
|
|
|
|
include $(POCO_BASE)/build/rules/compile
|
|
|
|
|
|
|
|
#
|
|
|
|
# Rules for creating a library
|
|
|
|
#
|
|
|
|
clean:
|
|
|
|
$(RM) $(OBJPATH)
|
|
|
|
$(RM) $(LIB_RELEASE_STATIC) $(LIB_DEBUG_STATIC) $(LIB_RELEASE_SHARED) $(LIB_DEBUG_SHARED)
|
|
|
|
$(RM) $(LIB_DEBUG_SHARED_LINK) $(LIB_RELEASE_SHARED_LINK)
|
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
$(RM) obj
|
|
|
|
$(RM) .dep
|
|
|
|
|
|
|
|
static_debug: libdirs $(LIB_DEBUG_STATIC)
|
|
|
|
static_release: libdirs $(LIB_RELEASE_STATIC)
|
|
|
|
shared_debug: libdirs $(LIB_DEBUG_SHARED)
|
|
|
|
shared_release: libdirs $(LIB_RELEASE_SHARED)
|
|
|
|
|
|
|
|
$(LIB_DEBUG_STATIC): $(foreach o,$(objects),$(OBJPATH_DEBUG_STATIC)/$(o).o)
|
|
|
|
@echo "** Building library (debug)" $@
|
|
|
|
$(LIB) $@ $^
|
|
|
|
$(RANLIB) $@
|
|
|
|
$(postbuild)
|
|
|
|
|
|
|
|
$(LIB_RELEASE_STATIC): $(foreach o,$(objects),$(OBJPATH_RELEASE_STATIC)/$(o).o)
|
|
|
|
@echo "** Building library (release)" $@
|
|
|
|
$(LIB) $@ $^
|
|
|
|
$(RANLIB) $@
|
|
|
|
$(postbuild)
|
|
|
|
|
|
|
|
$(LIB_DEBUG_SHARED): $(foreach o,$(objects),$(OBJPATH_DEBUG_SHARED)/$(o).o)
|
|
|
|
@echo "** Building shared library (debug)" $@
|
2015-11-17 21:05:21 +01:00
|
|
|
$(SHLIB) $(SHLIBFLAGS) $^ $(LIBRARY) $(TARGET_LIBS_DEBUG) $(SYSLIBS)
|
2012-04-23 03:14:34 +02:00
|
|
|
$(SHLIBLN) $(LIB_DEBUG_SHARED) $(LIB_DEBUG_SHARED_LINK)
|
|
|
|
$(postbuild)
|
|
|
|
|
|
|
|
$(LIB_RELEASE_SHARED): $(foreach o,$(objects),$(OBJPATH_RELEASE_SHARED)/$(o).o)
|
|
|
|
@echo "** Building shared library (release)" $@
|
2015-11-17 21:05:21 +01:00
|
|
|
$(SHLIB) $(SHLIBFLAGS) $^ $(LIBRARY) $(TARGET_LIBS_RELEASE) $(SYSLIBS)
|
2012-04-23 03:14:34 +02:00
|
|
|
$(SHLIBLN) $(LIB_RELEASE_SHARED) $(LIB_RELEASE_SHARED_LINK)
|
|
|
|
$(STRIPCMD)
|
|
|
|
$(postbuild)
|
|
|
|
|
|
|
|
#
|
|
|
|
# Include the automatically generated dependency files
|
|
|
|
#
|
|
|
|
sinclude $(addprefix $(DEPPATH)/,$(addsuffix .d,$(objects)))
|