################################################################ # Help ################################################################ # This makefile is intended to be included by project-specific # makefiles. # # An executable is defined by the executable name, and the # source files that it is made from. # # Here is an example makefile that builds a programme called # `myprog' from source files main.cpp support.c foo.cpp: # # include common.mk # $(top_exe,myprog,main.cpp support.c foo.cpp) # -include $(top_exe_include,main.cpp support.c foo.cpp) # # The actual executable's name will contain the build type and # the host it was built on/for. E.g.: # myprog.gcc3.2-release.OpenBSD-i386.exe # # # Adding a new build type # ----------------------- # # To add a new build type, do the following: # # 1. write rules for converting source files into appropriately # named .o files. This means rules like: # %..o: %.cpp; # # 2. For each filename suffix, write two functions, # top_src2obj__ and # top_src2d__ that take a single filename # $1 with suffix (including the `.') and evaluates # to the corresponding object file and the corresponding # makefile dependency file(s). # For example: # # top_src2obj_gcc$(top_gcc_version)-debug.$(top_host)_.cpp\ # = $1.gcc$(top_gcc_version)-debug.$(top_host).o # top_src2d_gcc$(top_gcc_version)-debug.$(top_host)_.cpp\ # = $1.gcc$(top_gcc_version)-debug.$(top_host).o.d # # 3. Write a function top_link_ which links .o files # in $2 to output file $1. # # There are various functions already defined that help # with writing the above functions. For example: # $(call top_gcc$(top_gcc_version)_preproc preprocesses using gcc, # also generating a .d file. # $(call top_gcc$(top_gcc_version)_compile compiles using gcc, also # generating .d file. # # Also, $(top_gcc$(top_gcc_version)-link.$(top_host)) is a link command that # can be followed by `-o ' when using gcc as a linker. # # This makefile makes $(call top_exe,...) eventually call # top_exe., passing $1=executable name, $2=source files, # and $(call top_exe_include,...) eventually call # $(call top_exe_include.,...) passing $1=source files. # So you can simply define these, and your new build type will be # incorporated into the general system. # # This makefile uses ideas about monolithic makefiles, and some GNU-make # information in the following # articles: # http://www.tip.net.au/~millerp/rmch/recu-make-cons-harm.html # http://make.paulandlesley.org/ # top_all: @echo common.mk: No target specified. # prevent multiple inclusion. ifndef top_ top_ := foo ################################################################ # Build settings ################################################################ # We only set these if not already set (e.g. on the command line # or by the makefile that includes this makefile). ifndef top_gcc top_gcc := gcc endif ifndef top_g++ top_g++ := g++ endif top_hostrelease := $(shell uname -r) top_hosthardware:= $(shell uname -m) top_hostos := $(shell uname -s) ifneq ($(findstring CYGWIN,$(top_hostos)),) top_hostrelease:= endif top_host := $(top_hostos)$(top_hostrelease)-$(top_hosthardware) # E.g. OpenBSD3.3-i386 top_gcc_version_raw := $(shell $(top_gcc) -dumpversion) top_g++_version_raw := $(shell $(top_g++) -dumpversion) ifneq ($(top_gcc_version_raw),$(top_g++_version_raw)) $(error gcc and g++ versions are different: $(top_gcc)=$(top_gcc_version_raw) $(top_g++)=$(top_g++_version_raw)) endif ifeq ($(top_gcc_version_raw),) $(error can't find gcc version - top_gcc=$(top_gcc)) endif top_gcc_version := $(top_gcc_version_raw) top_gcc_version := $(patsubst 2.95.2%,2.95.2,$(top_gcc_version)) top_gcc_version := $(patsubst 2.95.3%,2.95.3,$(top_gcc_version)) top_gcc_version := $(patsubst 3.2.%,3.2,$(top_gcc_version)) top_gcc_version := $(patsubst 3%,3.2,$(top_gcc_version)) # We treat all 2.95.2.x as 2.95.2, all 2.95.3-x as gcc-2.95.3, and all 3.2.x as 3.2 # also treat all gcc3% as gcc3.2. bit of a hack, but it seems to work for some things # and there will be decreasingly few gcc 3.1's out there. top_gcc$(top_gcc_version) := $(top_gcc) top_g++$(top_gcc_version) := $(top_g++) # All rules that call gcc append the versionnumber they are designed to work # with. E.g. a 2.95.3-specific rule uses $(top_gcc2.95.2). ifndef top_build top_build := gcc$(top_gcc_version)-debug endif override top_build := $(patsubst gcc-%,gcc$(top_gcc_version)-%,$(top_build)) # Now we insert gcc version number into the build type, if it is for gcc. top_build2 := $(top_build).$(top_host) # This uniquely identifier the build. All generated files have $(top_build2) in their # filenames. # Remove GNU make's default set of suffix rules .SUFFIXES: top_includes += $(top_boostdir) ################################################################ # Gcc flags ################################################################ # We use different commands depending on the version of gcc. # E.g. gcc 2.95's auto-dependency output needs to be processed # in order to make it usable - see top_gcc2.95_hackdepends. # Things for gcc 2.95 # gcc 2.95.2 doesn't come with , but one is available on # the internet, so we make a rule for downloading it: top_gcc2.95.2-sstream-url := http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00700/sstream top_gcc2.95.2-sstream := common.mk-gcc2.95-sstream/sstream $(top_gcc2.95.2-sstream): @echo 'Downloading for gcc 2.95 from $(top_gcc2.95.2-sstream-url)' mkdir -p $(dir $@) lynx -dump $(top_gcc2.95.2-sstream-url) >$@ top_gcc2.95.2-extra-deps := $(top_gcc2.95.2-sstream) define top_gcc2.95_hackdepends cat $(notdir $(basename $2)).d | sed 's|^[^: ][^: ]*|$1|g' > $1-hackdepends-tmp.d &&\ rm $(notdir $(basename $2)).d &&\ cp $1-hackdepends-tmp.d $1.d &&\ sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ -e '/^$$/ d' -e 's/$$/ :/' < $1-hackdepends-tmp.d >> $1.d &&\ rm $1-hackdepends-tmp.d endef # Usage: $(call top_gcc_hackdepends0, $1=out, $2=in, $3=badout) # $3 is the incorrect target name that gcc puts in the .d file. # This macro replaces this with the correct target name, $1. # Actually, $3 is ignored - the incorrect name is whatever is # at start of line followed by `:' in the original .d file. top_gnu2.95_base :=\ -Wall -W -Wundef -Wpointer-arith -Wno-bad-function-cast\ -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes\ -Wmissing-prototypes -Wmissing-declarations -Wno-redundant-decls\ -Wnested-externs -Wno-inline -Wformat\ $(addprefix -I,$(top_includes))\ define top_gnu2.95_compile echo 'gcc -c: $3' &&\ mkdir -p $(dir $3) &&\ $(top_$1) -MD -c\ $(top_gnu2.95_base)\ $4 $(addprefix -I,$5) $(addprefix -D,$6)\ -o $3 $2 &&\ $(call top_gcc2.95_hackdepends,$3,$2) endef # Usage: $(call top_gnu2.95_compile, $1=compiler, $2=in, $3=out, $4=flags, # $5=includes, $6=defines). # -Wredundant-decls gives warnings about assert() on openbsd 3.1. # -Wno-inline gives warnings for stl headers # -Wbad-function-cast - warns for all casts of fn returns. not helpful. define top_gnu2.95_preproc echo "gcc -E: $3" &&\ mkdir -p $(dir $3) &&\ $(top_$1) -E -MD\ $(top_gnu2.95_base)\ $4 $(addprefix -I,$5) $(addprefix -D,$6) $2 > $3-tmp &&\ $(call top_gcc2.95_hackdepends,$3,$2) &&\ $(top_$1) $(top_gnu2.95_base) -Wall -W -E -dM $4 $(addprefix -I,$5) $(addprefix -D,$6) $2 >> $3-tmp &&\ cat $3-tmp | sed -e 's|\(^# [0-9][0-9]* "[^"]*"[ 0-9]*\) 4$$|\1|g' > $3- &&\ rm $3-tmp &&\ grep -v "#define _POSIX_THREADS" $3- >$3 &&\ rm $3- endef # Usage: $(call top_gnu2.95_preprocess, $1=gcc|g++, $2=in, $3=out, $4=flags, $5=includes, $6=defs) # Generates pre-processed souce files, including trailing # #defines so that we can append code and still be able to # compile. # Note that g++'s -dD claims to restore #defines # but it has a bug - doesn't output #undef statements, resulting in # errors if a macro is #defined and then #undefined. # So we generate the active macros sparately, using g++'s -dM, which seems # to work correctly. See http://gcc.gnu.org/onlinedocs/gcc_3.html#SEC13 . # # The sed regex removes `4\n' from end of #line lines. Gcc's # preprocessor appends ` 4' to indicate that a file is a C # file, but they cause subsequent compiles to complain about # `warning: badly nested C headers from preprocessor' and # template code occuring in C files. # For example, it converts: # # 1 "/usr/include/machine/cdefs.h" 1 3 4 # into: # # 1 "/usr/include/machine/cdefs.h" 1 3 top_gnu2.95.2_compile = $(call top_gnu2.95_compile,$1,$2,$3,$4,$5,$6 ExceptionStream_NO_SSTREAM) top_gnu2.95.2_preproc = $(call top_gnu2.95_preproc,$1,$2,$3,$4,$5,$6 ExceptionStream_NO_SSTREAM) top_gnu2.95.3_preproc = $(call top_gnu2.95_preproc,$1,$2,$3,$4,$5,$6) top_gnu2.95.3_compile = $(call top_gnu2.95_compile,$1,$2,$3,$4,$5,$6) # Things for gcc 3.2 top_gcc3.2_warnings_$(top_hostos)$(top_hostrelease) := -Wall -W -Wundef -Wpointer-arith\ -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion\ -Wstrict-prototypes -Wmissing-prototypes\ -Wmissing-format-attribute\ -Wredundant-decls -Wno-unreachable-code\ -Wno-inline top_gcc3.2_warnings_FreeBSD5.1-RELEASE :=\ $(patsubst -Wredundant-decls,-Wno-redundant-decls,$(top_gcc3.2_warnings_$(top_hostos)$(top_hostrelease))) #-Wredundant-decls gives loads of warnings under freebsd 5.1 define top_gnu3.2_compile echo "gcc3.2 -c: $3" &&\ mkdir -p $(dir $3) &&\ $1\ -I $(dir $2)\ -MP -MF $3.d -MD\ -c $(top_gcc3.2_warnings_$(top_hostos)$(top_hostrelease))\ $4 $(addprefix -I,$(top_includes)) $(addprefix -I,$5) $(addprefix -D,$6)\ -o $3 $2 endef # Usage: $(call top_gnu_compile, $1=compiler, $2=in, $3=out, $4=flags, $5=includes, $6=defines) # Expands to commands required to compile using gcc or g++ 3.2, and also # generates full dependency information. # For info on the -M switches, see: # http://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Preprocessor-Options.html#Preprocessor%20Options # Briefly, -MP adds phony target for each .h file, -MF sets the output .d filename (default # would be foo.d, and we want foo.o.d), -MD turns on the dependencies generation. # -Wunreachable-code seems to get things plain wrong... # -Wshadow is not helpfule because it warns against shadowing previous locals. the warning against # shadowing enclosing scopes' names is useful though. define top_gnu3.2_preproc echo "gcc3.2 -E: $3" &&\ mkdir -p $(dir $3) &&\ $1\ -Wall -W\ -E -dD\ -I $(dir $2)\ -MT $3 -MP -MF $3.d -MD\ $4 $(addprefix -I,$(top_includes)) $(addprefix -I,$5) $(addprefix -D,$6) $2\ | sed\ -e 's|\(^# [0-9][0-9]* *.*\) 4$$|\1|g'\ -e 's|^#define __STDC__ 1$$||g'\ -e 's|^#define __STDC_HOSTED__ 1$$||g'\ > $3 endef # Here's the reason for the `sed': When gcc-3.2 -E sees `#include ' # or `#include ', it seems to assume that the header is a C header, and # flags the header with `# ... 4', which means that the header should # be treated as being wrapped in an implicit `extern "C"'. This doesn't happen # with `#include "foo.h"'. # This makes things break if we attempt to compile the output from `g++ -E'. # So, we use sed to remove all trailing ` 4' from `# ...' lines. # For info about the digits after `# ', see: # See http://gcc.gnu.org/onlinedocs/gcc-3.2/cpp/Preprocessor-Output.html#Preprocessor%20Output top_gcc2.95.2_preproc = $(call top_gnu2.95.2_preproc,$(top_gcc2.95.2),$1,$2,$3,$4,$5) top_gcc2.95.2_compile = $(call top_gnu2.95.2_compile,$(top_gcc2.95.2),$1,$2,$3,$4,$5) top_g++2.95.2_preproc = $(call top_gnu2.95.2_preproc,$(top_g++2.95.2),$1,$2,$3,$4 $(dir $(top_gcc2.95.2-sstream)),$5) top_g++2.95.2_compile = $(call top_gnu2.95.2_compile,$(top_g++2.95.2),$1,$2,$3,$4 $(dir $(top_gcc2.95.2-sstream)),$5) top_gcc2.95.3_preproc = $(call top_gnu2.95.3_preproc,$(top_gcc2.95.3),$1,$2,$3,$4,$5) top_gcc2.95.3_compile = $(call top_gnu2.95.3_compile,$(top_gcc2.95.3),$1,$2,$3,$4,$5) top_g++2.95.3_preproc = $(call top_gnu2.95.3_preproc,$(top_g++2.95.3),$1,$2,$3,$4,$5) top_g++2.95.3_compile = $(call top_gnu2.95.3_compile,$(top_g++2.95.3),$1,$2,$3,$4,$5) top_gcc3.2_preproc = $(call top_gnu3.2_preproc,$(top_gcc3.2),$1,$2,$3,$4,$5) top_gcc3.2_compile = $(call top_gnu3.2_compile,$(top_gcc3.2),$1,$2,$3,$4,$5) top_g++3.2_preproc = $(call top_gnu3.2_preproc,$(top_g++3.2),$1,$2,$3,$4,$5) top_g++3.2_compile = $(call top_gnu3.2_compile,$(top_g++3.2),$1,$2,$3,$4,$5) # Usage: $(call top_gcc_compile, $1=in, $2=out, $3=flags, $4=includes, $5=defines) # Usage: $(call top_g++_compile, $1=in, $2=out, $3=flags, $4=includes, $5=defines) # Usage: $(call top_gcc_preproc, $1=in, $2=out, $3=flags, $4=includes, $5=defines) # Usage: $(call top_g++_preprocess, $1=in, $2=out, $3=flags, $4=includes, $5=defines) # Expands to commands required to compile/preprocess using g++, and also # generates full dependency information in .d # Generates pre-processed souce files, including trailing # #defines so that we can append code and still be able to # compile. # Note that g++'s -dD claims to restore #defines # but it has a bug - doesn't output #undef statements, resulting in # errors if a macro is #defined and then #undefined. # So we generate the active macros sparately, using g++'s -dM, which seems # to work correctly. See http://gcc.gnu.org/onlinedocs/gcc_3.html#SEC13 . # # The sed regex removes `4\n' from end of #line lines. Gcc's # preprocessor appends ` 4' to indicate that a file is a C # file, but they cause subsequent compiles to complain about # `warning: badly nested C headers from preprocessor' and # template code occuring in C files. # For example, it converts: # # 1 "/usr/include/machine/cdefs.h" 1 3 4 # into: # # 1 "/usr/include/machine/cdefs.h" 1 3 ################################################################ # Platform-specific header/library paths ################################################################ top_gcc_threads_OpenBSD$(top_hostrelease)-$(top_hosthardware) := -pthread top_gcc_threads_FreeBSD5.1-RELEASE-$(top_hosthardware) := -pthread top_gcc_threads := $(top_gcc_threads_$(top_host)) # openbsd's gcc requires -pthread specifying for thread-safe code. # default include/libs, using gtk's config programme. top_gcc$(top_gcc_version)-x11.compile-extra.$(top_host) := $(shell gtk-config --cflags) top_gcc$(top_gcc_version)-x11.link-extra.$(top_host) := $(shell gtk-config --libs) -lXm -lXt top_gcc2.95.3-x11.compile-extra.OpenBSD$(top_hostrelease)-$(top_hosthardware) := -I /usr/local/include -I/usr/X11R6/include -idirafter . top_gcc2.95.3-x11.link-extra.OpenBSD$(top_hostrelease)-$(top_hosthardware) := -L/usr/local/lib -L/usr/X11R6/lib -lXm -lXmu -lXext -lXt -lX11 top_gcc3.2-x11.compile-extra.OpenBSD$(top_hostrelease)-$(top_hosthardware) := -I/usr/X11R6/include -idirafter . -Wno-cast-qual -I /home/jules/hierprof/Microline3.0 top_gcc3.2-x11.link-extra.OpenBSD$(top_hostrelease)-$(top_hosthardware) := -L/usr/local/lib -L/usr/X11R6/lib -lXm -lXext -lXt -lX11 # -idirafter . seems to make headers always be found in current dir. # -Wno-cast-qual stops warnins when passing const char* to Motif fns taking char*. top_gcc3.2-x11gtk2.compile-extra.OpenBSD$(top_hostrelease)-$(top_hosthardware) := $(shell pkg-config --cflags gtk+-2.0) top_gcc3.2-x11gtk2.link-extra.OpenBSD$(top_hostrelease)-$(top_hosthardware) := $(shell pkg-config --libs gtk+-2.0) -lgthread-2.0 -L/usr/X11R6/lib -lXt top_gcc3.2-x11.compile-extra.FreeBSD$(top_hostrelease)-$(top_hosthardware) := -I/usr/X11R6/include top_gcc3.2-x11.link-extra.FreeBSD$(top_hostrelease)-$(top_hosthardware) := -L/usr/local/lib -L/usr/X11R6/lib -lXm -lXext -lXt -lX11 top_gcc3.2-x11.compile-extra.CYGWIN_NT-5.0$(top_hostrelease)-$(top_hosthardware) := -I/usr/X11R6/include -idirafter . -Wno-cast-qual top_gcc3.2-x11.link-extra.CYGWIN_NT-5.0$(top_hostrelease)-$(top_hosthardware) := -L/usr/X11R6/lib -lXm\ -lXext -lXt -lX11\ -lSM -lICE -L/usr/local/lib -lrpclib ################################################################ # Non-compilation commands ################################################################ ifeq ($(top_cmm),) top_cmm = cmm endif ################################################################ # The rules ################################################################ # Release %.c.ii-gcc$(top_gcc_version)-release.$(top_host).c: %.c; $(call top_gcc$(top_gcc_version)_preproc,$<,$@, -O2 -DNDEBUG -x c) %.c.gcc$(top_gcc_version)-release.$(top_host).o: %.c; $(call top_gcc$(top_gcc_version)_compile,$<,$@, -O2 -DNDEBUG) %.cpp.ii-gcc$(top_gcc_version)-release.$(top_host).cpp: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(call top_gcc$(top_gcc_version)_preproc,$<,$@, -O2 -DNDEBUG -x c++) %.cmm.ii-gcc$(top_gcc_version)-release.$(top_host).cmm: %.cmm $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_preproc,$<,$@, -O2 -DNDEBUG -x c++) %.cpp.gcc$(top_gcc_version)-release.$(top_host).o: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_compile,$<,$@, -O2 -DNDEBUG) # Release -O3 %.c.ii-gcc$(top_gcc_version)-releaseO3.$(top_host).c: %.c; $(call top_gcc$(top_gcc_version)_preproc,$<,$@, -O3 -DNDEBUG -x c) %.c.gcc$(top_gcc_version)-releaseO3.$(top_host).o: %.c; $(call top_gcc$(top_gcc_version)_compile,$<,$@, -O3 -DNDEBUG) %.cpp.ii-gcc$(top_gcc_version)-releaseO3.$(top_host).cpp: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(call top_gcc$(top_gcc_version)_preproc,$<,$@, -O3 -DNDEBUG -x c++) %.cmm.ii-gcc$(top_gcc_version)-releaseO3.$(top_host).cmm: %.cmm $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_preproc,$<,$@, -O3 -DNDEBUG -x c++) %.cpp.gcc$(top_gcc_version)-releaseO3.$(top_host).o: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_compile,$<,$@, -O3 -DNDEBUG) # Release -pg %.c.ii-gcc$(top_gcc_version)-release-pg.$(top_host).c: %.c; $(call top_gcc$(top_gcc_version)_preproc,$<,$@, -pg -O2 -DNDEBUG -x c) %.c.gcc$(top_gcc_version)-release-pg.$(top_host).o: %.c; $(call top_gcc$(top_gcc_version)_compile,$<,$@, -pg -O2 -DNDEBUG) %.cpp.ii-gcc$(top_gcc_version)-release-pg.$(top_host).cpp: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(call top_gcc$(top_gcc_version)_preproc,$<,$@, -pg -O2 -DNDEBUG -x c++) %.cmm.ii-gcc$(top_gcc_version)-release-pg.$(top_host).cmm: %.cmm $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_preproc,$<,$@, -pg -O2 -DNDEBUG -x c++) %.cpp.gcc$(top_gcc_version)-release-pg.$(top_host).o: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_compile,$<,$@, -pg -O2 -DNDEBUG) # Release threads/x11 %.c.ii-gcc$(top_gcc_version)-release-threads-x11.$(top_host).cmm: %.c; $(call top_gcc$(top_gcc_version)_preproc,$<,$@, $(top_gcc_threads) $(top_gcc$(top_gcc_version)-x11.compile-extra.$(top_host)) -O2 -DNDEBUG -x c) %.c.gcc$(top_gcc_version)-release-threads-x11.$(top_host).o: %.c; $(call top_gcc$(top_gcc_version)_compile,$<,$@, $(top_gcc_threads) $(top_gcc$(top_gcc_version)-x11.compile-extra.$(top_host)) -O2 -DNDEBUG) %.cpp.ii-gcc$(top_gcc_version)-release-threads-x11.$(top_host).cpp: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_preproc,$<,$@, $(top_gcc_threads) $(top_gcc$(top_gcc_version)-x11.compile-extra.$(top_host)) -O2 -DNDEBUG -x c++) %.cmm.ii-gcc$(top_gcc_version)-release-threads-x11.$(top_host).cmm: %.cmm $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_preproc,$<,$@, $(top_gcc_threads) $(top_gcc$(top_gcc_version)-x11.compile-extra.$(top_host)) -O2 -DNDEBUG -x c++) %.cpp.gcc$(top_gcc_version)-release-threads-x11.$(top_host).o: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_compile,$<,$@, $(top_gcc_threads) $(top_gcc$(top_gcc_version)-x11.compile-extra.$(top_host)) -O2 -DNDEBUG) # Debug %.c.ii-gcc$(top_gcc_version)-debug.$(top_host).c: %.c; $(call top_gcc$(top_gcc_version)_preproc,$<,$@, -g -x c) %.c.gcc$(top_gcc_version)-debug.$(top_host).o: %.c; $(call top_gcc$(top_gcc_version)_compile,$<,$@, -g) %.cpp.ii-gcc$(top_gcc_version)-debug.$(top_host).cpp: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(call top_gcc$(top_gcc_version)_preproc,$<,$@, -g -x c++) %.cmm.ii-gcc$(top_gcc_version)-debug.$(top_host).cmm: %.cmm $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_preproc,$<,$@, -g -x c++) %.cpp.gcc$(top_gcc_version)-debug.$(top_host).o: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_compile,$<,$@, -g) # Debug shared %.cpp.gcc$(top_gcc_version)-debug-shared.$(top_host).o: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_compile,$<,$@, -g -fpic) # Release shared %.cpp.gcc$(top_gcc_version)-release-shared.$(top_host).o: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_compile,$<,$@, -O2 -DNDEBUG -fpic) # Debug x11 %.c.ii-gcc$(top_gcc_version)-debug-x11.$(top_host).c: %.c; $(call top_gcc$(top_gcc_version)_preproc,$<,$@, $(top_gcc$(top_gcc_version)-x11.compile-extra.$(top_host)) -g -x c) %.c.gcc$(top_gcc_version)-debug-x11.$(top_host).o: %.c; $(call top_gcc$(top_gcc_version)_compile,$<,$@, $(top_gcc$(top_gcc_version)-x11.compile-extra.$(top_host)) -g) %.cpp.ii-gcc$(top_gcc_version)-debug-x11.$(top_host).cpp: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(top_gcc$(top_gcc_version)-extra-deps);; $(call top_g++$(top_gcc_version)_preproc,$<,$@, $(top_gcc$(top_gcc_version)-x11.compile-extra.$(top_host)) -g -x c++) %.cmm.ii-gcc$(top_gcc_version)-debug-x11.$(top_host).cmm: %.cmm $(top_gcc$(top_gcc_version)-extra-deps); $(top_gcc$(top_gcc_version)-extra-deps);; $(call top_g++$(top_gcc_version)_preproc,$<,$@, $(top_gcc$(top_gcc_version)-x11.compile-extra.$(top_host)) -g -x c++) %.cpp.gcc$(top_gcc_version)-debug-x11.$(top_host).o: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_compile,$<,$@, $(top_gcc$(top_gcc_version)-x11.compile-extra.$(top_host)) -g) # Release x11 %.c.ii-gcc$(top_gcc_version)-release-x11.$(top_host).c: %.c; $(call top_gcc$(top_gcc_version)_preproc,$<,$@, $(top_gcc$(top_gcc_version)-x11.compile-extra.$(top_host)) -O2 -DNDEBUG -x c) %.c.gcc$(top_gcc_version)-release-x11.$(top_host).o: %.c; $(call top_gcc$(top_gcc_version)_compile,$<,$@, $(top_gcc$(top_gcc_version)-x11.compile-extra.$(top_host)) -O2 -DNDEBUG) %.cpp.ii-gcc$(top_gcc_version)-release-x11.$(top_host).cpp: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_preproc,$<,$@, $(top_gcc$(top_gcc_version)-x11.compile-extra.$(top_host)) -O2 -DNDEBUG -x c++) %.cmm.ii-gcc$(top_gcc_version)-release-x11.$(top_host).cmm: %.cmm $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_preproc,$<,$@, $(top_gcc$(top_gcc_version)-x11.compile-extra.$(top_host)) -O2 -DNDEBUG -x c++) %.cpp.gcc$(top_gcc_version)-release-x11.$(top_host).o: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_compile,$<,$@, $(top_gcc$(top_gcc_version)-x11.compile-extra.$(top_host)) -O2 -DNDEBUG) # Debug threads/x11 %.c.ii-gcc$(top_gcc_version)-debug-threads-x11.$(top_host).c: %.c; $(call top_gcc$(top_gcc_version)_preproc,$<,$@, $(top_gcc_threads) $(top_gcc$(top_gcc_version)-x11.compile-extra.$(top_host)) -g -x c) %.c.gcc$(top_gcc_version)-debug-threads-x11.$(top_host).o: %.c; $(call top_gcc$(top_gcc_version)_compile,$<,$@, $(top_gcc_threads) $(top_gcc$(top_gcc_version)-x11.compile-extra.$(top_host)) -g) %.cpp.ii-gcc$(top_gcc_version)-debug-threads-x11.$(top_host).cpp: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_preproc,$<,$@, $(top_gcc_threads) $(top_gcc$(top_gcc_version)-x11.compile-extra.$(top_host)) -g -x c++) %.cmm.ii-gcc$(top_gcc_version)-debug-threads-x11.$(top_host).cmm: %.cmm $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_preproc,$<,$@, $(top_gcc_threads) $(top_gcc$(top_gcc_version)-x11.compile-extra.$(top_host)) -g -x c++) %.cpp.gcc$(top_gcc_version)-debug-threads-x11.$(top_host).o: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_compile,$<,$@, $(top_gcc_threads) $(top_gcc$(top_gcc_version)-x11.compile-extra.$(top_host)) -g) # Debug threads/x11gtk2 %.c.ii-gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host).c: %.c; $(call top_gcc$(top_gcc_version)_preproc,$<,$@, $(top_gcc_threads) $(top_gcc$(top_gcc_version)-x11gtk2.compile-extra.$(top_host)) -g -x c) %.c.gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host).o: %.c; $(call top_gcc$(top_gcc_version)_compile,$<,$@, $(top_gcc_threads) $(top_gcc$(top_gcc_version)-x11gtk2.compile-extra.$(top_host)) -g) %.cpp.ii-gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host).cpp: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_preproc,$<,$@, $(top_gcc_threads) $(top_gcc$(top_gcc_version)-x11gtk2.compile-extra.$(top_host)) -g -x c++) %.cmm.ii-gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host).cmm: %.cmm $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_preproc,$<,$@, $(top_gcc_threads) $(top_gcc$(top_gcc_version)-x11gtk2.compile-extra.$(top_host)) -g -x c++) %.cpp.gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host).o: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_compile,$<,$@, $(top_gcc_threads) $(top_gcc$(top_gcc_version)-x11gtk2.compile-extra.$(top_host)) -g) # STLport top_stlport_dir := /home/jules/STLport-4.5.3 top_gcc2.95.2_stlport_extra := -I$(top_stlport_dir)/stlport -Wno-undef -Wno-cast-qual top_gcc2.95.3_stlport_extra := -I$(top_stlport_dir)/stlport -Wno-undef -Wno-cast-qual top_gcc3.2_stlport_extra := -I$(top_stlport_dir)/stlport -Wno-undef -Wno-cast-qual -Wno-redundant-decls -Wno-missing-format-attribute -Wno-sign-compare # STLport's headers give warnings without -Wno-undef -Wno-cast-qual. # non-threads STLport builds don't work - I think I'm not confiuguring things right, because # the generated .o files require pthreads fns at runtime. %.cpp.gcc$(top_gcc_version)-stlport-release.$(top_host).o: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_compile,$<,$@, $(top_gcc$(top_gcc_version)_stlport_extra) -D_STLP_NOTHREADS -O2 -DNDEBUG) %.cpp.ii-gcc$(top_gcc_version)-stlport-release.$(top_host).cpp: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_preproc,$<,$@, $(top_gcc$(top_gcc_version)_stlport_extra) -D_STLP_NOTHREADS -O2 -DNDEBUG) %.cmm.ii-gcc$(top_gcc_version)-stlport-release.$(top_host).cmm: %.cmm $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_preproc,$<,$@, $(top_gcc$(top_gcc_version)_stlport_extra) -D_STLP_NOTHREADS -O2 -DNDEBUG -x c++) %.cpp.gcc$(top_gcc_version)-stlport-debug2.$(top_host).o: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_compile,$<,$@, $(top_gcc$(top_gcc_version)_stlport_extra) -D_STLP_NOTHREADS -g -D_STLP_DEBUG) %.cpp.ii-gcc$(top_gcc_version)-stlport-debug2.$(top_host).cpp: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_preproc,$<,$@, $(top_gcc$(top_gcc_version)_stlport_extra) -D_STLP_NOTHREADS -g -D_STLP_DEBUG) %.cmm.ii-gcc$(top_gcc_version)-stlport-debug2.$(top_host).cmm: %.cmm $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_preproc,$<,$@, $(top_gcc$(top_gcc_version)_stlport_extra) -D_STLP_NOTHREADS -g -D_STLP_DEBUG -x c++) # STLport debug threads x11 %.cmm.ii-gcc$(top_gcc_version)-stlport-debug2-threads-x11.$(top_host).cmm: %.cmm $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_preproc,$<,$@, $(top_gcc$(top_gcc_version)_stlport_extra) $(top_gcc_threads) $(top_gcc$(top_gcc_version)-x11.compile-extra.$(top_host)) -g -D_STLP_DEBUG -x c++) %.cpp.ii-gcc$(top_gcc_version)-stlport-debug2-threads-x11.$(top_host).cpp: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_preproc,$<,$@, $(top_gcc$(top_gcc_version)_stlport_extra) $(top_gcc_threads) $(top_gcc$(top_gcc_version)-x11.compile-extra.$(top_host)) -g -D_STLP_DEBUG) %.cpp.gcc$(top_gcc_version)-stlport-debug2-threads-x11.$(top_host).o: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_compile,$<,$@, $(top_gcc$(top_gcc_version)_stlport_extra) $(top_gcc_threads) $(top_gcc$(top_gcc_version)-x11.compile-extra.$(top_host)) -g -D_STLP_DEBUG) # STLport debug threads x11gtk2 %.cmm.ii-gcc$(top_gcc_version)-stlport-debug2-threads-x11gtk2.$(top_host).cmm: %.cmm $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_preproc,$<,$@, $(top_gcc$(top_gcc_version)_stlport_extra) $(top_gcc_threads) $(top_gcc$(top_gcc_version)-x11gtk2.compile-extra.$(top_host)) -g -D_STLP_DEBUG -x c++) %.cpp.ii-gcc$(top_gcc_version)-stlport-debug2-threads-x11gtk2.$(top_host).cpp: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_preproc,$<,$@, $(top_gcc$(top_gcc_version)_stlport_extra) $(top_gcc_threads) $(top_gcc$(top_gcc_version)-x11gtk2.compile-extra.$(top_host)) -g -D_STLP_DEBUG) %.cpp.gcc$(top_gcc_version)-stlport-debug2-threads-x11gtk2.$(top_host).o: %.cpp $(top_gcc$(top_gcc_version)-extra-deps); $(call top_g++$(top_gcc_version)_compile,$<,$@, $(top_gcc$(top_gcc_version)_stlport_extra) $(top_gcc_threads) $(top_gcc$(top_gcc_version)-x11gtk2.compile-extra.$(top_host)) -g -D_STLP_DEBUG) top_cygwin2win32 = $(foreach top_x,$1,$(shell cygpath -w $(top_x))) # Usage: # $1=filenames # converts each item in $1 to a windows-style filename. %.cpp.msvc-release.$(top_host).o: %.cpp @echo "msvc cl /c: $3" &&\ cl /c /DWIN32 /DNDEBUG /Fdmsvc.pdb /FD /Fm$@.map /Fo$@ /GR /GX /nologo /Ox /W3 $(call top_cygwin2win32,$<) #%.cpp.ii-msvc-release.$(top_host).cpp: %.cpp # echo msvc cl / # Cmm processing # To force remake when cmm exe is altered, use: # top_cmm_prerequisite = $(top_cmm) %.cmm.cmm-s.cpp: %.cmm $(top_cmm_prerequisite) -mkdir -p $(dir $@) @echo "cmm -s: $@" $(top_cmm) -detailedparse -embeddedfns -s $< $@ %.cpp.cmm-s.cpp: %.cpp $(top_cmm_prerequisite) -mkdir -p $(dir $@) @echo "cmm -s: $@" $(top_cmm) -detailedparse -embeddedfns -s $< $@ %.cmm.cmm-sb.cpp: %.cmm $(top_cmm_prerequisite) -mkdir -p $(dir $@) @echo "cmm -s: $@" $(top_cmm) -detailedparse -embeddedfns\ -pre '#include "/home/jules/utils/debug.h"'\ -block 'debug << debug_PLACE << "\n";'\ -s $< $@ %.cpp.cmm-sb.cpp: %.cpp $(top_cmm_prerequisite) -mkdir -p $(dir $@) @echo "cmm -s: $@" $(top_cmm) -detailedparse -embeddedfns\ -pre '#include "/home/jules/utils/debug.h"'\ -block 'debug << debug_PLACE << "\n";'\ -s $< $@ %.cmm.cmm-ss.cpp: %.cmm $(top_cmm_prerequisite) -mkdir -p $(dir $@) @echo "cmmss: $@" $(top_cmm) -detailedparse -embeddedfns -small-ints -s $< $@ %.cpp.cmm-ss.cpp: %.cpp $(top_cmm_prerequisite) -mkdir -p $(dir $@) @echo "cmmss: $@" $(top_cmm) -detailedparse -embeddedfns -small-ints -s $< $@ top_cmmtrace := /home/jules/top/home/jules/cmm/trace/cmmtrace.gcc$(top_gcc_version)-release.$(top_host).exe top_cmmtrace_header := /home/jules/top/home/jules/cmm/trace/trace.h %.cpp.trace.cpp: %.cpp @echo cmm -trace: $@ $(top_cmmtrace) -trace $(top_cmmtrace_header) trace_t $< $@ %.cmm.trace.cmm: %.cmm @echo cmm -trace: $@ $(top_cmmtrace) -trace $(top_cmmtrace_header) trace_t $< $@ # Fortify top_fortifydir := /home/jules/ %.c.fortify.c: %.c echo '#define FORTIFY' >$@ echo '#include "$(top_fortifydir)fortify/fortify.h"' >>$@ echo '#line 1 "$<"' >>$@ cat $< >>$@ %.cmm.fortify.cmm: %.cmm echo '#define FORTIFY' >$@ echo '#include "$(top_fortifydir)fortify/fortify.h"' >>$@ echo '#line 1 "$<"' >>$@ cat $< >>$@ %.cpp.fortify.cpp: %.cpp echo '#define FORTIFY' >$@ echo '#include "$(top_fortifydir)fortify/fortify.h"' >>$@ echo '#line 1 "$<"' >>$@ cat $< >>$@ %.cpp.fortifypatch.cpp: %.cpp cat $< >$@ # cat $< | sed\ -e 'operator for(gbl_FortifyMagic.*gbl_FortifyMagic = 0, delete *(void * ptr)/operator delete (void* ptr)/'\ >$@ dummy%.cpp.fortify.cpp: %.cmm echo '#define FORTIFY' >$@ echo '#include "$(top_fortifydir)fortify/fortify.h"' >>$@ echo '#line 1 "$<"' >>$@ echo '#define COMMON_MK_OPERATOR_NEW operator new' >> $@ echo '#define COMMON_MK_OPERATOR_DELETE operator delete' >> $@ cat $< |\ sed -e 's/operator new/COMMON_MK_OPERATOR_NEW/'\ -e 's/operator delete/COMMON_MK_OPERATOR_DELETE/'\ >>$@ %.cpp.fortify.cpp: %.cmm echo '#define FORTIFY' >$@ echo '#include "$(top_fortifydir)fortify/fortify.h"' >>$@ echo '#undef new' >>$@ echo '#undef delete' >>$@ echo '#line 1 "$<"' >>$@ echo '#define COMMON_MK_OPERATOR_NEW operator new' >> $@ echo '#define COMMON_MK_OPERATOR_DELETE operator delete' >> $@ cat $< |\ sed -e 's/operator new/COMMON_MK_OPERATOR_NEW/'\ -e 's/operator delete/COMMON_MK_OPERATOR_DELETE/'\ >>$@ .PRECIOUS:\ %.c.ii-gcc$(top_gcc_version)-release.$(top_host).c\ %.c.ii-gcc$(top_gcc_version)-release-threads-x11.$(top_host).cmm\ %.c.ii-gcc$(top_gcc_version)-debug.$(top_host).c\ %.c.ii-gcc$(top_gcc_version)-debug-threads-x11.$(top_host).c\ %.cpp.ii-gcc$(top_gcc_version)-release.$(top_host).cpp\ %.cpp.ii-gcc$(top_gcc_version)-debug.$(top_host).cpp\ %.cpp.ii-gcc$(top_gcc_version)-release-threads-x11.$(top_host).cpp\ %.cpp.ii-gcc$(top_gcc_version)-debug-x11.$(top_host).cpp\ %.cpp.ii-gcc$(top_gcc_version)-debug-threads-x11.$(top_host).cpp\ %.cpp.ii-gcc$(top_gcc_version)-stlport-debug2-threads-x11.$(top_host).cpp\ %.cmm.ii-gcc$(top_gcc_version)-release.$(top_host).cmm\ %.cmm.ii-gcc$(top_gcc_version)-debug.$(top_host).cmm\ %.cmm.ii-gcc$(top_gcc_version)-release-threads-x11.$(top_host).cmm\ %.cmm.ii-gcc$(top_gcc_version)-debug-threads-x11.$(top_host).cmm\ %.cmm.ii-gcc$(top_gcc_version)-stlport-debug2-threads-x11.$(top_host).cmm\ %.c.gcc$(top_gcc_version)-debug-threads-x11.$(top_host).o\ %.c.gcc$(top_gcc_version)-debug.$(top_host).o\ %.c.gcc$(top_gcc_version)-release-threads-x11.$(top_host).o\ %.cpp.gcc$(top_gcc_version)-debug-threads-x11.$(top_host).o\ %.cpp.gcc$(top_gcc_version)-release-threads-x11.$(top_host).o\ %.cpp.gcc$(top_gcc_version)-debug.$(top_host).o\ %.cpp.gcc$(top_gcc_version)-debug-shared.$(top_host).o\ %.cpp.gcc$(top_gcc_version)-release-shared.$(top_host).o\ %.cpp.gcc$(top_gcc_version)-debug-threads-x11.$(top_host).o\ %.cmm.cmm-s.cpp\ %.cmm.cmm-ss.cpp\ %.cpp.trace.cpp\ %.cmm.trace.cmm\ %.c.fortify.c\ %.cpp.fortify.cpp\ %.cmm.fortify.cmm\ %.cpp.fortifypatch.cpp\ ################################################################ # Executables. ################################################################ # Only $(call top_exe, ...) and $(call top_exe_include, ...) are for general use. # These executable rules work by transforming source filenames # (.c, .cpp, .cmm) into .o filenames. Make will then run whatever # rules are necessary to make these .o filenames. # top_src2obj__ # $1=source files # Evaluates to an .o file. Each build/suffix combination has its own # top_src2objs__ variable. # top_src2obj_gcc$(top_gcc_version)-release.$(top_host)_.c = $1.gcc$(top_gcc_version)-release.$(top_host).o top_src2obj_gcc$(top_gcc_version)-release.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-release.$(top_host).o top_src2obj_gcc$(top_gcc_version)-release.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-release.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-release.$(top_host).o top_src2d_gcc$(top_gcc_version)-release.$(top_host)_.c = $1.gcc$(top_gcc_version)-release.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-release.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-release.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-release.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-release.$(top_host).cmm.d $1.ii-gcc$(top_gcc_version)-release.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-release.$(top_host).o.d top_src2obj_gcc$(top_gcc_version)-releaseO3.$(top_host)_.c = $1.gcc$(top_gcc_version)-releaseO3.$(top_host).o top_src2obj_gcc$(top_gcc_version)-releaseO3.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-releaseO3.$(top_host).o top_src2obj_gcc$(top_gcc_version)-releaseO3.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-releaseO3.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-releaseO3.$(top_host).o top_src2d_gcc$(top_gcc_version)-releaseO3.$(top_host)_.c = $1.gcc$(top_gcc_version)-releaseO3.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-releaseO3.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-releaseO3.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-releaseO3.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-releaseO3.$(top_host).cmm.d $1.ii-gcc$(top_gcc_version)-releaseO3.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-releaseO3.$(top_host).o.d top_src2obj_gcc$(top_gcc_version)-release-pg.$(top_host)_.c = $1.gcc$(top_gcc_version)-release-pg.$(top_host).o top_src2obj_gcc$(top_gcc_version)-release-pg.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-release-pg.$(top_host).o top_src2obj_gcc$(top_gcc_version)-release-pg.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-release-pg.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-release-pg.$(top_host).o top_src2d_gcc$(top_gcc_version)-release-pg.$(top_host)_.c = $1.gcc$(top_gcc_version)-release-pg.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-release-pg.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-release-pg.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-release-pg.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-release-pg.$(top_host).cmm.d $1.ii-gcc$(top_gcc_version)-release-pg.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-release-pg.$(top_host).o.d top_src2obj_gcc$(top_gcc_version)-release-threads.$(top_host)_.c = $1.gcc$(top_gcc_version)-release-threads.$(top_host).o top_src2obj_gcc$(top_gcc_version)-release-threads.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-release-threads.$(top_host).o top_src2obj_gcc$(top_gcc_version)-release-threads.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-release-threads.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-release-threads.$(top_host).o top_src2d_gcc$(top_gcc_version)-release-threads.$(top_host)_.c = $1.gcc$(top_gcc_version)-release-threads.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-release-threads.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-release-threads.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-release-threads.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-release-threads.$(top_host).cmm.d $1.ii-gcc$(top_gcc_version)-release-threads.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-release-threads.$(top_host).o.d top_src2obj_gcc$(top_gcc_version)-release-x11.$(top_host)_.c = $1.gcc$(top_gcc_version)-release-x11.$(top_host).o top_src2obj_gcc$(top_gcc_version)-release-x11.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-release-x11.$(top_host).o top_src2obj_gcc$(top_gcc_version)-release-x11.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-release-x11.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-release-x11.$(top_host).o top_src2d_gcc$(top_gcc_version)-release-x11.$(top_host)_.c = $1.gcc$(top_gcc_version)-release-x11.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-release-x11.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-release-x11.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-release-x11.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-release-x11.$(top_host).cmm $1.ii-gcc$(top_gcc_version)-release-x11.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-release-x11.$(top_host).o.d top_src2obj_gcc$(top_gcc_version)-release-threads-x11.$(top_host)_.c = $1.gcc$(top_gcc_version)-release-threads-x11.$(top_host).o top_src2obj_gcc$(top_gcc_version)-release-threads-x11.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-release-threads-x11.$(top_host).o top_src2obj_gcc$(top_gcc_version)-release-threads-x11.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-release-threads-x11.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-release-threads-x11.$(top_host).o top_src2d_gcc$(top_gcc_version)-release-threads-x11.$(top_host)_.c = $1.gcc$(top_gcc_version)-release-threads-x11.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-release-threads-x11.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-release-threads-x11.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-release-threads-x11.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-release-threads-x11.$(top_host).cmm $1.ii-gcc$(top_gcc_version)-release-threads-x11.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-release-threads-x11.$(top_host).o.d top_src2obj_gcc$(top_gcc_version)-debug.$(top_host)_.c = $1.gcc$(top_gcc_version)-debug.$(top_host).o top_src2obj_gcc$(top_gcc_version)-debug.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-debug.$(top_host).o top_src2obj_gcc$(top_gcc_version)-debug.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-debug.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-debug.$(top_host).o top_src2d_gcc$(top_gcc_version)-debug.$(top_host)_.c = $1.gcc$(top_gcc_version)-debug.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-debug.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-debug.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-debug.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-debug.$(top_host).cmm.d $1.ii-gcc$(top_gcc_version)-debug.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-debug.$(top_host).o.d top_src2obj_gcc$(top_gcc_version)-debug-static.$(top_host)_.c = $1.gcc$(top_gcc_version)-debug.$(top_host).o top_src2obj_gcc$(top_gcc_version)-debug-static.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-debug.$(top_host).o top_src2obj_gcc$(top_gcc_version)-debug-static.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-debug.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-debug.$(top_host).o top_src2d_gcc$(top_gcc_version)-debug-static.$(top_host)_.c = $1.gcc$(top_gcc_version)-debug.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-debug-static.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-debug.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-debug-static.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-debug.$(top_host).cmm.d $1.ii-gcc$(top_gcc_version)-debug.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-debug.$(top_host).o.d top_src2obj_gcc$(top_gcc_version)-debug-threads.$(top_host)_.c = $1.gcc$(top_gcc_version)-debug-threads.$(top_host).o top_src2obj_gcc$(top_gcc_version)-debug-threads.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-debug-threads.$(top_host).o top_src2obj_gcc$(top_gcc_version)-debug-threads.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-debug-threads.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-debug-threads.$(top_host).o top_src2d_gcc$(top_gcc_version)-debug-threads.$(top_host)_.c = $1.gcc$(top_gcc_version)-debug-threads.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-debug-threads.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-debug-threads.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-debug-threads.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-debug-threads.$(top_host).cmm.d $1.ii-gcc$(top_gcc_version)-debug-threads.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-debug-threads.$(top_host).o.d top_src2obj_gcc$(top_gcc_version)-debug-x11.$(top_host)_.c = $1.gcc$(top_gcc_version)-debug-x11.$(top_host).o top_src2obj_gcc$(top_gcc_version)-debug-x11.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-debug-x11.$(top_host).o top_src2obj_gcc$(top_gcc_version)-debug-x11.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-debug-x11.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-debug-x11.$(top_host).o top_src2d_gcc$(top_gcc_version)-debug-x11.$(top_host)_.c = $1.gcc$(top_gcc_version)-debug-x11.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-debug-x11.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-debug-x11.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-debug-x11.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-debug-x11.$(top_host).cmm.d $1.ii-gcc$(top_gcc_version)-debug-x11.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-debug-x11.$(top_host).o.d top_src2obj_gcc$(top_gcc_version)-debug-threads-x11.$(top_host)_.c = $1.gcc$(top_gcc_version)-debug-threads-x11.$(top_host).o top_src2obj_gcc$(top_gcc_version)-debug-threads-x11.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-debug-threads-x11.$(top_host).o top_src2obj_gcc$(top_gcc_version)-debug-threads-x11.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-debug-threads-x11.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-debug-threads-x11.$(top_host).o top_src2d_gcc$(top_gcc_version)-debug-threads-x11.$(top_host)_.c = $1.gcc$(top_gcc_version)-debug-threads-x11.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-debug-threads-x11.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-debug-threads-x11.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-debug-threads-x11.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-debug-threads-x11.$(top_host).cmm.d $1.ii-gcc$(top_gcc_version)-debug-threads-x11.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-debug-threads-x11.$(top_host).o.d top_src2obj_gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host)_.c = $1.gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host).o top_src2obj_gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host).o top_src2obj_gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host).o top_src2d_gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host)_.c = $1.gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host).cmm.d $1.ii-gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host).o.d top_src2obj_gcc$(top_gcc_version)-stlport-release.$(top_host)_.c = $1.gcc$(top_gcc_version)-stlport-release.$(top_host).o top_src2obj_gcc$(top_gcc_version)-stlport-release.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-stlport-release.$(top_host).o top_src2obj_gcc$(top_gcc_version)-stlport-release.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-stlport-release.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-stlport-release.$(top_host).o top_src2d_gcc$(top_gcc_version)-stlport-release.$(top_host)_.c = $1.gcc$(top_gcc_version)-stlport-release.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-stlport-release.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-stlport-release.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-stlport-release.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-stlport-release.$(top_host).cmm.d $1.ii-gcc$(top_gcc_version)-stlport-release.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-stlport-release.$(top_host).o.d top_src2obj_gcc$(top_gcc_version)-stlport-release-threads-x11.$(top_host)_.c = $1.gcc$(top_gcc_version)-stlport-release-threads-x11.$(top_host).o top_src2obj_gcc$(top_gcc_version)-stlport-release-threads-x11.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-stlport-release-threads-x11.$(top_host).o top_src2obj_gcc$(top_gcc_version)-stlport-release-threads-x11.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-stlport-release-threads-x11.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-stlport-release-threads-x11.$(top_host).o top_src2d_gcc$(top_gcc_version)-stlport-release-threads-x11.$(top_host)_.c = $1.gcc$(top_gcc_version)-stlport-release-threads-x11.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-stlport-release-threads-x11.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-stlport-release-threads-x11.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-stlport-release-threads-x11.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-stlport-release-threads-x11.$(top_host).cmm.d $1.ii-gcc$(top_gcc_version)-stlport-release-threads-x11.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-stlport-release-threads-x11.$(top_host).o.d top_src2obj_gcc$(top_gcc_version)-stlport-debug2.$(top_host)_.c = $1.gcc$(top_gcc_version)-stlport-debug2.$(top_host).o top_src2obj_gcc$(top_gcc_version)-stlport-debug2.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-stlport-debug2.$(top_host).o top_src2obj_gcc$(top_gcc_version)-stlport-debug2.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-stlport-debug2.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-stlport-debug2.$(top_host).o top_src2d_gcc$(top_gcc_version)-stlport-debug2.$(top_host)_.c = $1.gcc$(top_gcc_version)-stlport-debug2.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-stlport-debug2.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-stlport-debug2.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-stlport-debug2.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-stlport-debug2.$(top_host).cmm.d $1.ii-gcc$(top_gcc_version)-stlport-debug2.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-stlport-debug2.$(top_host).o.d top_src2obj_gcc$(top_gcc_version)-stlport-debug2-threads-x11.$(top_host)_.c = $1.gcc$(top_gcc_version)-stlport-debug2-threads-x11.$(top_host).o top_src2obj_gcc$(top_gcc_version)-stlport-debug2-threads-x11.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-stlport-debug2-threads-x11.$(top_host).o top_src2obj_gcc$(top_gcc_version)-stlport-debug2-threads-x11.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-stlport-debug2-threads-x11.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-stlport-debug2-threads-x11.$(top_host).o top_src2d_gcc$(top_gcc_version)-stlport-debug2-threads-x11.$(top_host)_.c = $1.gcc$(top_gcc_version)-stlport-debug2-threads-x11.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-stlport-debug2-threads-x11.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-stlport-debug2-threads-x11.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-stlport-debug2-threads-x11.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-stlport-debug2-threads-x11.$(top_host).cmm.d $1.ii-gcc$(top_gcc_version)-stlport-debug2-threads-x11.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-stlport-debug2-threads-x11.$(top_host).o.d top_src2obj_gcc$(top_gcc_version)-stlport-debug2-threads-x11gtk2.$(top_host)_.c = $1.gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host).o top_src2obj_gcc$(top_gcc_version)-stlport-debug2-threads-x11gtk2.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host).o top_src2obj_gcc$(top_gcc_version)-stlport-debug2-threads-x11gtk2.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-stlport-debug2-threads-x11gtk2.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host).o top_src2d_gcc$(top_gcc_version)-stlport-debug2-threads-x11gtk2.$(top_host)_.c = $1.gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-stlport-debug2-threads-x11gtk2.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-stlport-debug2-threads-x11gtk2.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-stlport-debug2-threads-x11gtk2.$(top_host).cmm.d $1.ii-gcc$(top_gcc_version)-stlport-debug2-threads-x11gtk2.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host).o.d top_src2obj_gcc$(top_gcc_version)-debug-shared.$(top_host)_.c = $1.gcc$(top_gcc_version)-debug-shared.$(top_host).o top_src2obj_gcc$(top_gcc_version)-debug-shared.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-debug-shared.$(top_host).o top_src2obj_gcc$(top_gcc_version)-debug-shared.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-debug.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-debug-shared.$(top_host).o top_src2d_gcc$(top_gcc_version)-debug-shared.$(top_host)_.c = $1.gcc$(top_gcc_version)-debug-shared.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-debug-shared.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-debug-shared.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-debug-shared.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-debug.$(top_host).cmm.cmm-s.cpp.d $1.ii-gcc$(top_gcc_version)-debug.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-debug-shared.$(top_host).o.d top_src2obj_gcc$(top_gcc_version)-release-shared.$(top_host)_.c = $1.gcc$(top_gcc_version)-release-shared.$(top_host).o top_src2obj_gcc$(top_gcc_version)-release-shared.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-release-shared.$(top_host).o top_src2obj_gcc$(top_gcc_version)-release-shared.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-release.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-release-shared.$(top_host).o top_src2d_gcc$(top_gcc_version)-release-shared.$(top_host)_.c = $1.gcc$(top_gcc_version)-release-shared.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-release-shared.$(top_host)_.cpp = $1.gcc$(top_gcc_version)-release-shared.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-release-shared.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-release.$(top_host).cmm.d $1.ii-gcc$(top_gcc_version)-release.$(top_host).cmm.cmm-s.cpp.gcc$(top_gcc_version)-release-shared.$(top_host).o.d top_src2obj_gcc$(top_gcc_version)-release-cmmss.$(top_host)_.c = $1.gcc$(top_gcc_version)-release.$(top_host).o top_src2obj_gcc$(top_gcc_version)-release-cmmss.$(top_host)_.cpp = $1.ii-gcc$(top_gcc_version)-release.$(top_host).cpp.cmm-ss.cpp.gcc$(top_gcc_version)-release.$(top_host).o top_src2obj_gcc$(top_gcc_version)-release-cmmss.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-release.$(top_host).cmm.cmm-ss.cpp.gcc$(top_gcc_version)-release.$(top_host).o top_src2d_gcc$(top_gcc_version)-release-cmmss.$(top_host)_.c = $1.gcc$(top_gcc_version)-release.$(top_host).o.d top_src2d_gcc$(top_gcc_version)-release-cmmss.$(top_host)_.cpp = $1.ii-gcc$(top_gcc_version)-release.$(top_host)..dcpp.cmm-ss.cpp.gcc$(top_gcc_version)-release.$(top_host).o top_src2d_gcc$(top_gcc_version)-release-cmmss.$(top_host)_.cmm = $1.ii-gcc$(top_gcc_version)-release.$(top_host).cmm.d $1.ii-gcc$(top_gcc_version)-release.$(top_host).cmm.cmm-ss.cpp.gcc$(top_gcc_version)-release.$(top_host).o.d # Each build type has its own link command top_link_. # $1=output executable # $2=obj files # $3=extra flags top_link_gcc$(top_gcc_version)-release.$(top_host) = $(top_gcc$(top_gcc_version)-link.$(top_host)) $3 -o $1 $2 -O2 top_link_gcc$(top_gcc_version)-releaseO3.$(top_host) = $(top_gcc$(top_gcc_version)-link.$(top_host)) $3 -o $1 $2 -O3 top_link_gcc$(top_gcc_version)-release-pg.$(top_host) = $(top_gcc$(top_gcc_version)-link.$(top_host)) $3 -o $1 $2 -O2 -pg top_link_gcc$(top_gcc_version)-release-threads.$(top_host) = $(top_gcc$(top_gcc_version)-link.$(top_host)) $3 -o $1 $2 -O2 $(top_gcc_threads) top_link_gcc$(top_gcc_version)-release-x11.$(top_host) = $(top_gcc$(top_gcc_version)-link.$(top_host)) $3 -o $1 $2 -O2 $(top_gcc$(top_gcc_version)-x11.link-extra.$(top_host)) top_link_gcc$(top_gcc_version)-release-threads-x11.$(top_host) = $(top_gcc$(top_gcc_version)-link.$(top_host)) $3 -o $1 $2 -O2 $(top_gcc$(top_gcc_version)-x11.link-extra.$(top_host)) $(top_gcc_threads) top_link_gcc$(top_gcc_version)-debug.$(top_host) = $(top_gcc$(top_gcc_version)-link.$(top_host)) $3 -o $1 $2 -g top_link_gcc$(top_gcc_version)-debug-static.$(top_host) = $(top_gcc$(top_gcc_version)-link.$(top_host)) $3 -o $1 $2 -g -static top_link_gcc$(top_gcc_version)-debug-threads.$(top_host) = $(top_gcc$(top_gcc_version)-link.$(top_host)) $3 -o $1 $2 -g $(top_gcc_threads) top_link_gcc$(top_gcc_version)-debug-x11.$(top_host) = $(top_gcc$(top_gcc_version)-link.$(top_host)) $3 -o $1 $2 -g $(top_gcc$(top_gcc_version)-x11.link-extra.$(top_host)) top_link_gcc$(top_gcc_version)-debug-threads-x11.$(top_host) = $(top_gcc$(top_gcc_version)-link.$(top_host)) $3 -o $1 $2 -g $(top_gcc$(top_gcc_version)-x11.link-extra.$(top_host)) $(top_gcc_threads) top_link_gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host) = $(top_gcc$(top_gcc_version)-link.$(top_host)) $3 -o $1 $2 -g $(top_gcc$(top_gcc_version)-x11gtk2.link-extra.$(top_host)) $(top_gcc_threads) top_link_gcc$(top_gcc_version)-release-cmmss.$(top_host) = $(top_gcc$(top_gcc_version)-link.$(top_host)) $3 -o $1 $2 -O2 top_link_gcc$(top_gcc_version)-stlport-release.$(top_host) = $(top_gcc$(top_gcc_version)-link.$(top_host)) $3 -o $1 $2 -O2 top_link_gcc$(top_gcc_version)-stlport-release-threads-x11.$(top_host) = $(top_gcc$(top_gcc_version)-link.$(top_host)) $3 -o $1 $2 -O2 $(top_gcc$(top_gcc_version)-x11.link-extra.$(top_host)) $(top_gcc_threads) top_link_gcc$(top_gcc_version)-stlport-debug2.$(top_host) = $(top_gcc$(top_gcc_version)-link.$(top_host)) $3 -o $1 $2 -g top_link_gcc$(top_gcc_version)-stlport-debug2-threads-x11.$(top_host) = $(top_gcc$(top_gcc_version)-link.$(top_host)) $3 -o $1 $2 -g $(top_gcc$(top_gcc_version)-x11.link-extra.$(top_host)) $(top_gcc_threads) top_link_gcc$(top_gcc_version)-stlport-debug2-threads-x11gtk2.$(top_host) = $(top_gcc$(top_gcc_version)-link.$(top_host)) $3 -o $1 $2 -g $(top_gcc$(top_gcc_version)-x11gtk2.link-extra.$(top_host)) $(top_gcc_threads) top_link_gcc$(top_gcc_version)-release-shared.$(top_host) = $(top_gcc$(top_gcc_version)-link.$(top_host)) $3 -o $1 $2 -O2 -shared -fpic top_link_gcc$(top_gcc_version)-debug-shared.$(top_host) = $(top_gcc$(top_gcc_version)-link.$(top_host)) $3 -o $1 $2 -g -shared -fpic top_link_msvc-release.$(top_host) = cl $3 /Fdmsvc.pdb /FD /Fm$$@.map /Fo$@ /GR /Ox /W3 /Fe$1 $(call top_cygwin2win32,$2) top_linklib = ar -r $1 $2 && ranlib $1 top_linklib_gcc$(top_gcc_version)-release.$(top_host) = $(call top_linklib, $1, $2) top_linklib_gcc$(top_gcc_version)-release-threads.$(top_host) = $(call top_linklib, $1, $2) top_linklib_gcc$(top_gcc_version)-release-x11.$(top_host) = $(call top_linklib, $1, $2) top_linklib_gcc$(top_gcc_version)-release-threads-x11.$(top_host) = $(call top_linklib, $1, $2) top_linklib_gcc$(top_gcc_version)-debug.$(top_host) = $(call top_linklib, $1, $2) top_linklib_gcc$(top_gcc_version)-debug-threads.$(top_host) = $(call top_linklib, $1, $2) top_linklib_gcc$(top_gcc_version)-debug-x11.$(top_host) = $(call top_linklib, $1, $2) top_linklib_gcc$(top_gcc_version)-debug-threads-x11.$(top_host) = $(call top_linklib, $1, $2) top_linklib_gcc$(top_gcc_version)-debug-threads-x11gtk2.$(top_host) = $(call top_linklib, $1, $2) top_linklib_gcc$(top_gcc_version)-release-cmmss.$(top_host) = $(call top_linklib, $1, $2) top_linklib_gcc$(top_gcc_version)-stlport-release.$(top_host) = $(call top_linklib, $1, $2) top_linklib_gcc$(top_gcc_version)-stlport-release-threads-x11.$(top_host) = $(call top_linklib, $1, $2) top_linklib_gcc$(top_gcc_version)-stlport-debug2.$(top_host) = $(call top_linklib, $1, $2) top_linklib_gcc$(top_gcc_version)-stlport-debug2-threads-x11.$(top_host) = $(call top_linklib, $1, $2) top_linklib_gcc$(top_gcc_version)-stlport-debug2-threads-x11gtk2.$(top_host) = $(call top_linklib, $1, $2) top_linklib_gcc$(top_gcc_version)-release-shared.$(top_host) = $(call top_linklib, $1, $2) top_linklib_gcc$(top_gcc_version)-debug-shared.$(top_host) = $(call top_linklib, $1, $2) #top_linklib_msvc-release.$(top_host) = cl $3 /Fdmsvc.pdb /FD /Fm$$@.map /Fo$@ /GR /Ox /W3 /Fe$1 $(call top_cygwin2win32,$2) top_srcs2objs =\ $(if $(top_debug),$(warning top_srcs2objs: $1))\ $(foreach x,\ $1 $(top_src_extra_$(top_build2)),\ $(if $(top_debug),$(warning top_srcs2objs $x -> $(call top_src2obj_$(top_build2)_$(suffix $x),$x)))\ $(call top_src2obj_$(top_build2)_$(suffix $x),$x))\ $(top_obj_extra_$(top_build2)) # $1=files # Converts each source filename to an object filename for build top_buils2. top_srcs2ds =\ $(foreach x,$1 $(top_src_extra_$(top_build2)),\ $(call top_src2d_$(top_build2)_$(suffix $x),$x))\ $(top_d_extra_$(top_build2)) # $1=files # Evaluates to dependency files corresponding to specified source files # for top_build2. define top_lib $(strip $1).$(top_build2).lib: $(filter-out $(strip $1).$(top_build2).lib,$(call top_srcs2objs,$2,$(top_build2)) $3); @echo "Linking: $(strip $1).$(top_build2).lib" $(call top_linklib_$(top_build2),$(strip $1).$(top_build2).lib,$(call top_srcs2objs,$2,$(top_build2)) $3,$4) endef # things for building with stlport top_exe_stlport-source := $(shell ls $(top_stlport_dir)/src/*.cpp 2>/dev/null| grep -v ".*\.cpp.*\.cpp") top_exe_stlport-source-nothreads := $(filter-out %/_pthread_alloc.c,$(top_exe_stlport-source)) top_stlport_lib := $(top_stlport_dir)/src/stlport.$(top_build2).lib $(call top_lib,$(top_stlport_dir)/src/stlport,$(top_exe_stlport-source)) top_exe_libs.$(top_build2) := top_exe_libs.gcc$(top_gcc_version)-stlport-release.$(top_host) := $(top_stlport_lib) top_exe_libs.gcc$(top_gcc_version)-stlport-debug2.$(top_host) := $(top_stlport_lib) top_exe_libs.gcc$(top_gcc_version)-stlport-release-threads-x11.$(top_host) := $(top_stlport_lib) top_exe_libs.gcc$(top_gcc_version)-stlport-debug2-threads-x11.$(top_host) := $(top_stlport_lib) top_exe_libs.gcc$(top_gcc_version)-stlport-debug2-threads-x11gtk2.$(top_host) := $(top_stlport_lib) # the main rule for building executables. define top_exe $(strip $1).$(top_build2).exe: $(call top_srcs2objs,$2) $3 $(top_exe_libs.$(top_build2)); @echo "Linking: $(strip $1).$(top_build2).exe" $(call top_link_$(top_build2),$(strip $1).$(top_build2).exe,$(call top_srcs2objs,$2) $3 $(top_exe_libs.$(top_build2)),$4) endef # Usage: # $1=executable name # $2=source files # $3=libraries # $4=extra linker flags # This defines a rule for building executables using the # current build type $(top_build2). The rule knows about .c, # .cpp and.cmm files, and will ensure that these files are # processed correctly for the build $(top_build2). define top_exe.$(top_build)-shared.$(top_host) $(strip $1).$(top_build).$(top_host).exe: $(call top_srcs2objs,$2,$(top_build)-shared.$(top_host)) $3; @echo "Linking: $(strip $1).$(top_build2).exe" $(call top_link_$(top_build)-shared.$(top_host),$(strip $1).$(top_build2).exe,$(call top_srcs2objs,$2,$(top_build)-shared.$(top_host)) $3, $4) endef # Usage: # $1=executable name # $2=source files # $3=libraries # $4=extra linker flags # This defines a rule for building unix shared libraries using the # current build type $(top_build2). The rule knows about .c, # .cpp and.cmm files, and will ensure that these files are # processed correctly for the build $(top_build2). top_exe_include = $(call top_srcs2ds,$1) # $1=source files. top_gcc$(top_gcc_version)-link.$(top_host) := $(top_g++) $(top_linkextra) top_gcc$(top_gcc_version)-link.Linux-i686 := $(top_g++) $(top_linkextra) -ldl ################################################################ # Sanity checks ################################################################ top_all_builds :=\ gcc$(top_gcc_version)-release\ gcc$(top_gcc_version)-release-threads\ gcc$(top_gcc_version)-release-x11\ gcc$(top_gcc_version)-release-threads-x11\ gcc$(top_gcc_version)-debug\ gcc$(top_gcc_version)-debug-threads\ gcc$(top_gcc_version)-debug-x11\ gcc$(top_gcc_version)-debug-threads-x11\ gcc$(top_gcc_version)-debug-threads-x11gtk2\ gcc$(top_gcc_version)-release-cmmss\ gcc$(top_gcc_version)-stlport-release\ gcc$(top_gcc_version)-stlport-release-threads-x11\ gcc$(top_gcc_version)-stlport-debug2\ gcc$(top_gcc_version)-stlport-debug2-threads-x11\ gcc$(top_gcc_version)-stlport-debug2-threads-x11gtk2\ msvc-release\ ifeq ($(call top_srcs2objs,foo.cpp),) $(warning Unrecognised build type $(top_build2). Default builds are: $(top_all_builds)) endif ifneq ($(filter OpenBSD%,$(top_host)),) ifneq ($(findstring threads,$(top_build2)),) ifeq ($(top_gcc_version),2.95.3) #$(warning *** Warning: OpenBSD builds with threads and exceptions may not work) # needto change this to warn when using gcc 2.95.x endif endif endif ################################################################ # Miscelleneous rules ################################################################ .PHONY: top_show-% top_showreverse-% top_show2-% top_always top_show-%: @echo $$\($*\) = $($*) top_showreverse-%: @echo $($*) = $$\($*\) top_show2-%: @echo $$\($*\) = $(foreach x,$($*),echo $x;) # top_show-% # top_showreverse-% # top_show2-% # These targets simply print out the specified makefile # variable. For example, make top_show-top_build will print # something like: # $$(top_build)=gcc$(top_gcc_version)-debug # top_always: %: %.$(top_build2).exe : %.ii: %.ii-$(top_build2).cpp; %.cpp.o: %.cpp.$(top_build2).o; #.PHONEY: compile-% preprocess-%.cpp compile-%.cpp: echo $@ preprocess-%.cpp: %.cpp.ii-$(top_build2).cpp : endif # ifndef top_