From 7d741ce67266e50648e2060ff40f5c098c6bdba3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 14 Oct 2010 16:43:14 +0200 Subject: Add support for post-link step (e.g., VxWorks munch) --- dist/build/cxx/rules.make | 3 +++ dist/build/cxx/rules.nmake | 3 +++ dist/config/config.make | 6 ++++++ dist/config/config.nmake | 6 ++++++ dist/etc/integrity/config.make | 6 ++++++ dist/etc/iphone/config-device.make | 6 ++++++ dist/etc/iphone/config-simulator.make | 6 ++++++ dist/etc/lynxos/config-4.2.make | 6 ++++++ dist/etc/lynxos/config-5.0.make | 6 ++++++ dist/etc/qnx/config-6.3-gcc-2.95.make | 6 ++++++ dist/etc/qnx/config-6.3-gcc-3.3.make | 6 ++++++ dist/etc/qnx/config-6.4.make | 6 ++++++ dist/etc/vxworks/config-5.5.1.make | 6 ++++++ dist/etc/vxworks/config-6.4-max.make | 11 ++++++++++- dist/etc/vxworks/config-6.4-min.make | 6 ++++++ dist/etc/vxworks/config-6.7-max.make | 11 ++++++++++- dist/etc/vxworks/config-6.7-min.make | 6 ++++++ tests/cxx/hybrid/makefile | 2 +- 18 files changed, 105 insertions(+), 3 deletions(-) diff --git a/dist/build/cxx/rules.make b/dist/build/cxx/rules.make index 6056a12..e03418f 100644 --- a/dist/build/cxx/rules.make +++ b/dist/build/cxx/rules.make @@ -12,3 +12,6 @@ include $(root)/build/config.make %: %.o $(LD) $(LDFLAGS) -o $@ $^ $(LIBS) +ifneq ($(POSTLD),) + $(POSTLD) $@ $^ $(LIBS) +endif diff --git a/dist/build/cxx/rules.nmake b/dist/build/cxx/rules.nmake index 1ff4ef0..ae9913f 100644 --- a/dist/build/cxx/rules.nmake +++ b/dist/build/cxx/rules.nmake @@ -14,3 +14,6 @@ .obj.exe: $(LD) $(LDFLAGS) /OUT:$@ $** $(LIBS) +!if "$(POSTLD)" != "" + $(POSTLD) $@ $** $(LIBS) +!endif diff --git a/dist/config/config.make b/dist/config/config.make index 426384e..69d365e 100644 --- a/dist/config/config.make +++ b/dist/config/config.make @@ -11,6 +11,12 @@ LD := $(CXX) LDFLAGS := $(CXXFLAGS) LIBS := +# Optional post-link command. The first argument to this command is +# the executable name and the rest of the arguments are the object +# files and libraries that were used to link this executable. +# +POSTLD := + # Set RANLIB to empty if your system does not need ranlib. # AR := ar diff --git a/dist/config/config.nmake b/dist/config/config.nmake index 24a267f..32bf258 100644 --- a/dist/config/config.nmake +++ b/dist/config/config.nmake @@ -11,6 +11,12 @@ LD = link.exe LDFLAGS = /nologo LIBS = +# Optional post-link command. The first argument to this command is +# the executable name and the rest of the arguments are the object +# files and libraries that were used to link this executable. +# +POSTLD = + # Set RANLIB to empty if your system does not need ranlib. # AR = lib.exe diff --git a/dist/etc/integrity/config.make b/dist/etc/integrity/config.make index 5755056..0e9b237 100644 --- a/dist/etc/integrity/config.make +++ b/dist/etc/integrity/config.make @@ -16,6 +16,12 @@ LD := $(CXX) LDFLAGS := $(CXXFLAGS) LIBS := +# Optional post-link command. The first argument to this command is +# the executable name and the rest of the arguments are the object +# files and libraries that were used to link this executable. +# +POSTLD := + # Set RANLIB to empty if your system does not need ranlib. # AR := ar diff --git a/dist/etc/iphone/config-device.make b/dist/etc/iphone/config-device.make index 9b98c36..09a7c26 100644 --- a/dist/etc/iphone/config-device.make +++ b/dist/etc/iphone/config-device.make @@ -18,6 +18,12 @@ LD := $(CXX) LDFLAGS := $(CXXFLAGS) LIBS := +# Optional post-link command. The first argument to this command is +# the executable name and the rest of the arguments are the object +# files and libraries that were used to link this executable. +# +POSTLD := + # Set RANLIB to empty if your system does not need ranlib. # AR := $(IPHONE_PLATFORM)/usr/bin/ar diff --git a/dist/etc/iphone/config-simulator.make b/dist/etc/iphone/config-simulator.make index 2fa5632..803e04f 100644 --- a/dist/etc/iphone/config-simulator.make +++ b/dist/etc/iphone/config-simulator.make @@ -18,6 +18,12 @@ LD := $(CXX) LDFLAGS := $(CXXFLAGS) LIBS := +# Optional post-link command. The first argument to this command is +# the executable name and the rest of the arguments are the object +# files and libraries that were used to link this executable. +# +POSTLD := + # Set RANLIB to empty if your system does not need ranlib. # AR := $(IPHONE_PLATFORM)/usr/bin/ar diff --git a/dist/etc/lynxos/config-4.2.make b/dist/etc/lynxos/config-4.2.make index 1215121..a999cd5 100644 --- a/dist/etc/lynxos/config-4.2.make +++ b/dist/etc/lynxos/config-4.2.make @@ -17,6 +17,12 @@ LD := $(CXX) LDFLAGS := $(CXXFLAGS) LIBS := +# Optional post-link command. The first argument to this command is +# the executable name and the rest of the arguments are the object +# files and libraries that were used to link this executable. +# +POSTLD := + # Set RANLIB to empty if your system does not need ranlib. # AR := ar diff --git a/dist/etc/lynxos/config-5.0.make b/dist/etc/lynxos/config-5.0.make index d0a22bb..6206035 100644 --- a/dist/etc/lynxos/config-5.0.make +++ b/dist/etc/lynxos/config-5.0.make @@ -17,6 +17,12 @@ LD := $(CXX) LDFLAGS := $(CXXFLAGS) LIBS := +# Optional post-link command. The first argument to this command is +# the executable name and the rest of the arguments are the object +# files and libraries that were used to link this executable. +# +POSTLD := + # Set RANLIB to empty if your system does not need ranlib. # AR := ar diff --git a/dist/etc/qnx/config-6.3-gcc-2.95.make b/dist/etc/qnx/config-6.3-gcc-2.95.make index 6a4a7e3..7ae6df5 100644 --- a/dist/etc/qnx/config-6.3-gcc-2.95.make +++ b/dist/etc/qnx/config-6.3-gcc-2.95.make @@ -16,6 +16,12 @@ LD := $(CXX) LDFLAGS := $(CXXFLAGS) LIBS := +# Optional post-link command. The first argument to this command is +# the executable name and the rest of the arguments are the object +# files and libraries that were used to link this executable. +# +POSTLD := + # Set RANLIB to empty if your system does not need ranlib. # AR := ntox86-ar diff --git a/dist/etc/qnx/config-6.3-gcc-3.3.make b/dist/etc/qnx/config-6.3-gcc-3.3.make index 915fe6c..4385ba7 100644 --- a/dist/etc/qnx/config-6.3-gcc-3.3.make +++ b/dist/etc/qnx/config-6.3-gcc-3.3.make @@ -16,6 +16,12 @@ LD := $(CXX) LDFLAGS := $(CXXFLAGS) LIBS := +# Optional post-link command. The first argument to this command is +# the executable name and the rest of the arguments are the object +# files and libraries that were used to link this executable. +# +POSTLD := + # Set RANLIB to empty if your system does not need ranlib. # AR := ntox86-ar diff --git a/dist/etc/qnx/config-6.4.make b/dist/etc/qnx/config-6.4.make index c8603cb..3e98886 100644 --- a/dist/etc/qnx/config-6.4.make +++ b/dist/etc/qnx/config-6.4.make @@ -16,6 +16,12 @@ LD := $(CXX) LDFLAGS := $(CXXFLAGS) LIBS := +# Optional post-link command. The first argument to this command is +# the executable name and the rest of the arguments are the object +# files and libraries that were used to link this executable. +# +POSTLD := + # Set RANLIB to empty if your system does not need ranlib. # AR := ntox86-ar diff --git a/dist/etc/vxworks/config-5.5.1.make b/dist/etc/vxworks/config-5.5.1.make index c94dc3f..7274dbf 100644 --- a/dist/etc/vxworks/config-5.5.1.make +++ b/dist/etc/vxworks/config-5.5.1.make @@ -17,6 +17,12 @@ LD := $(CXX) LDFLAGS := $(CXXFLAGS) -r -nostdlib -Wl,-X LIBS := +# Optional post-link command. The first argument to this command is +# the executable name and the rest of the arguments are the object +# files and libraries that were used to link this executable. +# +POSTLD := + # Set RANLIB to empty if your system does not need ranlib. # AR := arppc diff --git a/dist/etc/vxworks/config-6.4-max.make b/dist/etc/vxworks/config-6.4-max.make index 1811b38..ece52e9 100644 --- a/dist/etc/vxworks/config-6.4-max.make +++ b/dist/etc/vxworks/config-6.4-max.make @@ -4,7 +4,7 @@ # # Note that iostream support requires static initialization so # you will need to 'munch' the examples (and your application) -# before you can run them. Here are the sample step that are +# before you can run them. Here are the sample steps that are # needed to run the C++/Hybrid 'library' example: # # $ cd examples/cxx/hybrid/library/ @@ -15,6 +15,9 @@ # $ ccpentium -O3 -c -fdollars-in-identifiers -fno-zero-initialized-in-bss -I$WIND_BASE/target/h -I$WIND_BASE/target/h/wrn/coreip ctdt.c -o ctdt.o # $ ccpentium -O3 partial-image.o ctdt.o -o driver # +# You could also wrap the last three steps into a script and use +# is as a post-link command (see POSTLD below). +# # Toolchain. # @@ -29,6 +32,12 @@ LD := $(CXX) LDFLAGS := $(CXXFLAGS) LIBS := +# Optional post-link command. The first argument to this command is +# the executable name and the rest of the arguments are the object +# files and libraries that were used to link this executable. +# +POSTLD := + # Set RANLIB to empty if your system does not need ranlib. # AR := arpentium diff --git a/dist/etc/vxworks/config-6.4-min.make b/dist/etc/vxworks/config-6.4-min.make index 4116c10..124e775 100644 --- a/dist/etc/vxworks/config-6.4-min.make +++ b/dist/etc/vxworks/config-6.4-min.make @@ -16,6 +16,12 @@ LD := $(CXX) LDFLAGS := $(CXXFLAGS) LIBS := +# Optional post-link command. The first argument to this command is +# the executable name and the rest of the arguments are the object +# files and libraries that were used to link this executable. +# +POSTLD := + # Set RANLIB to empty if your system does not need ranlib. # AR := arpentium diff --git a/dist/etc/vxworks/config-6.7-max.make b/dist/etc/vxworks/config-6.7-max.make index 77ad171..92dd363 100644 --- a/dist/etc/vxworks/config-6.7-max.make +++ b/dist/etc/vxworks/config-6.7-max.make @@ -4,7 +4,7 @@ # # Note that iostream support requires static initialization so # you will need to 'munch' the examples (and your application) -# before you can run them. Here are the sample step that are +# before you can run them. Here are the sample steps that are # needed to run the C++/Hybrid 'library' example: # # $ cd examples/cxx/hybrid/library/ @@ -15,6 +15,9 @@ # $ ccpentium -O3 -c -fdollars-in-identifiers -fno-zero-initialized-in-bss -I$WIND_BASE/target/h -I$WIND_BASE/target/h/wrn/coreip -D_VSB_CONFIG_FILE=\"$WIND_BASE/target/lib/h/config/vsbConfig.h\" ctdt.c -o ctdt.o # $ ccpentium -O3 -r -nostdlib -T $WIND_BASE/target/h/tool/gnu/ldscripts/link.OUT partial-image.o ctdt.o -o driver # +# You could also wrap the last three steps into a script and use +# is as a post-link command (see POSTLD below). +# # Toolchain. # @@ -29,6 +32,12 @@ LD := $(CXX) LDFLAGS := $(CXXFLAGS) LIBS := +# Optional post-link command. The first argument to this command is +# the executable name and the rest of the arguments are the object +# files and libraries that were used to link this executable. +# +POSTLD := + # Set RANLIB to empty if your system does not need ranlib. # AR := arpentium diff --git a/dist/etc/vxworks/config-6.7-min.make b/dist/etc/vxworks/config-6.7-min.make index babc9f3..5e7ae7b 100644 --- a/dist/etc/vxworks/config-6.7-min.make +++ b/dist/etc/vxworks/config-6.7-min.make @@ -16,6 +16,12 @@ LD := $(CXX) LDFLAGS := $(CXXFLAGS) LIBS := +# Optional post-link command. The first argument to this command is +# the executable name and the rest of the arguments are the object +# files and libraries that were used to link this executable. +# +POSTLD := + # Set RANLIB to empty if your system does not need ranlib. # AR := arpentium diff --git a/tests/cxx/hybrid/makefile b/tests/cxx/hybrid/makefile index 810c9c1..cb664d9 100644 --- a/tests/cxx/hybrid/makefile +++ b/tests/cxx/hybrid/makefile @@ -11,7 +11,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make all_tests := sequences polymorphism iterator built-in default enumeration \ iso8859-1 list recursive test-template union binary/cdr binary/xdr choice \ -clone pattern +clone pattern facets build_tests := sequences -- cgit v1.1