poco/build/rules/lib
Guenter Obiltschnig f476bd6b32 initial import
2006-07-11 16:33:40 +00:00

69 lines
2.1 KiB
Plaintext

#
# $Id: //poco/1.1.0/build/rules/lib#1 $
#
# lib
#
# Rule definitions for building libraries
#
#
# Target names
#
ifdef target_version
SHL_EXT = $(SHAREDLIBEXT)
else
SHL_EXT = $(SHAREDLIBLINKEXT)
endif
LIB_RELEASE_STATIC = $(LIBPATH)/lib$(target)$(OSARCH_POSTFIX).a
LIB_DEBUG_STATIC = $(LIBPATH)/lib$(target)d$(OSARCH_POSTFIX).a
LIB_RELEASE_SHARED = $(LIBPATH)/lib$(target)$(OSARCH_POSTFIX)$(SHL_EXT)
LIB_DEBUG_SHARED = $(LIBPATH)/lib$(target)d$(OSARCH_POSTFIX)$(SHL_EXT)
LIB_RELEASE_SHARED_LINK = $(LIBPATH)/lib$(target)$(OSARCH_POSTFIX)$(SHAREDLIBLINKEXT)
LIB_DEBUG_SHARED_LINK = $(LIBPATH)/lib$(target)d$(OSARCH_POSTFIX)$(SHAREDLIBLINKEXT)
TARGET_LIBS_DEBUG = $(foreach l,$(target_libs),-l$(l)d$(OSARCH_POSTFIX))
TARGET_LIBS_RELEASE = $(foreach l,$(target_libs),-l$(l)$(OSARCH_POSTFIX))
#
# Include the compile rules
#
include $(POCO_BUILD)/rules/compile
#
# Rules for creating a library
#
clean:
$(RM) $(OBJPATH)
$(RM) $(LIB_RELEASE_STATIC) $(LIB_DEBUG_STATIC) $(LIB_RELEASE_SHARED) $(LIB_DEBUG_SHARED)
static_debug: dirs $(LIB_DEBUG_STATIC)
static_release: dirs $(LIB_RELEASE_STATIC)
shared_debug: dirs $(LIB_DEBUG_SHARED)
shared_release: dirs $(LIB_RELEASE_SHARED)
$(LIB_DEBUG_STATIC): $(foreach o,$(objects),$(OBJPATH_DEBUG_STATIC)/$(o).o)
@echo "** Building library (debug)" $@
$(LIB) $@ $^
$(RANLIB) $@
$(LIB_RELEASE_STATIC): $(foreach o,$(objects),$(OBJPATH_RELEASE_STATIC)/$(o).o)
@echo "** Building library (release)" $@
$(LIB) $@ $^
$(RANLIB) $@
$(LIB_DEBUG_SHARED): $(foreach o,$(objects),$(OBJPATH_DEBUG_SHARED)/$(o).o)
@echo "** Building shared library (debug)" $@
$(SHLIB) $^ $(LIBRARY) $(TARGET_LIBS_DEBUG) $(SYSLIBS)
$(SHLIBLN) $(LIB_DEBUG_SHARED) $(LIB_DEBUG_SHARED_LINK)
$(LIB_RELEASE_SHARED): $(foreach o,$(objects),$(OBJPATH_RELEASE_SHARED)/$(o).o)
@echo "** Building shared library (release)" $@
$(SHLIB) $^ $(LIBRARY) $(TARGET_LIBS_RELEASE) $(SYSLIBS)
$(SHLIBLN) $(LIB_RELEASE_SHARED) $(LIB_RELEASE_SHARED_LINK)
#
# Include the automatically generated dependency files
#
sinclude $(addprefix $(DEPPATH)/,$(addsuffix .d,$(objects)))