mirror of
https://github.com/pocoproject/poco.git
synced 2025-03-27 00:35:23 +01:00
build system: added target_extlibs variable
This commit is contained in:
parent
35a598f7c3
commit
cf73cfad58
@ -4,6 +4,11 @@
|
||||
# Compile rule definitions for makefiles
|
||||
#
|
||||
|
||||
#
|
||||
# Target-specific include paths
|
||||
#
|
||||
INCLUDE += $(foreach l,$(target_includes),-I$(l))
|
||||
|
||||
#
|
||||
# Targets
|
||||
#
|
||||
@ -20,8 +25,8 @@ all_release: static_release shared_release
|
||||
# Create directories if necessary
|
||||
#
|
||||
.PHONY: objdirs libdirs bindirs static_bindirs
|
||||
objdirs: $(OBJPATH_RELEASE_STATIC) $(OBJPATH_DEBUG_STATIC) $(OBJPATH_RELEASE_SHARED) $(OBJPATH_DEBUG_SHARED)
|
||||
libdirs: objdirs $(LIBPATH)
|
||||
objdirs: $(OBJPATH_RELEASE_STATIC) $(OBJPATH_DEBUG_STATIC) $(OBJPATH_RELEASE_SHARED) $(OBJPATH_DEBUG_SHARED)
|
||||
libdirs: objdirs $(LIBPATH)
|
||||
bindirs: objdirs $(BINPATH)
|
||||
static_bindirs: objdirs $(BINPATH)/static
|
||||
|
||||
@ -30,7 +35,7 @@ $(OBJPATH_RELEASE_STATIC) $(OBJPATH_DEBUG_STATIC) $(OBJPATH_RELEASE_SHARED) $(OB
|
||||
|
||||
#
|
||||
# Rules for compiling
|
||||
#
|
||||
#
|
||||
$(OBJPATH_DEBUG_STATIC)/%.o: $(SRCDIR)/%.cpp $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG)
|
||||
@echo "** Compiling" $< "(debug, static)"
|
||||
$(CXX) $(INCLUDE) $(CXXFLAGS) $(DEBUGOPT_CXX) $(STATICOPT_CXX) -c $< -o $@
|
||||
@ -69,7 +74,7 @@ $(OBJPATH_RELEASE_SHARED)/%.o: $(SRCDIR)/%.c $(DEPPATH)/%.d $(POCO_BASE)/build/c
|
||||
$(DEPPATH)/%.d: $(SRCDIR)/%.cpp
|
||||
@echo "** Creating dependency info for" $^
|
||||
$(MKDIR) $(DEPPATH)
|
||||
$(DEP) $(SRCDIR)/$(patsubst %.d,%.cpp,$(notdir $@)) $@ $(OBJPATH_DEBUG_STATIC) $(OBJPATH_RELEASE_STATIC) $(OBJPATH_DEBUG_SHARED) $(OBJPATH_RELEASE_SHARED) $(INCLUDE) $(CXXFLAGS)
|
||||
$(DEP) $(SRCDIR)/$(patsubst %.d,%.cpp,$(notdir $@)) $@ $(OBJPATH_DEBUG_STATIC) $(OBJPATH_RELEASE_STATIC) $(OBJPATH_DEBUG_SHARED) $(OBJPATH_RELEASE_SHARED) $(INCLUDE) $(CXXFLAGS)
|
||||
|
||||
$(DEPPATH)/%.d: $(SRCDIR)/%.c
|
||||
@echo "** Creating dependency info for" $^
|
||||
|
@ -10,7 +10,7 @@
|
||||
SHL_EXT = $(SHAREDLIBLINKEXT)
|
||||
|
||||
# Some systems (e.g. Mac OS X) make a difference between
|
||||
# shared libraries (as used by the linker/loader) and
|
||||
# shared libraries (as used by the linker/loader) and
|
||||
# dynamic libraries, as used for dynamically loadable modules.
|
||||
# If no specific instructions for making dynamic libraries
|
||||
# are given, use the instructions for making shared libraries.
|
||||
@ -27,6 +27,7 @@ DYLIB_S_RELEASE = $(BINPATH)/static/$(target)$(OSARCH_POSTFIX)$(SHL_EXT)
|
||||
|
||||
TARGET_LIBS_DEBUG = $(foreach l,$(target_libs),-l$(l)d$(OSARCH_POSTFIX))
|
||||
TARGET_LIBS_RELEASE = $(foreach l,$(target_libs),-l$(l)$(OSARCH_POSTFIX))
|
||||
TARGET_LIBS_EXT = $(foreach l,$(target_extlibs),-l$(l)$(OSARCH_POSTFIX))
|
||||
|
||||
#
|
||||
# Include the compile rules
|
||||
@ -51,22 +52,22 @@ shared_release: bindirs $(DYLIB_RELEASE)
|
||||
|
||||
$(DYLIB_DEBUG): $(foreach o,$(objects),$(OBJPATH_DEBUG_SHARED)/$(o).o)
|
||||
@echo "** Building dynamic library (debug, shared)" $@
|
||||
$(DYLIB) $(DYLIBFLAGS) $^ $(LIBRARY) $(TARGET_LIBS_DEBUG) $(SYSLIBS)
|
||||
$(DYLIB) $(DYLIBFLAGS) $^ $(LIBRARY) $(TARGET_LIBS_DEBUG) $(TARGET_LIBS_EXT) $(SYSLIBS)
|
||||
$(postbuild)
|
||||
|
||||
$(DYLIB_RELEASE): $(foreach o,$(objects),$(OBJPATH_RELEASE_SHARED)/$(o).o)
|
||||
@echo "** Building dynamic library (release, shared)" $@
|
||||
$(DYLIB) $(DYLIBFLAGS) $^ $(LIBRARY) $(TARGET_LIBS_RELEASE) $(SYSLIBS)
|
||||
$(DYLIB) $(DYLIBFLAGS) $^ $(LIBRARY) $(TARGET_LIBS_RELEASE) $(TARGET_LIBS_EXT) $(SYSLIBS)
|
||||
$(postbuild)
|
||||
|
||||
$(DYLIB_S_DEBUG): $(foreach o,$(objects),$(OBJPATH_DEBUG_SHARED)/$(o).o)
|
||||
@echo "** Building dynamic library (debug, static)" $@
|
||||
$(DYLIB) $(DYLIBFLAGS) $^ $(LIBRARY) $(TARGET_LIBS_DEBUG) $(SYSLIBS)
|
||||
$(DYLIB) $(DYLIBFLAGS) $^ $(LIBRARY) $(TARGET_LIBS_DEBUG) $(TARGET_LIBS_EXT) $(SYSLIBS)
|
||||
$(postbuild)
|
||||
|
||||
$(DYLIB_S_RELEASE): $(foreach o,$(objects),$(OBJPATH_RELEASE_SHARED)/$(o).o)
|
||||
@echo "** Building dynamic library (release, static)" $@
|
||||
$(DYLIB) $(DYLIBFLAGS) $^ $(LIBRARY) $(TARGET_LIBS_RELEASE) $(SYSLIBS)
|
||||
$(DYLIB) $(DYLIBFLAGS) $^ $(LIBRARY) $(TARGET_LIBS_RELEASE) $(TARGET_LIBS_EXT) $(SYSLIBS)
|
||||
$(postbuild)
|
||||
|
||||
#
|
||||
|
@ -14,6 +14,7 @@ EXEC_DEBUG_SHARED = $(BINPATH)/$(target)d$(OSARCH_POSTFIX)$(BINEXT)
|
||||
|
||||
TARGET_LIBS_DEBUG = $(foreach l,$(target_libs),-l$(l)d$(OSARCH_POSTFIX))
|
||||
TARGET_LIBS_RELEASE = $(foreach l,$(target_libs),-l$(l)$(OSARCH_POSTFIX))
|
||||
TARGET_LIBS_EXT = $(foreach l,$(target_extlibs),-l$(l)$(OSARCH_POSTFIX))
|
||||
|
||||
#
|
||||
# Include the compile rules
|
||||
@ -39,23 +40,23 @@ shared_release: bindirs $(EXEC_RELEASE_SHARED)
|
||||
|
||||
$(EXEC_DEBUG_STATIC): $(foreach o,$(objects),$(OBJPATH_DEBUG_STATIC)/$(o).o)
|
||||
@echo "** Building executable (debug)" $@
|
||||
$(LINK) $(LINKFLAGS) $(DEBUGOPT_LINK) $(STATICOPT_LINK) -o $@ $^ $(LIBRARY) $(TARGET_LIBS_DEBUG) $(SYSLIBS)
|
||||
$(LINK) $(LINKFLAGS) $(DEBUGOPT_LINK) $(STATICOPT_LINK) -o $@ $^ $(LIBRARY) $(TARGET_LIBS_DEBUG) $(TARGET_LIBS_EXT) $(SYSLIBS)
|
||||
$(postbuild)
|
||||
|
||||
|
||||
$(EXEC_RELEASE_STATIC): $(foreach o,$(objects),$(OBJPATH_RELEASE_STATIC)/$(o).o)
|
||||
@echo "** Building executable (release)" $@
|
||||
$(LINK) $(LINKFLAGS) $(RELEASEOPT_LINK) $(STATICOPT_LINK) -o $@ $^ $(LIBRARY) $(TARGET_LIBS_RELEASE) $(SYSLIBS)
|
||||
$(LINK) $(LINKFLAGS) $(RELEASEOPT_LINK) $(STATICOPT_LINK) -o $@ $^ $(LIBRARY) $(TARGET_LIBS_RELEASE) $(TARGET_LIBS_EXT) $(SYSLIBS)
|
||||
$(STRIPCMD)
|
||||
$(postbuild)
|
||||
|
||||
$(EXEC_DEBUG_SHARED): $(foreach o,$(objects),$(OBJPATH_DEBUG_SHARED)/$(o).o)
|
||||
@echo "** Building shared executable (debug)" $@
|
||||
$(LINK) $(LINKFLAGS) $(DEBUGOPT_LINK) $(SHAREDOPT_LINK) -o $@ $^ $(LIBRARY) $(TARGET_LIBS_DEBUG) $(SYSLIBS)
|
||||
$(LINK) $(LINKFLAGS) $(DEBUGOPT_LINK) $(SHAREDOPT_LINK) -o $@ $^ $(LIBRARY) $(TARGET_LIBS_DEBUG) $(TARGET_LIBS_EXT) $(SYSLIBS)
|
||||
$(postbuild)
|
||||
|
||||
$(EXEC_RELEASE_SHARED): $(foreach o,$(objects),$(OBJPATH_RELEASE_SHARED)/$(o).o)
|
||||
@echo "** Building shared executable (release)" $@
|
||||
$(LINK) $(LINKFLAGS) $(RELEASEOPT_LINK) $(SHAREDOPT_LINK) -o $@ $^ $(LIBRARY) $(TARGET_LIBS_RELEASE) $(SYSLIBS)
|
||||
$(LINK) $(LINKFLAGS) $(RELEASEOPT_LINK) $(SHAREDOPT_LINK) -o $@ $^ $(LIBRARY) $(TARGET_LIBS_RELEASE) $(TARGET_LIBS_EXT) $(SYSLIBS)
|
||||
$(STRIPCMD)
|
||||
$(postbuild)
|
||||
|
||||
|
@ -31,6 +31,7 @@ endif
|
||||
|
||||
TARGET_LIBS_DEBUG = $(foreach l,$(target_libs),-l$(l)d$(OSARCH_POSTFIX))
|
||||
TARGET_LIBS_RELEASE = $(foreach l,$(target_libs),-l$(l)$(OSARCH_POSTFIX))
|
||||
TARGET_LIBS_EXT = $(foreach l,$(target_extlibs),-l$(l)$(OSARCH_POSTFIX))
|
||||
|
||||
#
|
||||
# Include the compile rules
|
||||
@ -48,7 +49,7 @@ clean:
|
||||
distclean: clean
|
||||
$(RM) obj
|
||||
$(RM) .dep
|
||||
|
||||
|
||||
static_debug: libdirs $(LIB_DEBUG_STATIC)
|
||||
static_release: libdirs $(LIB_RELEASE_STATIC)
|
||||
shared_debug: libdirs $(LIB_DEBUG_SHARED)
|
||||
@ -68,7 +69,7 @@ $(LIB_RELEASE_STATIC): $(foreach o,$(objects),$(OBJPATH_RELEASE_STATIC)/$(o).o)
|
||||
|
||||
$(LIB_DEBUG_SHARED): $(foreach o,$(objects),$(OBJPATH_DEBUG_SHARED)/$(o).o)
|
||||
@echo "** Building shared library (debug)" $@
|
||||
$(SHLIB) $(SHLIBFLAGS) $^ $(LIBRARY) $(TARGET_LIBS_DEBUG) $(SYSLIBS)
|
||||
$(SHLIB) $(SHLIBFLAGS) $^ $(LIBRARY) $(TARGET_LIBS_DEBUG) $(TARGET_LIBS_EXT) $(SYSLIBS)
|
||||
ifeq ($(OSNAME), CYGWIN)
|
||||
$(SHLIBLN) $(IMP_DEBUG_SHARED) $(IMP_DEBUG_SHARED_LINK)
|
||||
endif
|
||||
@ -77,7 +78,7 @@ endif
|
||||
|
||||
$(LIB_RELEASE_SHARED): $(foreach o,$(objects),$(OBJPATH_RELEASE_SHARED)/$(o).o)
|
||||
@echo "** Building shared library (release)" $@
|
||||
$(SHLIB) $(SHLIBFLAGS) $^ $(LIBRARY) $(TARGET_LIBS_RELEASE) $(SYSLIBS)
|
||||
$(SHLIB) $(SHLIBFLAGS) $^ $(LIBRARY) $(TARGET_LIBS_RELEASE) $(TARGET_LIBS_EXT) $(SYSLIBS)
|
||||
ifeq ($(OSNAME), CYGWIN)
|
||||
$(SHLIBLN) $(IMP_RELEASE_SHARED) $(IMP_RELEASE_SHARED_LINK)
|
||||
endif
|
||||
|
@ -302,6 +302,42 @@ The difference is the file that is included at the end of the Makefile:
|
||||
|
||||
!!!Build System Reference
|
||||
|
||||
|
||||
!!Target Variables
|
||||
|
||||
!target
|
||||
|
||||
The <*target*> variable specifies the name of the resulting library or executable,
|
||||
excluding the suffix.
|
||||
|
||||
|
||||
!target_version
|
||||
|
||||
The <*target_version*> variable specifies the shared library version of the resulting
|
||||
shared library.
|
||||
|
||||
|
||||
!target_libs
|
||||
|
||||
The <*target_libs*> variable specifies all libraries that must be linked to the
|
||||
target. These libraries must have been built with this build system and they
|
||||
must follow the build system conventions, specifically, the names for debug
|
||||
and release builds.
|
||||
|
||||
|
||||
!target_extlibs
|
||||
|
||||
The <*target_extlibs*> variables specifies additional libraries that must be
|
||||
linked to the target. No assumptions are made regarding debug or release builds.
|
||||
The names given here are simply passed to the linker by prepending the <[-l]> flag.
|
||||
|
||||
|
||||
!target_includes
|
||||
|
||||
The <*target_includes*> variable specifies a list of directories used for searching
|
||||
header files.
|
||||
|
||||
|
||||
!!Postbuild Command
|
||||
|
||||
A Makefile can contain a so-called postbuild command -- a shell command
|
||||
|
Loading…
x
Reference in New Issue
Block a user