From d5d809e6a3ccc2219b6411e3c2560224858dc206 Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Fri, 27 May 2016 14:32:49 +0200 Subject: [PATCH] simplify and organise makefiles --- aarbology2/makefile | 41 +++---- acast2/makefile | 41 +++---- acompaction2/makefile | 41 +++---- acompare2/makefile | 41 +++---- aconversions2/makefile | 41 +++---- aconvert2/makefile | 41 +++---- aderivation2/makefile | 41 +++---- adeterminize2/makefile | 41 +++---- aecho2/makefile | 41 +++---- aepsilon2/makefile | 41 +++---- agenerate2/makefile | 41 +++---- aintegral2/makefile | 41 +++---- alangop2/makefile | 41 +++---- alib2algo/makefile | 134 +++++--------------- alib2common/makefile | 134 +++++--------------- alib2data/makefile | 134 +++++--------------- alib2elgo/makefile | 134 +++++--------------- alib2measurepp/makefile | 134 +++++--------------- alib2raw/makefile | 134 +++++--------------- alib2std/makefile | 134 +++++--------------- alib2str/makefile | 134 +++++--------------- alphabetManip2/makefile | 41 +++---- ameasure2/makefile | 39 +++--- ameasurep2/makefile | 39 +++--- aminimize2/makefile | 41 +++---- anormalize2/makefile | 41 +++---- arand2/makefile | 41 +++---- araw2/makefile | 41 +++---- arename2/makefile | 41 +++---- areverse2/makefile | 41 +++---- arun2/makefile | 41 +++---- astat2/makefile | 41 +++---- astringology2/makefile | 41 +++---- atrim2/makefile | 41 +++---- makefile | 264 +++++----------------------------------- tniceprint/makefile | 41 +++---- 36 files changed, 775 insertions(+), 1664 deletions(-) diff --git a/aarbology2/makefile b/aarbology2/makefile index 3d4b105138..dd28431218 100644 --- a/aarbology2/makefile +++ b/aarbology2/makefile @@ -22,7 +22,12 @@ OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(shell find src/ -name all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf +FORCE: + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -79,14 +84,8 @@ obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: build-debug - -release: build-release - -clean: clean-debug clean-release - $(RM) -r doc - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction bin-debug/$(EXECUTABLE): obj-debug/ $(OBJECTS_DEBUG) if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -110,26 +109,31 @@ bin-release/$(EXECUTABLE): obj-release/ $(OBJECTS_RELEASE) fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls - -obj-debug/: FORCE | obj-debug/makefile +obj-debug/: FORCE | obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" obj-release/: FORCE | obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies $(OBJECTS_DEBUG): obj-debug/ $(OBJECTS_RELEASE): obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets -build-debug: bin-debug/$(EXECUTABLE) - -build-release: bin-release/$(EXECUTABLE) +debug: bin-debug/$(EXECUTABLE) +release: bin-release/$(EXECUTABLE) +clean: clean-debug clean-release + $(RM) -r doc clean-debug: if [ -L obj-debug ]; then\ @@ -149,12 +153,5 @@ clean-release: fi $(RM) -r *.o *.d bin-release obj-release - - -FORCE: - - - doc: doxygen - diff --git a/acast2/makefile b/acast2/makefile index 3d4b105138..dd28431218 100644 --- a/acast2/makefile +++ b/acast2/makefile @@ -22,7 +22,12 @@ OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(shell find src/ -name all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf +FORCE: + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -79,14 +84,8 @@ obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: build-debug - -release: build-release - -clean: clean-debug clean-release - $(RM) -r doc - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction bin-debug/$(EXECUTABLE): obj-debug/ $(OBJECTS_DEBUG) if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -110,26 +109,31 @@ bin-release/$(EXECUTABLE): obj-release/ $(OBJECTS_RELEASE) fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls - -obj-debug/: FORCE | obj-debug/makefile +obj-debug/: FORCE | obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" obj-release/: FORCE | obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies $(OBJECTS_DEBUG): obj-debug/ $(OBJECTS_RELEASE): obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets -build-debug: bin-debug/$(EXECUTABLE) - -build-release: bin-release/$(EXECUTABLE) +debug: bin-debug/$(EXECUTABLE) +release: bin-release/$(EXECUTABLE) +clean: clean-debug clean-release + $(RM) -r doc clean-debug: if [ -L obj-debug ]; then\ @@ -149,12 +153,5 @@ clean-release: fi $(RM) -r *.o *.d bin-release obj-release - - -FORCE: - - - doc: doxygen - diff --git a/acompaction2/makefile b/acompaction2/makefile index 3d4b105138..dd28431218 100644 --- a/acompaction2/makefile +++ b/acompaction2/makefile @@ -22,7 +22,12 @@ OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(shell find src/ -name all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf +FORCE: + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -79,14 +84,8 @@ obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: build-debug - -release: build-release - -clean: clean-debug clean-release - $(RM) -r doc - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction bin-debug/$(EXECUTABLE): obj-debug/ $(OBJECTS_DEBUG) if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -110,26 +109,31 @@ bin-release/$(EXECUTABLE): obj-release/ $(OBJECTS_RELEASE) fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls - -obj-debug/: FORCE | obj-debug/makefile +obj-debug/: FORCE | obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" obj-release/: FORCE | obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies $(OBJECTS_DEBUG): obj-debug/ $(OBJECTS_RELEASE): obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets -build-debug: bin-debug/$(EXECUTABLE) - -build-release: bin-release/$(EXECUTABLE) +debug: bin-debug/$(EXECUTABLE) +release: bin-release/$(EXECUTABLE) +clean: clean-debug clean-release + $(RM) -r doc clean-debug: if [ -L obj-debug ]; then\ @@ -149,12 +153,5 @@ clean-release: fi $(RM) -r *.o *.d bin-release obj-release - - -FORCE: - - - doc: doxygen - diff --git a/acompare2/makefile b/acompare2/makefile index 3d4b105138..dd28431218 100644 --- a/acompare2/makefile +++ b/acompare2/makefile @@ -22,7 +22,12 @@ OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(shell find src/ -name all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf +FORCE: + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -79,14 +84,8 @@ obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: build-debug - -release: build-release - -clean: clean-debug clean-release - $(RM) -r doc - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction bin-debug/$(EXECUTABLE): obj-debug/ $(OBJECTS_DEBUG) if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -110,26 +109,31 @@ bin-release/$(EXECUTABLE): obj-release/ $(OBJECTS_RELEASE) fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls - -obj-debug/: FORCE | obj-debug/makefile +obj-debug/: FORCE | obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" obj-release/: FORCE | obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies $(OBJECTS_DEBUG): obj-debug/ $(OBJECTS_RELEASE): obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets -build-debug: bin-debug/$(EXECUTABLE) - -build-release: bin-release/$(EXECUTABLE) +debug: bin-debug/$(EXECUTABLE) +release: bin-release/$(EXECUTABLE) +clean: clean-debug clean-release + $(RM) -r doc clean-debug: if [ -L obj-debug ]; then\ @@ -149,12 +153,5 @@ clean-release: fi $(RM) -r *.o *.d bin-release obj-release - - -FORCE: - - - doc: doxygen - diff --git a/aconversions2/makefile b/aconversions2/makefile index 3d4b105138..dd28431218 100644 --- a/aconversions2/makefile +++ b/aconversions2/makefile @@ -22,7 +22,12 @@ OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(shell find src/ -name all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf +FORCE: + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -79,14 +84,8 @@ obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: build-debug - -release: build-release - -clean: clean-debug clean-release - $(RM) -r doc - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction bin-debug/$(EXECUTABLE): obj-debug/ $(OBJECTS_DEBUG) if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -110,26 +109,31 @@ bin-release/$(EXECUTABLE): obj-release/ $(OBJECTS_RELEASE) fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls - -obj-debug/: FORCE | obj-debug/makefile +obj-debug/: FORCE | obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" obj-release/: FORCE | obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies $(OBJECTS_DEBUG): obj-debug/ $(OBJECTS_RELEASE): obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets -build-debug: bin-debug/$(EXECUTABLE) - -build-release: bin-release/$(EXECUTABLE) +debug: bin-debug/$(EXECUTABLE) +release: bin-release/$(EXECUTABLE) +clean: clean-debug clean-release + $(RM) -r doc clean-debug: if [ -L obj-debug ]; then\ @@ -149,12 +153,5 @@ clean-release: fi $(RM) -r *.o *.d bin-release obj-release - - -FORCE: - - - doc: doxygen - diff --git a/aconvert2/makefile b/aconvert2/makefile index 3d4b105138..dd28431218 100644 --- a/aconvert2/makefile +++ b/aconvert2/makefile @@ -22,7 +22,12 @@ OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(shell find src/ -name all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf +FORCE: + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -79,14 +84,8 @@ obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: build-debug - -release: build-release - -clean: clean-debug clean-release - $(RM) -r doc - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction bin-debug/$(EXECUTABLE): obj-debug/ $(OBJECTS_DEBUG) if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -110,26 +109,31 @@ bin-release/$(EXECUTABLE): obj-release/ $(OBJECTS_RELEASE) fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls - -obj-debug/: FORCE | obj-debug/makefile +obj-debug/: FORCE | obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" obj-release/: FORCE | obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies $(OBJECTS_DEBUG): obj-debug/ $(OBJECTS_RELEASE): obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets -build-debug: bin-debug/$(EXECUTABLE) - -build-release: bin-release/$(EXECUTABLE) +debug: bin-debug/$(EXECUTABLE) +release: bin-release/$(EXECUTABLE) +clean: clean-debug clean-release + $(RM) -r doc clean-debug: if [ -L obj-debug ]; then\ @@ -149,12 +153,5 @@ clean-release: fi $(RM) -r *.o *.d bin-release obj-release - - -FORCE: - - - doc: doxygen - diff --git a/aderivation2/makefile b/aderivation2/makefile index 3d4b105138..dd28431218 100644 --- a/aderivation2/makefile +++ b/aderivation2/makefile @@ -22,7 +22,12 @@ OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(shell find src/ -name all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf +FORCE: + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -79,14 +84,8 @@ obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: build-debug - -release: build-release - -clean: clean-debug clean-release - $(RM) -r doc - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction bin-debug/$(EXECUTABLE): obj-debug/ $(OBJECTS_DEBUG) if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -110,26 +109,31 @@ bin-release/$(EXECUTABLE): obj-release/ $(OBJECTS_RELEASE) fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls - -obj-debug/: FORCE | obj-debug/makefile +obj-debug/: FORCE | obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" obj-release/: FORCE | obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies $(OBJECTS_DEBUG): obj-debug/ $(OBJECTS_RELEASE): obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets -build-debug: bin-debug/$(EXECUTABLE) - -build-release: bin-release/$(EXECUTABLE) +debug: bin-debug/$(EXECUTABLE) +release: bin-release/$(EXECUTABLE) +clean: clean-debug clean-release + $(RM) -r doc clean-debug: if [ -L obj-debug ]; then\ @@ -149,12 +153,5 @@ clean-release: fi $(RM) -r *.o *.d bin-release obj-release - - -FORCE: - - - doc: doxygen - diff --git a/adeterminize2/makefile b/adeterminize2/makefile index 3d4b105138..dd28431218 100644 --- a/adeterminize2/makefile +++ b/adeterminize2/makefile @@ -22,7 +22,12 @@ OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(shell find src/ -name all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf +FORCE: + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -79,14 +84,8 @@ obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: build-debug - -release: build-release - -clean: clean-debug clean-release - $(RM) -r doc - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction bin-debug/$(EXECUTABLE): obj-debug/ $(OBJECTS_DEBUG) if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -110,26 +109,31 @@ bin-release/$(EXECUTABLE): obj-release/ $(OBJECTS_RELEASE) fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls - -obj-debug/: FORCE | obj-debug/makefile +obj-debug/: FORCE | obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" obj-release/: FORCE | obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies $(OBJECTS_DEBUG): obj-debug/ $(OBJECTS_RELEASE): obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets -build-debug: bin-debug/$(EXECUTABLE) - -build-release: bin-release/$(EXECUTABLE) +debug: bin-debug/$(EXECUTABLE) +release: bin-release/$(EXECUTABLE) +clean: clean-debug clean-release + $(RM) -r doc clean-debug: if [ -L obj-debug ]; then\ @@ -149,12 +153,5 @@ clean-release: fi $(RM) -r *.o *.d bin-release obj-release - - -FORCE: - - - doc: doxygen - diff --git a/aecho2/makefile b/aecho2/makefile index 3d4b105138..dd28431218 100644 --- a/aecho2/makefile +++ b/aecho2/makefile @@ -22,7 +22,12 @@ OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(shell find src/ -name all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf +FORCE: + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -79,14 +84,8 @@ obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: build-debug - -release: build-release - -clean: clean-debug clean-release - $(RM) -r doc - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction bin-debug/$(EXECUTABLE): obj-debug/ $(OBJECTS_DEBUG) if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -110,26 +109,31 @@ bin-release/$(EXECUTABLE): obj-release/ $(OBJECTS_RELEASE) fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls - -obj-debug/: FORCE | obj-debug/makefile +obj-debug/: FORCE | obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" obj-release/: FORCE | obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies $(OBJECTS_DEBUG): obj-debug/ $(OBJECTS_RELEASE): obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets -build-debug: bin-debug/$(EXECUTABLE) - -build-release: bin-release/$(EXECUTABLE) +debug: bin-debug/$(EXECUTABLE) +release: bin-release/$(EXECUTABLE) +clean: clean-debug clean-release + $(RM) -r doc clean-debug: if [ -L obj-debug ]; then\ @@ -149,12 +153,5 @@ clean-release: fi $(RM) -r *.o *.d bin-release obj-release - - -FORCE: - - - doc: doxygen - diff --git a/aepsilon2/makefile b/aepsilon2/makefile index 3d4b105138..dd28431218 100644 --- a/aepsilon2/makefile +++ b/aepsilon2/makefile @@ -22,7 +22,12 @@ OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(shell find src/ -name all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf +FORCE: + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -79,14 +84,8 @@ obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: build-debug - -release: build-release - -clean: clean-debug clean-release - $(RM) -r doc - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction bin-debug/$(EXECUTABLE): obj-debug/ $(OBJECTS_DEBUG) if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -110,26 +109,31 @@ bin-release/$(EXECUTABLE): obj-release/ $(OBJECTS_RELEASE) fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls - -obj-debug/: FORCE | obj-debug/makefile +obj-debug/: FORCE | obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" obj-release/: FORCE | obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies $(OBJECTS_DEBUG): obj-debug/ $(OBJECTS_RELEASE): obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets -build-debug: bin-debug/$(EXECUTABLE) - -build-release: bin-release/$(EXECUTABLE) +debug: bin-debug/$(EXECUTABLE) +release: bin-release/$(EXECUTABLE) +clean: clean-debug clean-release + $(RM) -r doc clean-debug: if [ -L obj-debug ]; then\ @@ -149,12 +153,5 @@ clean-release: fi $(RM) -r *.o *.d bin-release obj-release - - -FORCE: - - - doc: doxygen - diff --git a/agenerate2/makefile b/agenerate2/makefile index 3d4b105138..dd28431218 100644 --- a/agenerate2/makefile +++ b/agenerate2/makefile @@ -22,7 +22,12 @@ OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(shell find src/ -name all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf +FORCE: + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -79,14 +84,8 @@ obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: build-debug - -release: build-release - -clean: clean-debug clean-release - $(RM) -r doc - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction bin-debug/$(EXECUTABLE): obj-debug/ $(OBJECTS_DEBUG) if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -110,26 +109,31 @@ bin-release/$(EXECUTABLE): obj-release/ $(OBJECTS_RELEASE) fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls - -obj-debug/: FORCE | obj-debug/makefile +obj-debug/: FORCE | obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" obj-release/: FORCE | obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies $(OBJECTS_DEBUG): obj-debug/ $(OBJECTS_RELEASE): obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets -build-debug: bin-debug/$(EXECUTABLE) - -build-release: bin-release/$(EXECUTABLE) +debug: bin-debug/$(EXECUTABLE) +release: bin-release/$(EXECUTABLE) +clean: clean-debug clean-release + $(RM) -r doc clean-debug: if [ -L obj-debug ]; then\ @@ -149,12 +153,5 @@ clean-release: fi $(RM) -r *.o *.d bin-release obj-release - - -FORCE: - - - doc: doxygen - diff --git a/aintegral2/makefile b/aintegral2/makefile index 3d4b105138..dd28431218 100644 --- a/aintegral2/makefile +++ b/aintegral2/makefile @@ -22,7 +22,12 @@ OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(shell find src/ -name all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf +FORCE: + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -79,14 +84,8 @@ obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: build-debug - -release: build-release - -clean: clean-debug clean-release - $(RM) -r doc - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction bin-debug/$(EXECUTABLE): obj-debug/ $(OBJECTS_DEBUG) if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -110,26 +109,31 @@ bin-release/$(EXECUTABLE): obj-release/ $(OBJECTS_RELEASE) fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls - -obj-debug/: FORCE | obj-debug/makefile +obj-debug/: FORCE | obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" obj-release/: FORCE | obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies $(OBJECTS_DEBUG): obj-debug/ $(OBJECTS_RELEASE): obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets -build-debug: bin-debug/$(EXECUTABLE) - -build-release: bin-release/$(EXECUTABLE) +debug: bin-debug/$(EXECUTABLE) +release: bin-release/$(EXECUTABLE) +clean: clean-debug clean-release + $(RM) -r doc clean-debug: if [ -L obj-debug ]; then\ @@ -149,12 +153,5 @@ clean-release: fi $(RM) -r *.o *.d bin-release obj-release - - -FORCE: - - - doc: doxygen - diff --git a/alangop2/makefile b/alangop2/makefile index 3d4b105138..dd28431218 100644 --- a/alangop2/makefile +++ b/alangop2/makefile @@ -22,7 +22,12 @@ OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(shell find src/ -name all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf +FORCE: + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -79,14 +84,8 @@ obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: build-debug - -release: build-release - -clean: clean-debug clean-release - $(RM) -r doc - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction bin-debug/$(EXECUTABLE): obj-debug/ $(OBJECTS_DEBUG) if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -110,26 +109,31 @@ bin-release/$(EXECUTABLE): obj-release/ $(OBJECTS_RELEASE) fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls - -obj-debug/: FORCE | obj-debug/makefile +obj-debug/: FORCE | obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" obj-release/: FORCE | obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies $(OBJECTS_DEBUG): obj-debug/ $(OBJECTS_RELEASE): obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets -build-debug: bin-debug/$(EXECUTABLE) - -build-release: bin-release/$(EXECUTABLE) +debug: bin-debug/$(EXECUTABLE) +release: bin-release/$(EXECUTABLE) +clean: clean-debug clean-release + $(RM) -r doc clean-debug: if [ -L obj-debug ]; then\ @@ -149,12 +153,5 @@ clean-release: fi $(RM) -r *.o *.d bin-release obj-release - - -FORCE: - - - doc: doxygen - diff --git a/alib2algo/makefile b/alib2algo/makefile index 24e112e01f..c6e48a6d76 100644 --- a/alib2algo/makefile +++ b/alib2algo/makefile @@ -24,69 +24,17 @@ TEST_OBJECTS_DEBUG:=$(patsubst test-src/%.cpp, test-obj-debug/%.o, $(shell find OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(filter-out $(wildcard src/debug/*), $(shell find src/ -name *cpp))) TEST_OBJECTS_RELEASE:=$(patsubst test-src/%.cpp, test-obj-release/%.o, $(shell find test-src/ -name *cpp)) -.PHONY: all build-debug build-tests-debug clean-debug doc +.PHONY: all debug release clean build-debug build-release clean-debug clean-release doc all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf - if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ - ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ - fi;\ - if [ -L $(subst /, , $(dir $@)) ]; then\ - mkdir -p `readlink $(subst /, , $(dir $@))`;\ - else\ - mkdir -p $(dir $@);\ - fi - echo "\ - SHELL:=/bin/bash$${NEW_LINE}\ - SRCDIR:=$${NEW_LINE}\ - $${NEW_LINE}\ - define NEW_LINE$${NEW_LINE}\ - $${NEW_LINE}\ - $${NEW_LINE}\ - endef$${NEW_LINE}\ - $${NEW_LINE}\ - export NEW_LINE$${NEW_LINE}\ - $${NEW_LINE}\ - CXXFLAGS:= -pipe -std=c++11 \$$(CXX_OTHER_FLAGS) -c -Wall -pedantic -Wextra -Werror -fPIC $(addprefix -I, $(INCLUDE_PATHS))$${NEW_LINE}\ - $${NEW_LINE}\ - SOURCES:= \$$(shell find \$$(SOURCES_BASE_DIR)/\$$(SRCDIR) -maxdepth 1 -type f -name \"*.cpp\")$${NEW_LINE}\ - DEPENDENCIES:= \$$(patsubst \$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%.cpp, \$$(OBJECTS_BASE_DIR)/\$$(SRCDIR)%.d, \$$(SOURCES))$${NEW_LINE}\ - OBJECTS:= \$$(patsubst %.d, %.o, \$$(DEPENDENCIES))$${NEW_LINE}\ - SOURCES_DIRS:= \$$(shell find \$$(SOURCES_BASE_DIR)/\$$(SRCDIR) -maxdepth 1 -mindepth 1 -type d)$${NEW_LINE}\ - OBJECTS_DIRS:= \$$(patsubst \$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%, %/, \$$(SOURCES_DIRS))$${NEW_LINE}\ - OBJECTS_DIRS_MAKEFILES:= \$$(patsubst %, %makefile, \$$(OBJECTS_DIRS))$${NEW_LINE}\ - $${NEW_LINE}\ - .PHONY: all$${NEW_LINE}\ - .PRECIOUS: \$$(DEPENDECIES) \$$(OBJECTS_DIRS_MAKEFILES)$${NEW_LINE}\ - $${NEW_LINE}\ - all: \$$(OBJECTS_DIRS) \$$(OBJECTS)$${NEW_LINE}\ - $${NEW_LINE}\ - %.d: makefile$${NEW_LINE}\ - @echo \"\\$${NEW_LINE}\ - \$$(shell sha1sum <<< \"\$$@\" | sed \"s/ -//g\") = \\$$\$$(shell (\\$$\$$(CXX) -M \\$$\$$(CXXFLAGS) \$$(patsubst \$$(OBJECTS_BASE_DIR)/\$$(SRCDIR)%.d,\$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%.cpp, \$$@) 2>/dev/null || echo \\\"\$$(patsubst \$$(OBJECTS_BASE_DIR)/\$$(SRCDIR)%.d,\$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%.cpp, \$$@) FORCE\\\") | sed \\\"s/.*://g;s/\\\\\\\\\\\\\\\\//g\\\")\$$\$${NEW_LINE}\\$${NEW_LINE}\ - \$$(patsubst %.d,%.o, \$$@): \\$$\$$(\$$(shell sha1sum <<< \"\$$@\" | sed \"s/ -//g\")) makefile\$$\$${NEW_LINE}\\$${NEW_LINE}\ - \\$$\$$(CXX) \\$$\$$(CXXFLAGS) \\$$\$$< -o \$$(patsubst %.d,%.o, \$$@)\$$\$${NEW_LINE}\\$${NEW_LINE}\ - \" > \$$@$${NEW_LINE}\ - $${NEW_LINE}\ - %/makefile: makefile$${NEW_LINE}\ - mkdir -p \$$(dir \$$@)$${NEW_LINE}\ - cp makefile \$$@$${NEW_LINE}\ - $${NEW_LINE}\ - %/: FORCE | %/makefile$${NEW_LINE}\ - @accesstime=\`stat -c %Y \$$@\` && \\$${NEW_LINE}\ - \$$(MAKE) -C \$$@ SRCDIR=\$$(SRCDIR)\$$(notdir \$$(patsubst %/, %, \$$@))/ OBJECTS_BASE_DIR=\$$(OBJECTS_BASE_DIR) SOURCES_BASE_DIR=\$$(SOURCES_BASE_DIR) CXX_OTHER_FLAGS=\"\$$(CXX_OTHER_FLAGS)\" && \\$${NEW_LINE}\ - accesstime2=\`stat -c %Y \$$@\` && \\$${NEW_LINE}\ - if [ "\$$\$$accesstime" -ne "\$$\$$accesstime2" ]; then \\$${NEW_LINE}\ - touch .; \\$${NEW_LINE}\ - fi$${NEW_LINE}\ - $${NEW_LINE}\ - FORCE:$${NEW_LINE}\ - $${NEW_LINE}\ - -include \$$(DEPENDENCIES)" > $@ +FORCE: -test-obj%/makefile: makefile makefile.conf +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -143,16 +91,8 @@ test-obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: unit-test-debug - -release: unit-test-release - -clean: clean-debug clean-release - $(RM) -r doc - -test: unit-test-debug unit-test-release - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction lib-debug/$(FULL_LIBRARY): $(OBJECTS_DEBUG) obj-debug/ if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -176,27 +116,6 @@ lib-release/$(FULL_LIBRARY): $(OBJECTS_RELEASE) obj-release/ fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) - - -obj-debug/: FORCE obj-debug/makefile - $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" - -obj-release/: FORCE obj-release/makefile - $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - - - -$(OBJECTS_DEBUG): obj-debug/ - -$(OBJECTS_RELEASE): obj-release/ - - -build-debug: lib-debug/$(FULL_LIBRARY) - -build-release: lib-release/$(FULL_LIBRARY) - - - test-bin-debug/$(TESTBIN): lib-debug/$(FULL_LIBRARY) $(TEST_OBJECTS_DEBUG) test-obj-debug/ if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ @@ -219,7 +138,14 @@ test-bin-release/$(TESTBIN): lib-release/$(FULL_LIBRARY) $(TEST_OBJECTS_RELEASE) fi $(CXX) $(TEST_OBJECTS_RELEASE) -o $@ $(TEST_LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls +obj-debug/: FORCE obj-debug/makefile + $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" + +obj-release/: FORCE obj-release/makefile + $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" test-obj-debug/: FORCE test-obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath test-obj-debug) SOURCES_BASE_DIR=$(realpath test-src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" @@ -227,27 +153,32 @@ test-obj-debug/: FORCE test-obj-debug/makefile test-obj-release/: FORCE test-obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath test-obj-release) SOURCES_BASE_DIR=$(realpath test-src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies +$(OBJECTS_DEBUG): obj-debug/ + +$(OBJECTS_RELEASE): obj-release/ $(TEST_OBJECTS_DEBUG): test-obj-debug/ $(TEST_OBJECTS_RELEASE): test-obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets - -build-tests-debug: test-bin-debug/$(TESTBIN) - -build-tests-release: test-bin-release/$(TESTBIN) - - - -unit-test-debug: build-tests-debug +debug: test-bin-debug/$(TESTBIN) LD_LIBRARY_PATH="$(subst $(space),;,$(addsuffix lib-debug;,$(LINK_PATHS)))lib-debug" test-bin-debug/$(TESTBIN) -unit-test-release: build-tests-release +release: test-bin-release/$(TESTBIN) LD_LIBRARY_PATH="$(subst $(space),;,$(addsuffix lib-release;,$(LINK_PATHS)))lib-release" test-bin-release/$(TESTBIN) +clean: clean-debug clean-release + $(RM) -r doc +build-debug: lib-debug/$(FULL_LIBRARY) + +build-release: lib-release/$(FULL_LIBRARY) clean-debug: if [ -L obj-debug ]; then\ @@ -279,12 +210,5 @@ clean-release: fi $(RM) -r *.o *.d lib-release obj-release test-bin-release test-obj-release CppUnitTestResults.xml - - -FORCE: - - - doc: doxygen - diff --git a/alib2common/makefile b/alib2common/makefile index 24e112e01f..c6e48a6d76 100644 --- a/alib2common/makefile +++ b/alib2common/makefile @@ -24,69 +24,17 @@ TEST_OBJECTS_DEBUG:=$(patsubst test-src/%.cpp, test-obj-debug/%.o, $(shell find OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(filter-out $(wildcard src/debug/*), $(shell find src/ -name *cpp))) TEST_OBJECTS_RELEASE:=$(patsubst test-src/%.cpp, test-obj-release/%.o, $(shell find test-src/ -name *cpp)) -.PHONY: all build-debug build-tests-debug clean-debug doc +.PHONY: all debug release clean build-debug build-release clean-debug clean-release doc all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf - if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ - ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ - fi;\ - if [ -L $(subst /, , $(dir $@)) ]; then\ - mkdir -p `readlink $(subst /, , $(dir $@))`;\ - else\ - mkdir -p $(dir $@);\ - fi - echo "\ - SHELL:=/bin/bash$${NEW_LINE}\ - SRCDIR:=$${NEW_LINE}\ - $${NEW_LINE}\ - define NEW_LINE$${NEW_LINE}\ - $${NEW_LINE}\ - $${NEW_LINE}\ - endef$${NEW_LINE}\ - $${NEW_LINE}\ - export NEW_LINE$${NEW_LINE}\ - $${NEW_LINE}\ - CXXFLAGS:= -pipe -std=c++11 \$$(CXX_OTHER_FLAGS) -c -Wall -pedantic -Wextra -Werror -fPIC $(addprefix -I, $(INCLUDE_PATHS))$${NEW_LINE}\ - $${NEW_LINE}\ - SOURCES:= \$$(shell find \$$(SOURCES_BASE_DIR)/\$$(SRCDIR) -maxdepth 1 -type f -name \"*.cpp\")$${NEW_LINE}\ - DEPENDENCIES:= \$$(patsubst \$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%.cpp, \$$(OBJECTS_BASE_DIR)/\$$(SRCDIR)%.d, \$$(SOURCES))$${NEW_LINE}\ - OBJECTS:= \$$(patsubst %.d, %.o, \$$(DEPENDENCIES))$${NEW_LINE}\ - SOURCES_DIRS:= \$$(shell find \$$(SOURCES_BASE_DIR)/\$$(SRCDIR) -maxdepth 1 -mindepth 1 -type d)$${NEW_LINE}\ - OBJECTS_DIRS:= \$$(patsubst \$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%, %/, \$$(SOURCES_DIRS))$${NEW_LINE}\ - OBJECTS_DIRS_MAKEFILES:= \$$(patsubst %, %makefile, \$$(OBJECTS_DIRS))$${NEW_LINE}\ - $${NEW_LINE}\ - .PHONY: all$${NEW_LINE}\ - .PRECIOUS: \$$(DEPENDECIES) \$$(OBJECTS_DIRS_MAKEFILES)$${NEW_LINE}\ - $${NEW_LINE}\ - all: \$$(OBJECTS_DIRS) \$$(OBJECTS)$${NEW_LINE}\ - $${NEW_LINE}\ - %.d: makefile$${NEW_LINE}\ - @echo \"\\$${NEW_LINE}\ - \$$(shell sha1sum <<< \"\$$@\" | sed \"s/ -//g\") = \\$$\$$(shell (\\$$\$$(CXX) -M \\$$\$$(CXXFLAGS) \$$(patsubst \$$(OBJECTS_BASE_DIR)/\$$(SRCDIR)%.d,\$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%.cpp, \$$@) 2>/dev/null || echo \\\"\$$(patsubst \$$(OBJECTS_BASE_DIR)/\$$(SRCDIR)%.d,\$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%.cpp, \$$@) FORCE\\\") | sed \\\"s/.*://g;s/\\\\\\\\\\\\\\\\//g\\\")\$$\$${NEW_LINE}\\$${NEW_LINE}\ - \$$(patsubst %.d,%.o, \$$@): \\$$\$$(\$$(shell sha1sum <<< \"\$$@\" | sed \"s/ -//g\")) makefile\$$\$${NEW_LINE}\\$${NEW_LINE}\ - \\$$\$$(CXX) \\$$\$$(CXXFLAGS) \\$$\$$< -o \$$(patsubst %.d,%.o, \$$@)\$$\$${NEW_LINE}\\$${NEW_LINE}\ - \" > \$$@$${NEW_LINE}\ - $${NEW_LINE}\ - %/makefile: makefile$${NEW_LINE}\ - mkdir -p \$$(dir \$$@)$${NEW_LINE}\ - cp makefile \$$@$${NEW_LINE}\ - $${NEW_LINE}\ - %/: FORCE | %/makefile$${NEW_LINE}\ - @accesstime=\`stat -c %Y \$$@\` && \\$${NEW_LINE}\ - \$$(MAKE) -C \$$@ SRCDIR=\$$(SRCDIR)\$$(notdir \$$(patsubst %/, %, \$$@))/ OBJECTS_BASE_DIR=\$$(OBJECTS_BASE_DIR) SOURCES_BASE_DIR=\$$(SOURCES_BASE_DIR) CXX_OTHER_FLAGS=\"\$$(CXX_OTHER_FLAGS)\" && \\$${NEW_LINE}\ - accesstime2=\`stat -c %Y \$$@\` && \\$${NEW_LINE}\ - if [ "\$$\$$accesstime" -ne "\$$\$$accesstime2" ]; then \\$${NEW_LINE}\ - touch .; \\$${NEW_LINE}\ - fi$${NEW_LINE}\ - $${NEW_LINE}\ - FORCE:$${NEW_LINE}\ - $${NEW_LINE}\ - -include \$$(DEPENDENCIES)" > $@ +FORCE: -test-obj%/makefile: makefile makefile.conf +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -143,16 +91,8 @@ test-obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: unit-test-debug - -release: unit-test-release - -clean: clean-debug clean-release - $(RM) -r doc - -test: unit-test-debug unit-test-release - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction lib-debug/$(FULL_LIBRARY): $(OBJECTS_DEBUG) obj-debug/ if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -176,27 +116,6 @@ lib-release/$(FULL_LIBRARY): $(OBJECTS_RELEASE) obj-release/ fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) - - -obj-debug/: FORCE obj-debug/makefile - $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" - -obj-release/: FORCE obj-release/makefile - $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - - - -$(OBJECTS_DEBUG): obj-debug/ - -$(OBJECTS_RELEASE): obj-release/ - - -build-debug: lib-debug/$(FULL_LIBRARY) - -build-release: lib-release/$(FULL_LIBRARY) - - - test-bin-debug/$(TESTBIN): lib-debug/$(FULL_LIBRARY) $(TEST_OBJECTS_DEBUG) test-obj-debug/ if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ @@ -219,7 +138,14 @@ test-bin-release/$(TESTBIN): lib-release/$(FULL_LIBRARY) $(TEST_OBJECTS_RELEASE) fi $(CXX) $(TEST_OBJECTS_RELEASE) -o $@ $(TEST_LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls +obj-debug/: FORCE obj-debug/makefile + $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" + +obj-release/: FORCE obj-release/makefile + $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" test-obj-debug/: FORCE test-obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath test-obj-debug) SOURCES_BASE_DIR=$(realpath test-src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" @@ -227,27 +153,32 @@ test-obj-debug/: FORCE test-obj-debug/makefile test-obj-release/: FORCE test-obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath test-obj-release) SOURCES_BASE_DIR=$(realpath test-src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies +$(OBJECTS_DEBUG): obj-debug/ + +$(OBJECTS_RELEASE): obj-release/ $(TEST_OBJECTS_DEBUG): test-obj-debug/ $(TEST_OBJECTS_RELEASE): test-obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets - -build-tests-debug: test-bin-debug/$(TESTBIN) - -build-tests-release: test-bin-release/$(TESTBIN) - - - -unit-test-debug: build-tests-debug +debug: test-bin-debug/$(TESTBIN) LD_LIBRARY_PATH="$(subst $(space),;,$(addsuffix lib-debug;,$(LINK_PATHS)))lib-debug" test-bin-debug/$(TESTBIN) -unit-test-release: build-tests-release +release: test-bin-release/$(TESTBIN) LD_LIBRARY_PATH="$(subst $(space),;,$(addsuffix lib-release;,$(LINK_PATHS)))lib-release" test-bin-release/$(TESTBIN) +clean: clean-debug clean-release + $(RM) -r doc +build-debug: lib-debug/$(FULL_LIBRARY) + +build-release: lib-release/$(FULL_LIBRARY) clean-debug: if [ -L obj-debug ]; then\ @@ -279,12 +210,5 @@ clean-release: fi $(RM) -r *.o *.d lib-release obj-release test-bin-release test-obj-release CppUnitTestResults.xml - - -FORCE: - - - doc: doxygen - diff --git a/alib2data/makefile b/alib2data/makefile index 24e112e01f..c6e48a6d76 100644 --- a/alib2data/makefile +++ b/alib2data/makefile @@ -24,69 +24,17 @@ TEST_OBJECTS_DEBUG:=$(patsubst test-src/%.cpp, test-obj-debug/%.o, $(shell find OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(filter-out $(wildcard src/debug/*), $(shell find src/ -name *cpp))) TEST_OBJECTS_RELEASE:=$(patsubst test-src/%.cpp, test-obj-release/%.o, $(shell find test-src/ -name *cpp)) -.PHONY: all build-debug build-tests-debug clean-debug doc +.PHONY: all debug release clean build-debug build-release clean-debug clean-release doc all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf - if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ - ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ - fi;\ - if [ -L $(subst /, , $(dir $@)) ]; then\ - mkdir -p `readlink $(subst /, , $(dir $@))`;\ - else\ - mkdir -p $(dir $@);\ - fi - echo "\ - SHELL:=/bin/bash$${NEW_LINE}\ - SRCDIR:=$${NEW_LINE}\ - $${NEW_LINE}\ - define NEW_LINE$${NEW_LINE}\ - $${NEW_LINE}\ - $${NEW_LINE}\ - endef$${NEW_LINE}\ - $${NEW_LINE}\ - export NEW_LINE$${NEW_LINE}\ - $${NEW_LINE}\ - CXXFLAGS:= -pipe -std=c++11 \$$(CXX_OTHER_FLAGS) -c -Wall -pedantic -Wextra -Werror -fPIC $(addprefix -I, $(INCLUDE_PATHS))$${NEW_LINE}\ - $${NEW_LINE}\ - SOURCES:= \$$(shell find \$$(SOURCES_BASE_DIR)/\$$(SRCDIR) -maxdepth 1 -type f -name \"*.cpp\")$${NEW_LINE}\ - DEPENDENCIES:= \$$(patsubst \$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%.cpp, \$$(OBJECTS_BASE_DIR)/\$$(SRCDIR)%.d, \$$(SOURCES))$${NEW_LINE}\ - OBJECTS:= \$$(patsubst %.d, %.o, \$$(DEPENDENCIES))$${NEW_LINE}\ - SOURCES_DIRS:= \$$(shell find \$$(SOURCES_BASE_DIR)/\$$(SRCDIR) -maxdepth 1 -mindepth 1 -type d)$${NEW_LINE}\ - OBJECTS_DIRS:= \$$(patsubst \$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%, %/, \$$(SOURCES_DIRS))$${NEW_LINE}\ - OBJECTS_DIRS_MAKEFILES:= \$$(patsubst %, %makefile, \$$(OBJECTS_DIRS))$${NEW_LINE}\ - $${NEW_LINE}\ - .PHONY: all$${NEW_LINE}\ - .PRECIOUS: \$$(DEPENDECIES) \$$(OBJECTS_DIRS_MAKEFILES)$${NEW_LINE}\ - $${NEW_LINE}\ - all: \$$(OBJECTS_DIRS) \$$(OBJECTS)$${NEW_LINE}\ - $${NEW_LINE}\ - %.d: makefile$${NEW_LINE}\ - @echo \"\\$${NEW_LINE}\ - \$$(shell sha1sum <<< \"\$$@\" | sed \"s/ -//g\") = \\$$\$$(shell (\\$$\$$(CXX) -M \\$$\$$(CXXFLAGS) \$$(patsubst \$$(OBJECTS_BASE_DIR)/\$$(SRCDIR)%.d,\$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%.cpp, \$$@) 2>/dev/null || echo \\\"\$$(patsubst \$$(OBJECTS_BASE_DIR)/\$$(SRCDIR)%.d,\$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%.cpp, \$$@) FORCE\\\") | sed \\\"s/.*://g;s/\\\\\\\\\\\\\\\\//g\\\")\$$\$${NEW_LINE}\\$${NEW_LINE}\ - \$$(patsubst %.d,%.o, \$$@): \\$$\$$(\$$(shell sha1sum <<< \"\$$@\" | sed \"s/ -//g\")) makefile\$$\$${NEW_LINE}\\$${NEW_LINE}\ - \\$$\$$(CXX) \\$$\$$(CXXFLAGS) \\$$\$$< -o \$$(patsubst %.d,%.o, \$$@)\$$\$${NEW_LINE}\\$${NEW_LINE}\ - \" > \$$@$${NEW_LINE}\ - $${NEW_LINE}\ - %/makefile: makefile$${NEW_LINE}\ - mkdir -p \$$(dir \$$@)$${NEW_LINE}\ - cp makefile \$$@$${NEW_LINE}\ - $${NEW_LINE}\ - %/: FORCE | %/makefile$${NEW_LINE}\ - @accesstime=\`stat -c %Y \$$@\` && \\$${NEW_LINE}\ - \$$(MAKE) -C \$$@ SRCDIR=\$$(SRCDIR)\$$(notdir \$$(patsubst %/, %, \$$@))/ OBJECTS_BASE_DIR=\$$(OBJECTS_BASE_DIR) SOURCES_BASE_DIR=\$$(SOURCES_BASE_DIR) CXX_OTHER_FLAGS=\"\$$(CXX_OTHER_FLAGS)\" && \\$${NEW_LINE}\ - accesstime2=\`stat -c %Y \$$@\` && \\$${NEW_LINE}\ - if [ "\$$\$$accesstime" -ne "\$$\$$accesstime2" ]; then \\$${NEW_LINE}\ - touch .; \\$${NEW_LINE}\ - fi$${NEW_LINE}\ - $${NEW_LINE}\ - FORCE:$${NEW_LINE}\ - $${NEW_LINE}\ - -include \$$(DEPENDENCIES)" > $@ +FORCE: -test-obj%/makefile: makefile makefile.conf +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -143,16 +91,8 @@ test-obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: unit-test-debug - -release: unit-test-release - -clean: clean-debug clean-release - $(RM) -r doc - -test: unit-test-debug unit-test-release - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction lib-debug/$(FULL_LIBRARY): $(OBJECTS_DEBUG) obj-debug/ if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -176,27 +116,6 @@ lib-release/$(FULL_LIBRARY): $(OBJECTS_RELEASE) obj-release/ fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) - - -obj-debug/: FORCE obj-debug/makefile - $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" - -obj-release/: FORCE obj-release/makefile - $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - - - -$(OBJECTS_DEBUG): obj-debug/ - -$(OBJECTS_RELEASE): obj-release/ - - -build-debug: lib-debug/$(FULL_LIBRARY) - -build-release: lib-release/$(FULL_LIBRARY) - - - test-bin-debug/$(TESTBIN): lib-debug/$(FULL_LIBRARY) $(TEST_OBJECTS_DEBUG) test-obj-debug/ if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ @@ -219,7 +138,14 @@ test-bin-release/$(TESTBIN): lib-release/$(FULL_LIBRARY) $(TEST_OBJECTS_RELEASE) fi $(CXX) $(TEST_OBJECTS_RELEASE) -o $@ $(TEST_LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls +obj-debug/: FORCE obj-debug/makefile + $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" + +obj-release/: FORCE obj-release/makefile + $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" test-obj-debug/: FORCE test-obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath test-obj-debug) SOURCES_BASE_DIR=$(realpath test-src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" @@ -227,27 +153,32 @@ test-obj-debug/: FORCE test-obj-debug/makefile test-obj-release/: FORCE test-obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath test-obj-release) SOURCES_BASE_DIR=$(realpath test-src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies +$(OBJECTS_DEBUG): obj-debug/ + +$(OBJECTS_RELEASE): obj-release/ $(TEST_OBJECTS_DEBUG): test-obj-debug/ $(TEST_OBJECTS_RELEASE): test-obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets - -build-tests-debug: test-bin-debug/$(TESTBIN) - -build-tests-release: test-bin-release/$(TESTBIN) - - - -unit-test-debug: build-tests-debug +debug: test-bin-debug/$(TESTBIN) LD_LIBRARY_PATH="$(subst $(space),;,$(addsuffix lib-debug;,$(LINK_PATHS)))lib-debug" test-bin-debug/$(TESTBIN) -unit-test-release: build-tests-release +release: test-bin-release/$(TESTBIN) LD_LIBRARY_PATH="$(subst $(space),;,$(addsuffix lib-release;,$(LINK_PATHS)))lib-release" test-bin-release/$(TESTBIN) +clean: clean-debug clean-release + $(RM) -r doc +build-debug: lib-debug/$(FULL_LIBRARY) + +build-release: lib-release/$(FULL_LIBRARY) clean-debug: if [ -L obj-debug ]; then\ @@ -279,12 +210,5 @@ clean-release: fi $(RM) -r *.o *.d lib-release obj-release test-bin-release test-obj-release CppUnitTestResults.xml - - -FORCE: - - - doc: doxygen - diff --git a/alib2elgo/makefile b/alib2elgo/makefile index 24e112e01f..c6e48a6d76 100644 --- a/alib2elgo/makefile +++ b/alib2elgo/makefile @@ -24,69 +24,17 @@ TEST_OBJECTS_DEBUG:=$(patsubst test-src/%.cpp, test-obj-debug/%.o, $(shell find OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(filter-out $(wildcard src/debug/*), $(shell find src/ -name *cpp))) TEST_OBJECTS_RELEASE:=$(patsubst test-src/%.cpp, test-obj-release/%.o, $(shell find test-src/ -name *cpp)) -.PHONY: all build-debug build-tests-debug clean-debug doc +.PHONY: all debug release clean build-debug build-release clean-debug clean-release doc all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf - if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ - ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ - fi;\ - if [ -L $(subst /, , $(dir $@)) ]; then\ - mkdir -p `readlink $(subst /, , $(dir $@))`;\ - else\ - mkdir -p $(dir $@);\ - fi - echo "\ - SHELL:=/bin/bash$${NEW_LINE}\ - SRCDIR:=$${NEW_LINE}\ - $${NEW_LINE}\ - define NEW_LINE$${NEW_LINE}\ - $${NEW_LINE}\ - $${NEW_LINE}\ - endef$${NEW_LINE}\ - $${NEW_LINE}\ - export NEW_LINE$${NEW_LINE}\ - $${NEW_LINE}\ - CXXFLAGS:= -pipe -std=c++11 \$$(CXX_OTHER_FLAGS) -c -Wall -pedantic -Wextra -Werror -fPIC $(addprefix -I, $(INCLUDE_PATHS))$${NEW_LINE}\ - $${NEW_LINE}\ - SOURCES:= \$$(shell find \$$(SOURCES_BASE_DIR)/\$$(SRCDIR) -maxdepth 1 -type f -name \"*.cpp\")$${NEW_LINE}\ - DEPENDENCIES:= \$$(patsubst \$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%.cpp, \$$(OBJECTS_BASE_DIR)/\$$(SRCDIR)%.d, \$$(SOURCES))$${NEW_LINE}\ - OBJECTS:= \$$(patsubst %.d, %.o, \$$(DEPENDENCIES))$${NEW_LINE}\ - SOURCES_DIRS:= \$$(shell find \$$(SOURCES_BASE_DIR)/\$$(SRCDIR) -maxdepth 1 -mindepth 1 -type d)$${NEW_LINE}\ - OBJECTS_DIRS:= \$$(patsubst \$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%, %/, \$$(SOURCES_DIRS))$${NEW_LINE}\ - OBJECTS_DIRS_MAKEFILES:= \$$(patsubst %, %makefile, \$$(OBJECTS_DIRS))$${NEW_LINE}\ - $${NEW_LINE}\ - .PHONY: all$${NEW_LINE}\ - .PRECIOUS: \$$(DEPENDECIES) \$$(OBJECTS_DIRS_MAKEFILES)$${NEW_LINE}\ - $${NEW_LINE}\ - all: \$$(OBJECTS_DIRS) \$$(OBJECTS)$${NEW_LINE}\ - $${NEW_LINE}\ - %.d: makefile$${NEW_LINE}\ - @echo \"\\$${NEW_LINE}\ - \$$(shell sha1sum <<< \"\$$@\" | sed \"s/ -//g\") = \\$$\$$(shell (\\$$\$$(CXX) -M \\$$\$$(CXXFLAGS) \$$(patsubst \$$(OBJECTS_BASE_DIR)/\$$(SRCDIR)%.d,\$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%.cpp, \$$@) 2>/dev/null || echo \\\"\$$(patsubst \$$(OBJECTS_BASE_DIR)/\$$(SRCDIR)%.d,\$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%.cpp, \$$@) FORCE\\\") | sed \\\"s/.*://g;s/\\\\\\\\\\\\\\\\//g\\\")\$$\$${NEW_LINE}\\$${NEW_LINE}\ - \$$(patsubst %.d,%.o, \$$@): \\$$\$$(\$$(shell sha1sum <<< \"\$$@\" | sed \"s/ -//g\")) makefile\$$\$${NEW_LINE}\\$${NEW_LINE}\ - \\$$\$$(CXX) \\$$\$$(CXXFLAGS) \\$$\$$< -o \$$(patsubst %.d,%.o, \$$@)\$$\$${NEW_LINE}\\$${NEW_LINE}\ - \" > \$$@$${NEW_LINE}\ - $${NEW_LINE}\ - %/makefile: makefile$${NEW_LINE}\ - mkdir -p \$$(dir \$$@)$${NEW_LINE}\ - cp makefile \$$@$${NEW_LINE}\ - $${NEW_LINE}\ - %/: FORCE | %/makefile$${NEW_LINE}\ - @accesstime=\`stat -c %Y \$$@\` && \\$${NEW_LINE}\ - \$$(MAKE) -C \$$@ SRCDIR=\$$(SRCDIR)\$$(notdir \$$(patsubst %/, %, \$$@))/ OBJECTS_BASE_DIR=\$$(OBJECTS_BASE_DIR) SOURCES_BASE_DIR=\$$(SOURCES_BASE_DIR) CXX_OTHER_FLAGS=\"\$$(CXX_OTHER_FLAGS)\" && \\$${NEW_LINE}\ - accesstime2=\`stat -c %Y \$$@\` && \\$${NEW_LINE}\ - if [ "\$$\$$accesstime" -ne "\$$\$$accesstime2" ]; then \\$${NEW_LINE}\ - touch .; \\$${NEW_LINE}\ - fi$${NEW_LINE}\ - $${NEW_LINE}\ - FORCE:$${NEW_LINE}\ - $${NEW_LINE}\ - -include \$$(DEPENDENCIES)" > $@ +FORCE: -test-obj%/makefile: makefile makefile.conf +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -143,16 +91,8 @@ test-obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: unit-test-debug - -release: unit-test-release - -clean: clean-debug clean-release - $(RM) -r doc - -test: unit-test-debug unit-test-release - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction lib-debug/$(FULL_LIBRARY): $(OBJECTS_DEBUG) obj-debug/ if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -176,27 +116,6 @@ lib-release/$(FULL_LIBRARY): $(OBJECTS_RELEASE) obj-release/ fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) - - -obj-debug/: FORCE obj-debug/makefile - $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" - -obj-release/: FORCE obj-release/makefile - $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - - - -$(OBJECTS_DEBUG): obj-debug/ - -$(OBJECTS_RELEASE): obj-release/ - - -build-debug: lib-debug/$(FULL_LIBRARY) - -build-release: lib-release/$(FULL_LIBRARY) - - - test-bin-debug/$(TESTBIN): lib-debug/$(FULL_LIBRARY) $(TEST_OBJECTS_DEBUG) test-obj-debug/ if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ @@ -219,7 +138,14 @@ test-bin-release/$(TESTBIN): lib-release/$(FULL_LIBRARY) $(TEST_OBJECTS_RELEASE) fi $(CXX) $(TEST_OBJECTS_RELEASE) -o $@ $(TEST_LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls +obj-debug/: FORCE obj-debug/makefile + $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" + +obj-release/: FORCE obj-release/makefile + $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" test-obj-debug/: FORCE test-obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath test-obj-debug) SOURCES_BASE_DIR=$(realpath test-src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" @@ -227,27 +153,32 @@ test-obj-debug/: FORCE test-obj-debug/makefile test-obj-release/: FORCE test-obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath test-obj-release) SOURCES_BASE_DIR=$(realpath test-src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies +$(OBJECTS_DEBUG): obj-debug/ + +$(OBJECTS_RELEASE): obj-release/ $(TEST_OBJECTS_DEBUG): test-obj-debug/ $(TEST_OBJECTS_RELEASE): test-obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets - -build-tests-debug: test-bin-debug/$(TESTBIN) - -build-tests-release: test-bin-release/$(TESTBIN) - - - -unit-test-debug: build-tests-debug +debug: test-bin-debug/$(TESTBIN) LD_LIBRARY_PATH="$(subst $(space),;,$(addsuffix lib-debug;,$(LINK_PATHS)))lib-debug" test-bin-debug/$(TESTBIN) -unit-test-release: build-tests-release +release: test-bin-release/$(TESTBIN) LD_LIBRARY_PATH="$(subst $(space),;,$(addsuffix lib-release;,$(LINK_PATHS)))lib-release" test-bin-release/$(TESTBIN) +clean: clean-debug clean-release + $(RM) -r doc +build-debug: lib-debug/$(FULL_LIBRARY) + +build-release: lib-release/$(FULL_LIBRARY) clean-debug: if [ -L obj-debug ]; then\ @@ -279,12 +210,5 @@ clean-release: fi $(RM) -r *.o *.d lib-release obj-release test-bin-release test-obj-release CppUnitTestResults.xml - - -FORCE: - - - doc: doxygen - diff --git a/alib2measurepp/makefile b/alib2measurepp/makefile index 24e112e01f..c6e48a6d76 100644 --- a/alib2measurepp/makefile +++ b/alib2measurepp/makefile @@ -24,69 +24,17 @@ TEST_OBJECTS_DEBUG:=$(patsubst test-src/%.cpp, test-obj-debug/%.o, $(shell find OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(filter-out $(wildcard src/debug/*), $(shell find src/ -name *cpp))) TEST_OBJECTS_RELEASE:=$(patsubst test-src/%.cpp, test-obj-release/%.o, $(shell find test-src/ -name *cpp)) -.PHONY: all build-debug build-tests-debug clean-debug doc +.PHONY: all debug release clean build-debug build-release clean-debug clean-release doc all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf - if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ - ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ - fi;\ - if [ -L $(subst /, , $(dir $@)) ]; then\ - mkdir -p `readlink $(subst /, , $(dir $@))`;\ - else\ - mkdir -p $(dir $@);\ - fi - echo "\ - SHELL:=/bin/bash$${NEW_LINE}\ - SRCDIR:=$${NEW_LINE}\ - $${NEW_LINE}\ - define NEW_LINE$${NEW_LINE}\ - $${NEW_LINE}\ - $${NEW_LINE}\ - endef$${NEW_LINE}\ - $${NEW_LINE}\ - export NEW_LINE$${NEW_LINE}\ - $${NEW_LINE}\ - CXXFLAGS:= -pipe -std=c++11 \$$(CXX_OTHER_FLAGS) -c -Wall -pedantic -Wextra -Werror -fPIC $(addprefix -I, $(INCLUDE_PATHS))$${NEW_LINE}\ - $${NEW_LINE}\ - SOURCES:= \$$(shell find \$$(SOURCES_BASE_DIR)/\$$(SRCDIR) -maxdepth 1 -type f -name \"*.cpp\")$${NEW_LINE}\ - DEPENDENCIES:= \$$(patsubst \$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%.cpp, \$$(OBJECTS_BASE_DIR)/\$$(SRCDIR)%.d, \$$(SOURCES))$${NEW_LINE}\ - OBJECTS:= \$$(patsubst %.d, %.o, \$$(DEPENDENCIES))$${NEW_LINE}\ - SOURCES_DIRS:= \$$(shell find \$$(SOURCES_BASE_DIR)/\$$(SRCDIR) -maxdepth 1 -mindepth 1 -type d)$${NEW_LINE}\ - OBJECTS_DIRS:= \$$(patsubst \$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%, %/, \$$(SOURCES_DIRS))$${NEW_LINE}\ - OBJECTS_DIRS_MAKEFILES:= \$$(patsubst %, %makefile, \$$(OBJECTS_DIRS))$${NEW_LINE}\ - $${NEW_LINE}\ - .PHONY: all$${NEW_LINE}\ - .PRECIOUS: \$$(DEPENDECIES) \$$(OBJECTS_DIRS_MAKEFILES)$${NEW_LINE}\ - $${NEW_LINE}\ - all: \$$(OBJECTS_DIRS) \$$(OBJECTS)$${NEW_LINE}\ - $${NEW_LINE}\ - %.d: makefile$${NEW_LINE}\ - @echo \"\\$${NEW_LINE}\ - \$$(shell sha1sum <<< \"\$$@\" | sed \"s/ -//g\") = \\$$\$$(shell (\\$$\$$(CXX) -M \\$$\$$(CXXFLAGS) \$$(patsubst \$$(OBJECTS_BASE_DIR)/\$$(SRCDIR)%.d,\$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%.cpp, \$$@) 2>/dev/null || echo \\\"\$$(patsubst \$$(OBJECTS_BASE_DIR)/\$$(SRCDIR)%.d,\$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%.cpp, \$$@) FORCE\\\") | sed \\\"s/.*://g;s/\\\\\\\\\\\\\\\\//g\\\")\$$\$${NEW_LINE}\\$${NEW_LINE}\ - \$$(patsubst %.d,%.o, \$$@): \\$$\$$(\$$(shell sha1sum <<< \"\$$@\" | sed \"s/ -//g\")) makefile\$$\$${NEW_LINE}\\$${NEW_LINE}\ - \\$$\$$(CXX) \\$$\$$(CXXFLAGS) \\$$\$$< -o \$$(patsubst %.d,%.o, \$$@)\$$\$${NEW_LINE}\\$${NEW_LINE}\ - \" > \$$@$${NEW_LINE}\ - $${NEW_LINE}\ - %/makefile: makefile$${NEW_LINE}\ - mkdir -p \$$(dir \$$@)$${NEW_LINE}\ - cp makefile \$$@$${NEW_LINE}\ - $${NEW_LINE}\ - %/: FORCE | %/makefile$${NEW_LINE}\ - @accesstime=\`stat -c %Y \$$@\` && \\$${NEW_LINE}\ - \$$(MAKE) -C \$$@ SRCDIR=\$$(SRCDIR)\$$(notdir \$$(patsubst %/, %, \$$@))/ OBJECTS_BASE_DIR=\$$(OBJECTS_BASE_DIR) SOURCES_BASE_DIR=\$$(SOURCES_BASE_DIR) CXX_OTHER_FLAGS=\"\$$(CXX_OTHER_FLAGS)\" && \\$${NEW_LINE}\ - accesstime2=\`stat -c %Y \$$@\` && \\$${NEW_LINE}\ - if [ "\$$\$$accesstime" -ne "\$$\$$accesstime2" ]; then \\$${NEW_LINE}\ - touch .; \\$${NEW_LINE}\ - fi$${NEW_LINE}\ - $${NEW_LINE}\ - FORCE:$${NEW_LINE}\ - $${NEW_LINE}\ - -include \$$(DEPENDENCIES)" > $@ +FORCE: -test-obj%/makefile: makefile makefile.conf +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -143,16 +91,8 @@ test-obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: unit-test-debug - -release: unit-test-release - -clean: clean-debug clean-release - $(RM) -r doc - -test: unit-test-debug unit-test-release - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction lib-debug/$(FULL_LIBRARY): $(OBJECTS_DEBUG) obj-debug/ if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -176,27 +116,6 @@ lib-release/$(FULL_LIBRARY): $(OBJECTS_RELEASE) obj-release/ fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) - - -obj-debug/: FORCE obj-debug/makefile - $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" - -obj-release/: FORCE obj-release/makefile - $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - - - -$(OBJECTS_DEBUG): obj-debug/ - -$(OBJECTS_RELEASE): obj-release/ - - -build-debug: lib-debug/$(FULL_LIBRARY) - -build-release: lib-release/$(FULL_LIBRARY) - - - test-bin-debug/$(TESTBIN): lib-debug/$(FULL_LIBRARY) $(TEST_OBJECTS_DEBUG) test-obj-debug/ if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ @@ -219,7 +138,14 @@ test-bin-release/$(TESTBIN): lib-release/$(FULL_LIBRARY) $(TEST_OBJECTS_RELEASE) fi $(CXX) $(TEST_OBJECTS_RELEASE) -o $@ $(TEST_LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls +obj-debug/: FORCE obj-debug/makefile + $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" + +obj-release/: FORCE obj-release/makefile + $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" test-obj-debug/: FORCE test-obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath test-obj-debug) SOURCES_BASE_DIR=$(realpath test-src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" @@ -227,27 +153,32 @@ test-obj-debug/: FORCE test-obj-debug/makefile test-obj-release/: FORCE test-obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath test-obj-release) SOURCES_BASE_DIR=$(realpath test-src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies +$(OBJECTS_DEBUG): obj-debug/ + +$(OBJECTS_RELEASE): obj-release/ $(TEST_OBJECTS_DEBUG): test-obj-debug/ $(TEST_OBJECTS_RELEASE): test-obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets - -build-tests-debug: test-bin-debug/$(TESTBIN) - -build-tests-release: test-bin-release/$(TESTBIN) - - - -unit-test-debug: build-tests-debug +debug: test-bin-debug/$(TESTBIN) LD_LIBRARY_PATH="$(subst $(space),;,$(addsuffix lib-debug;,$(LINK_PATHS)))lib-debug" test-bin-debug/$(TESTBIN) -unit-test-release: build-tests-release +release: test-bin-release/$(TESTBIN) LD_LIBRARY_PATH="$(subst $(space),;,$(addsuffix lib-release;,$(LINK_PATHS)))lib-release" test-bin-release/$(TESTBIN) +clean: clean-debug clean-release + $(RM) -r doc +build-debug: lib-debug/$(FULL_LIBRARY) + +build-release: lib-release/$(FULL_LIBRARY) clean-debug: if [ -L obj-debug ]; then\ @@ -279,12 +210,5 @@ clean-release: fi $(RM) -r *.o *.d lib-release obj-release test-bin-release test-obj-release CppUnitTestResults.xml - - -FORCE: - - - doc: doxygen - diff --git a/alib2raw/makefile b/alib2raw/makefile index 24e112e01f..c6e48a6d76 100644 --- a/alib2raw/makefile +++ b/alib2raw/makefile @@ -24,69 +24,17 @@ TEST_OBJECTS_DEBUG:=$(patsubst test-src/%.cpp, test-obj-debug/%.o, $(shell find OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(filter-out $(wildcard src/debug/*), $(shell find src/ -name *cpp))) TEST_OBJECTS_RELEASE:=$(patsubst test-src/%.cpp, test-obj-release/%.o, $(shell find test-src/ -name *cpp)) -.PHONY: all build-debug build-tests-debug clean-debug doc +.PHONY: all debug release clean build-debug build-release clean-debug clean-release doc all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf - if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ - ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ - fi;\ - if [ -L $(subst /, , $(dir $@)) ]; then\ - mkdir -p `readlink $(subst /, , $(dir $@))`;\ - else\ - mkdir -p $(dir $@);\ - fi - echo "\ - SHELL:=/bin/bash$${NEW_LINE}\ - SRCDIR:=$${NEW_LINE}\ - $${NEW_LINE}\ - define NEW_LINE$${NEW_LINE}\ - $${NEW_LINE}\ - $${NEW_LINE}\ - endef$${NEW_LINE}\ - $${NEW_LINE}\ - export NEW_LINE$${NEW_LINE}\ - $${NEW_LINE}\ - CXXFLAGS:= -pipe -std=c++11 \$$(CXX_OTHER_FLAGS) -c -Wall -pedantic -Wextra -Werror -fPIC $(addprefix -I, $(INCLUDE_PATHS))$${NEW_LINE}\ - $${NEW_LINE}\ - SOURCES:= \$$(shell find \$$(SOURCES_BASE_DIR)/\$$(SRCDIR) -maxdepth 1 -type f -name \"*.cpp\")$${NEW_LINE}\ - DEPENDENCIES:= \$$(patsubst \$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%.cpp, \$$(OBJECTS_BASE_DIR)/\$$(SRCDIR)%.d, \$$(SOURCES))$${NEW_LINE}\ - OBJECTS:= \$$(patsubst %.d, %.o, \$$(DEPENDENCIES))$${NEW_LINE}\ - SOURCES_DIRS:= \$$(shell find \$$(SOURCES_BASE_DIR)/\$$(SRCDIR) -maxdepth 1 -mindepth 1 -type d)$${NEW_LINE}\ - OBJECTS_DIRS:= \$$(patsubst \$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%, %/, \$$(SOURCES_DIRS))$${NEW_LINE}\ - OBJECTS_DIRS_MAKEFILES:= \$$(patsubst %, %makefile, \$$(OBJECTS_DIRS))$${NEW_LINE}\ - $${NEW_LINE}\ - .PHONY: all$${NEW_LINE}\ - .PRECIOUS: \$$(DEPENDECIES) \$$(OBJECTS_DIRS_MAKEFILES)$${NEW_LINE}\ - $${NEW_LINE}\ - all: \$$(OBJECTS_DIRS) \$$(OBJECTS)$${NEW_LINE}\ - $${NEW_LINE}\ - %.d: makefile$${NEW_LINE}\ - @echo \"\\$${NEW_LINE}\ - \$$(shell sha1sum <<< \"\$$@\" | sed \"s/ -//g\") = \\$$\$$(shell (\\$$\$$(CXX) -M \\$$\$$(CXXFLAGS) \$$(patsubst \$$(OBJECTS_BASE_DIR)/\$$(SRCDIR)%.d,\$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%.cpp, \$$@) 2>/dev/null || echo \\\"\$$(patsubst \$$(OBJECTS_BASE_DIR)/\$$(SRCDIR)%.d,\$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%.cpp, \$$@) FORCE\\\") | sed \\\"s/.*://g;s/\\\\\\\\\\\\\\\\//g\\\")\$$\$${NEW_LINE}\\$${NEW_LINE}\ - \$$(patsubst %.d,%.o, \$$@): \\$$\$$(\$$(shell sha1sum <<< \"\$$@\" | sed \"s/ -//g\")) makefile\$$\$${NEW_LINE}\\$${NEW_LINE}\ - \\$$\$$(CXX) \\$$\$$(CXXFLAGS) \\$$\$$< -o \$$(patsubst %.d,%.o, \$$@)\$$\$${NEW_LINE}\\$${NEW_LINE}\ - \" > \$$@$${NEW_LINE}\ - $${NEW_LINE}\ - %/makefile: makefile$${NEW_LINE}\ - mkdir -p \$$(dir \$$@)$${NEW_LINE}\ - cp makefile \$$@$${NEW_LINE}\ - $${NEW_LINE}\ - %/: FORCE | %/makefile$${NEW_LINE}\ - @accesstime=\`stat -c %Y \$$@\` && \\$${NEW_LINE}\ - \$$(MAKE) -C \$$@ SRCDIR=\$$(SRCDIR)\$$(notdir \$$(patsubst %/, %, \$$@))/ OBJECTS_BASE_DIR=\$$(OBJECTS_BASE_DIR) SOURCES_BASE_DIR=\$$(SOURCES_BASE_DIR) CXX_OTHER_FLAGS=\"\$$(CXX_OTHER_FLAGS)\" && \\$${NEW_LINE}\ - accesstime2=\`stat -c %Y \$$@\` && \\$${NEW_LINE}\ - if [ "\$$\$$accesstime" -ne "\$$\$$accesstime2" ]; then \\$${NEW_LINE}\ - touch .; \\$${NEW_LINE}\ - fi$${NEW_LINE}\ - $${NEW_LINE}\ - FORCE:$${NEW_LINE}\ - $${NEW_LINE}\ - -include \$$(DEPENDENCIES)" > $@ +FORCE: -test-obj%/makefile: makefile makefile.conf +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -143,16 +91,8 @@ test-obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: unit-test-debug - -release: unit-test-release - -clean: clean-debug clean-release - $(RM) -r doc - -test: unit-test-debug unit-test-release - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction lib-debug/$(FULL_LIBRARY): $(OBJECTS_DEBUG) obj-debug/ if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -176,27 +116,6 @@ lib-release/$(FULL_LIBRARY): $(OBJECTS_RELEASE) obj-release/ fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) - - -obj-debug/: FORCE obj-debug/makefile - $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" - -obj-release/: FORCE obj-release/makefile - $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - - - -$(OBJECTS_DEBUG): obj-debug/ - -$(OBJECTS_RELEASE): obj-release/ - - -build-debug: lib-debug/$(FULL_LIBRARY) - -build-release: lib-release/$(FULL_LIBRARY) - - - test-bin-debug/$(TESTBIN): lib-debug/$(FULL_LIBRARY) $(TEST_OBJECTS_DEBUG) test-obj-debug/ if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ @@ -219,7 +138,14 @@ test-bin-release/$(TESTBIN): lib-release/$(FULL_LIBRARY) $(TEST_OBJECTS_RELEASE) fi $(CXX) $(TEST_OBJECTS_RELEASE) -o $@ $(TEST_LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls +obj-debug/: FORCE obj-debug/makefile + $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" + +obj-release/: FORCE obj-release/makefile + $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" test-obj-debug/: FORCE test-obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath test-obj-debug) SOURCES_BASE_DIR=$(realpath test-src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" @@ -227,27 +153,32 @@ test-obj-debug/: FORCE test-obj-debug/makefile test-obj-release/: FORCE test-obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath test-obj-release) SOURCES_BASE_DIR=$(realpath test-src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies +$(OBJECTS_DEBUG): obj-debug/ + +$(OBJECTS_RELEASE): obj-release/ $(TEST_OBJECTS_DEBUG): test-obj-debug/ $(TEST_OBJECTS_RELEASE): test-obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets - -build-tests-debug: test-bin-debug/$(TESTBIN) - -build-tests-release: test-bin-release/$(TESTBIN) - - - -unit-test-debug: build-tests-debug +debug: test-bin-debug/$(TESTBIN) LD_LIBRARY_PATH="$(subst $(space),;,$(addsuffix lib-debug;,$(LINK_PATHS)))lib-debug" test-bin-debug/$(TESTBIN) -unit-test-release: build-tests-release +release: test-bin-release/$(TESTBIN) LD_LIBRARY_PATH="$(subst $(space),;,$(addsuffix lib-release;,$(LINK_PATHS)))lib-release" test-bin-release/$(TESTBIN) +clean: clean-debug clean-release + $(RM) -r doc +build-debug: lib-debug/$(FULL_LIBRARY) + +build-release: lib-release/$(FULL_LIBRARY) clean-debug: if [ -L obj-debug ]; then\ @@ -279,12 +210,5 @@ clean-release: fi $(RM) -r *.o *.d lib-release obj-release test-bin-release test-obj-release CppUnitTestResults.xml - - -FORCE: - - - doc: doxygen - diff --git a/alib2std/makefile b/alib2std/makefile index 24e112e01f..c6e48a6d76 100644 --- a/alib2std/makefile +++ b/alib2std/makefile @@ -24,69 +24,17 @@ TEST_OBJECTS_DEBUG:=$(patsubst test-src/%.cpp, test-obj-debug/%.o, $(shell find OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(filter-out $(wildcard src/debug/*), $(shell find src/ -name *cpp))) TEST_OBJECTS_RELEASE:=$(patsubst test-src/%.cpp, test-obj-release/%.o, $(shell find test-src/ -name *cpp)) -.PHONY: all build-debug build-tests-debug clean-debug doc +.PHONY: all debug release clean build-debug build-release clean-debug clean-release doc all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf - if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ - ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ - fi;\ - if [ -L $(subst /, , $(dir $@)) ]; then\ - mkdir -p `readlink $(subst /, , $(dir $@))`;\ - else\ - mkdir -p $(dir $@);\ - fi - echo "\ - SHELL:=/bin/bash$${NEW_LINE}\ - SRCDIR:=$${NEW_LINE}\ - $${NEW_LINE}\ - define NEW_LINE$${NEW_LINE}\ - $${NEW_LINE}\ - $${NEW_LINE}\ - endef$${NEW_LINE}\ - $${NEW_LINE}\ - export NEW_LINE$${NEW_LINE}\ - $${NEW_LINE}\ - CXXFLAGS:= -pipe -std=c++11 \$$(CXX_OTHER_FLAGS) -c -Wall -pedantic -Wextra -Werror -fPIC $(addprefix -I, $(INCLUDE_PATHS))$${NEW_LINE}\ - $${NEW_LINE}\ - SOURCES:= \$$(shell find \$$(SOURCES_BASE_DIR)/\$$(SRCDIR) -maxdepth 1 -type f -name \"*.cpp\")$${NEW_LINE}\ - DEPENDENCIES:= \$$(patsubst \$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%.cpp, \$$(OBJECTS_BASE_DIR)/\$$(SRCDIR)%.d, \$$(SOURCES))$${NEW_LINE}\ - OBJECTS:= \$$(patsubst %.d, %.o, \$$(DEPENDENCIES))$${NEW_LINE}\ - SOURCES_DIRS:= \$$(shell find \$$(SOURCES_BASE_DIR)/\$$(SRCDIR) -maxdepth 1 -mindepth 1 -type d)$${NEW_LINE}\ - OBJECTS_DIRS:= \$$(patsubst \$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%, %/, \$$(SOURCES_DIRS))$${NEW_LINE}\ - OBJECTS_DIRS_MAKEFILES:= \$$(patsubst %, %makefile, \$$(OBJECTS_DIRS))$${NEW_LINE}\ - $${NEW_LINE}\ - .PHONY: all$${NEW_LINE}\ - .PRECIOUS: \$$(DEPENDECIES) \$$(OBJECTS_DIRS_MAKEFILES)$${NEW_LINE}\ - $${NEW_LINE}\ - all: \$$(OBJECTS_DIRS) \$$(OBJECTS)$${NEW_LINE}\ - $${NEW_LINE}\ - %.d: makefile$${NEW_LINE}\ - @echo \"\\$${NEW_LINE}\ - \$$(shell sha1sum <<< \"\$$@\" | sed \"s/ -//g\") = \\$$\$$(shell (\\$$\$$(CXX) -M \\$$\$$(CXXFLAGS) \$$(patsubst \$$(OBJECTS_BASE_DIR)/\$$(SRCDIR)%.d,\$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%.cpp, \$$@) 2>/dev/null || echo \\\"\$$(patsubst \$$(OBJECTS_BASE_DIR)/\$$(SRCDIR)%.d,\$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%.cpp, \$$@) FORCE\\\") | sed \\\"s/.*://g;s/\\\\\\\\\\\\\\\\//g\\\")\$$\$${NEW_LINE}\\$${NEW_LINE}\ - \$$(patsubst %.d,%.o, \$$@): \\$$\$$(\$$(shell sha1sum <<< \"\$$@\" | sed \"s/ -//g\")) makefile\$$\$${NEW_LINE}\\$${NEW_LINE}\ - \\$$\$$(CXX) \\$$\$$(CXXFLAGS) \\$$\$$< -o \$$(patsubst %.d,%.o, \$$@)\$$\$${NEW_LINE}\\$${NEW_LINE}\ - \" > \$$@$${NEW_LINE}\ - $${NEW_LINE}\ - %/makefile: makefile$${NEW_LINE}\ - mkdir -p \$$(dir \$$@)$${NEW_LINE}\ - cp makefile \$$@$${NEW_LINE}\ - $${NEW_LINE}\ - %/: FORCE | %/makefile$${NEW_LINE}\ - @accesstime=\`stat -c %Y \$$@\` && \\$${NEW_LINE}\ - \$$(MAKE) -C \$$@ SRCDIR=\$$(SRCDIR)\$$(notdir \$$(patsubst %/, %, \$$@))/ OBJECTS_BASE_DIR=\$$(OBJECTS_BASE_DIR) SOURCES_BASE_DIR=\$$(SOURCES_BASE_DIR) CXX_OTHER_FLAGS=\"\$$(CXX_OTHER_FLAGS)\" && \\$${NEW_LINE}\ - accesstime2=\`stat -c %Y \$$@\` && \\$${NEW_LINE}\ - if [ "\$$\$$accesstime" -ne "\$$\$$accesstime2" ]; then \\$${NEW_LINE}\ - touch .; \\$${NEW_LINE}\ - fi$${NEW_LINE}\ - $${NEW_LINE}\ - FORCE:$${NEW_LINE}\ - $${NEW_LINE}\ - -include \$$(DEPENDENCIES)" > $@ +FORCE: -test-obj%/makefile: makefile makefile.conf +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -143,16 +91,8 @@ test-obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: unit-test-debug - -release: unit-test-release - -clean: clean-debug clean-release - $(RM) -r doc - -test: unit-test-debug unit-test-release - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction lib-debug/$(FULL_LIBRARY): $(OBJECTS_DEBUG) obj-debug/ if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -176,27 +116,6 @@ lib-release/$(FULL_LIBRARY): $(OBJECTS_RELEASE) obj-release/ fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) - - -obj-debug/: FORCE obj-debug/makefile - $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" - -obj-release/: FORCE obj-release/makefile - $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - - - -$(OBJECTS_DEBUG): obj-debug/ - -$(OBJECTS_RELEASE): obj-release/ - - -build-debug: lib-debug/$(FULL_LIBRARY) - -build-release: lib-release/$(FULL_LIBRARY) - - - test-bin-debug/$(TESTBIN): lib-debug/$(FULL_LIBRARY) $(TEST_OBJECTS_DEBUG) test-obj-debug/ if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ @@ -219,7 +138,14 @@ test-bin-release/$(TESTBIN): lib-release/$(FULL_LIBRARY) $(TEST_OBJECTS_RELEASE) fi $(CXX) $(TEST_OBJECTS_RELEASE) -o $@ $(TEST_LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls +obj-debug/: FORCE obj-debug/makefile + $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" + +obj-release/: FORCE obj-release/makefile + $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" test-obj-debug/: FORCE test-obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath test-obj-debug) SOURCES_BASE_DIR=$(realpath test-src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" @@ -227,27 +153,32 @@ test-obj-debug/: FORCE test-obj-debug/makefile test-obj-release/: FORCE test-obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath test-obj-release) SOURCES_BASE_DIR=$(realpath test-src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies +$(OBJECTS_DEBUG): obj-debug/ + +$(OBJECTS_RELEASE): obj-release/ $(TEST_OBJECTS_DEBUG): test-obj-debug/ $(TEST_OBJECTS_RELEASE): test-obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets - -build-tests-debug: test-bin-debug/$(TESTBIN) - -build-tests-release: test-bin-release/$(TESTBIN) - - - -unit-test-debug: build-tests-debug +debug: test-bin-debug/$(TESTBIN) LD_LIBRARY_PATH="$(subst $(space),;,$(addsuffix lib-debug;,$(LINK_PATHS)))lib-debug" test-bin-debug/$(TESTBIN) -unit-test-release: build-tests-release +release: test-bin-release/$(TESTBIN) LD_LIBRARY_PATH="$(subst $(space),;,$(addsuffix lib-release;,$(LINK_PATHS)))lib-release" test-bin-release/$(TESTBIN) +clean: clean-debug clean-release + $(RM) -r doc +build-debug: lib-debug/$(FULL_LIBRARY) + +build-release: lib-release/$(FULL_LIBRARY) clean-debug: if [ -L obj-debug ]; then\ @@ -279,12 +210,5 @@ clean-release: fi $(RM) -r *.o *.d lib-release obj-release test-bin-release test-obj-release CppUnitTestResults.xml - - -FORCE: - - - doc: doxygen - diff --git a/alib2str/makefile b/alib2str/makefile index 24e112e01f..c6e48a6d76 100644 --- a/alib2str/makefile +++ b/alib2str/makefile @@ -24,69 +24,17 @@ TEST_OBJECTS_DEBUG:=$(patsubst test-src/%.cpp, test-obj-debug/%.o, $(shell find OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(filter-out $(wildcard src/debug/*), $(shell find src/ -name *cpp))) TEST_OBJECTS_RELEASE:=$(patsubst test-src/%.cpp, test-obj-release/%.o, $(shell find test-src/ -name *cpp)) -.PHONY: all build-debug build-tests-debug clean-debug doc +.PHONY: all debug release clean build-debug build-release clean-debug clean-release doc all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf - if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ - ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ - fi;\ - if [ -L $(subst /, , $(dir $@)) ]; then\ - mkdir -p `readlink $(subst /, , $(dir $@))`;\ - else\ - mkdir -p $(dir $@);\ - fi - echo "\ - SHELL:=/bin/bash$${NEW_LINE}\ - SRCDIR:=$${NEW_LINE}\ - $${NEW_LINE}\ - define NEW_LINE$${NEW_LINE}\ - $${NEW_LINE}\ - $${NEW_LINE}\ - endef$${NEW_LINE}\ - $${NEW_LINE}\ - export NEW_LINE$${NEW_LINE}\ - $${NEW_LINE}\ - CXXFLAGS:= -pipe -std=c++11 \$$(CXX_OTHER_FLAGS) -c -Wall -pedantic -Wextra -Werror -fPIC $(addprefix -I, $(INCLUDE_PATHS))$${NEW_LINE}\ - $${NEW_LINE}\ - SOURCES:= \$$(shell find \$$(SOURCES_BASE_DIR)/\$$(SRCDIR) -maxdepth 1 -type f -name \"*.cpp\")$${NEW_LINE}\ - DEPENDENCIES:= \$$(patsubst \$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%.cpp, \$$(OBJECTS_BASE_DIR)/\$$(SRCDIR)%.d, \$$(SOURCES))$${NEW_LINE}\ - OBJECTS:= \$$(patsubst %.d, %.o, \$$(DEPENDENCIES))$${NEW_LINE}\ - SOURCES_DIRS:= \$$(shell find \$$(SOURCES_BASE_DIR)/\$$(SRCDIR) -maxdepth 1 -mindepth 1 -type d)$${NEW_LINE}\ - OBJECTS_DIRS:= \$$(patsubst \$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%, %/, \$$(SOURCES_DIRS))$${NEW_LINE}\ - OBJECTS_DIRS_MAKEFILES:= \$$(patsubst %, %makefile, \$$(OBJECTS_DIRS))$${NEW_LINE}\ - $${NEW_LINE}\ - .PHONY: all$${NEW_LINE}\ - .PRECIOUS: \$$(DEPENDECIES) \$$(OBJECTS_DIRS_MAKEFILES)$${NEW_LINE}\ - $${NEW_LINE}\ - all: \$$(OBJECTS_DIRS) \$$(OBJECTS)$${NEW_LINE}\ - $${NEW_LINE}\ - %.d: makefile$${NEW_LINE}\ - @echo \"\\$${NEW_LINE}\ - \$$(shell sha1sum <<< \"\$$@\" | sed \"s/ -//g\") = \\$$\$$(shell (\\$$\$$(CXX) -M \\$$\$$(CXXFLAGS) \$$(patsubst \$$(OBJECTS_BASE_DIR)/\$$(SRCDIR)%.d,\$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%.cpp, \$$@) 2>/dev/null || echo \\\"\$$(patsubst \$$(OBJECTS_BASE_DIR)/\$$(SRCDIR)%.d,\$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%.cpp, \$$@) FORCE\\\") | sed \\\"s/.*://g;s/\\\\\\\\\\\\\\\\//g\\\")\$$\$${NEW_LINE}\\$${NEW_LINE}\ - \$$(patsubst %.d,%.o, \$$@): \\$$\$$(\$$(shell sha1sum <<< \"\$$@\" | sed \"s/ -//g\")) makefile\$$\$${NEW_LINE}\\$${NEW_LINE}\ - \\$$\$$(CXX) \\$$\$$(CXXFLAGS) \\$$\$$< -o \$$(patsubst %.d,%.o, \$$@)\$$\$${NEW_LINE}\\$${NEW_LINE}\ - \" > \$$@$${NEW_LINE}\ - $${NEW_LINE}\ - %/makefile: makefile$${NEW_LINE}\ - mkdir -p \$$(dir \$$@)$${NEW_LINE}\ - cp makefile \$$@$${NEW_LINE}\ - $${NEW_LINE}\ - %/: FORCE | %/makefile$${NEW_LINE}\ - @accesstime=\`stat -c %Y \$$@\` && \\$${NEW_LINE}\ - \$$(MAKE) -C \$$@ SRCDIR=\$$(SRCDIR)\$$(notdir \$$(patsubst %/, %, \$$@))/ OBJECTS_BASE_DIR=\$$(OBJECTS_BASE_DIR) SOURCES_BASE_DIR=\$$(SOURCES_BASE_DIR) CXX_OTHER_FLAGS=\"\$$(CXX_OTHER_FLAGS)\" && \\$${NEW_LINE}\ - accesstime2=\`stat -c %Y \$$@\` && \\$${NEW_LINE}\ - if [ "\$$\$$accesstime" -ne "\$$\$$accesstime2" ]; then \\$${NEW_LINE}\ - touch .; \\$${NEW_LINE}\ - fi$${NEW_LINE}\ - $${NEW_LINE}\ - FORCE:$${NEW_LINE}\ - $${NEW_LINE}\ - -include \$$(DEPENDENCIES)" > $@ +FORCE: -test-obj%/makefile: makefile makefile.conf +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -143,16 +91,8 @@ test-obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: unit-test-debug - -release: unit-test-release - -clean: clean-debug clean-release - $(RM) -r doc - -test: unit-test-debug unit-test-release - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction lib-debug/$(FULL_LIBRARY): $(OBJECTS_DEBUG) obj-debug/ if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -176,27 +116,6 @@ lib-release/$(FULL_LIBRARY): $(OBJECTS_RELEASE) obj-release/ fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) - - -obj-debug/: FORCE obj-debug/makefile - $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" - -obj-release/: FORCE obj-release/makefile - $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - - - -$(OBJECTS_DEBUG): obj-debug/ - -$(OBJECTS_RELEASE): obj-release/ - - -build-debug: lib-debug/$(FULL_LIBRARY) - -build-release: lib-release/$(FULL_LIBRARY) - - - test-bin-debug/$(TESTBIN): lib-debug/$(FULL_LIBRARY) $(TEST_OBJECTS_DEBUG) test-obj-debug/ if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ @@ -219,7 +138,14 @@ test-bin-release/$(TESTBIN): lib-release/$(FULL_LIBRARY) $(TEST_OBJECTS_RELEASE) fi $(CXX) $(TEST_OBJECTS_RELEASE) -o $@ $(TEST_LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls +obj-debug/: FORCE obj-debug/makefile + $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" + +obj-release/: FORCE obj-release/makefile + $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" test-obj-debug/: FORCE test-obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath test-obj-debug) SOURCES_BASE_DIR=$(realpath test-src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" @@ -227,27 +153,32 @@ test-obj-debug/: FORCE test-obj-debug/makefile test-obj-release/: FORCE test-obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath test-obj-release) SOURCES_BASE_DIR=$(realpath test-src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies +$(OBJECTS_DEBUG): obj-debug/ + +$(OBJECTS_RELEASE): obj-release/ $(TEST_OBJECTS_DEBUG): test-obj-debug/ $(TEST_OBJECTS_RELEASE): test-obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets - -build-tests-debug: test-bin-debug/$(TESTBIN) - -build-tests-release: test-bin-release/$(TESTBIN) - - - -unit-test-debug: build-tests-debug +debug: test-bin-debug/$(TESTBIN) LD_LIBRARY_PATH="$(subst $(space),;,$(addsuffix lib-debug;,$(LINK_PATHS)))lib-debug" test-bin-debug/$(TESTBIN) -unit-test-release: build-tests-release +release: test-bin-release/$(TESTBIN) LD_LIBRARY_PATH="$(subst $(space),;,$(addsuffix lib-release;,$(LINK_PATHS)))lib-release" test-bin-release/$(TESTBIN) +clean: clean-debug clean-release + $(RM) -r doc +build-debug: lib-debug/$(FULL_LIBRARY) + +build-release: lib-release/$(FULL_LIBRARY) clean-debug: if [ -L obj-debug ]; then\ @@ -279,12 +210,5 @@ clean-release: fi $(RM) -r *.o *.d lib-release obj-release test-bin-release test-obj-release CppUnitTestResults.xml - - -FORCE: - - - doc: doxygen - diff --git a/alphabetManip2/makefile b/alphabetManip2/makefile index 3d4b105138..dd28431218 100644 --- a/alphabetManip2/makefile +++ b/alphabetManip2/makefile @@ -22,7 +22,12 @@ OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(shell find src/ -name all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf +FORCE: + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -79,14 +84,8 @@ obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: build-debug - -release: build-release - -clean: clean-debug clean-release - $(RM) -r doc - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction bin-debug/$(EXECUTABLE): obj-debug/ $(OBJECTS_DEBUG) if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -110,26 +109,31 @@ bin-release/$(EXECUTABLE): obj-release/ $(OBJECTS_RELEASE) fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls - -obj-debug/: FORCE | obj-debug/makefile +obj-debug/: FORCE | obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" obj-release/: FORCE | obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies $(OBJECTS_DEBUG): obj-debug/ $(OBJECTS_RELEASE): obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets -build-debug: bin-debug/$(EXECUTABLE) - -build-release: bin-release/$(EXECUTABLE) +debug: bin-debug/$(EXECUTABLE) +release: bin-release/$(EXECUTABLE) +clean: clean-debug clean-release + $(RM) -r doc clean-debug: if [ -L obj-debug ]; then\ @@ -149,12 +153,5 @@ clean-release: fi $(RM) -r *.o *.d bin-release obj-release - - -FORCE: - - - doc: doxygen - diff --git a/ameasure2/makefile b/ameasure2/makefile index 2e8d915f88..dd28431218 100644 --- a/ameasure2/makefile +++ b/ameasure2/makefile @@ -22,7 +22,12 @@ OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(shell find src/ -name all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf +FORCE: + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -79,14 +84,8 @@ obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: build-debug - -release: build-release - -clean: clean-debug clean-release - $(RM) -r doc - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction bin-debug/$(EXECUTABLE): obj-debug/ $(OBJECTS_DEBUG) if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -110,7 +109,8 @@ bin-release/$(EXECUTABLE): obj-release/ $(OBJECTS_RELEASE) fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls obj-debug/: FORCE | obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" @@ -118,18 +118,22 @@ obj-debug/: FORCE | obj-debug/makefile obj-release/: FORCE | obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies $(OBJECTS_DEBUG): obj-debug/ $(OBJECTS_RELEASE): obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets -build-debug: bin-debug/$(EXECUTABLE) - -build-release: bin-release/$(EXECUTABLE) +debug: bin-debug/$(EXECUTABLE) +release: bin-release/$(EXECUTABLE) +clean: clean-debug clean-release + $(RM) -r doc clean-debug: if [ -L obj-debug ]; then\ @@ -149,12 +153,5 @@ clean-release: fi $(RM) -r *.o *.d bin-release obj-release - - -FORCE: - - - doc: doxygen - diff --git a/ameasurep2/makefile b/ameasurep2/makefile index 2e8d915f88..dd28431218 100644 --- a/ameasurep2/makefile +++ b/ameasurep2/makefile @@ -22,7 +22,12 @@ OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(shell find src/ -name all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf +FORCE: + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -79,14 +84,8 @@ obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: build-debug - -release: build-release - -clean: clean-debug clean-release - $(RM) -r doc - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction bin-debug/$(EXECUTABLE): obj-debug/ $(OBJECTS_DEBUG) if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -110,7 +109,8 @@ bin-release/$(EXECUTABLE): obj-release/ $(OBJECTS_RELEASE) fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls obj-debug/: FORCE | obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" @@ -118,18 +118,22 @@ obj-debug/: FORCE | obj-debug/makefile obj-release/: FORCE | obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies $(OBJECTS_DEBUG): obj-debug/ $(OBJECTS_RELEASE): obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets -build-debug: bin-debug/$(EXECUTABLE) - -build-release: bin-release/$(EXECUTABLE) +debug: bin-debug/$(EXECUTABLE) +release: bin-release/$(EXECUTABLE) +clean: clean-debug clean-release + $(RM) -r doc clean-debug: if [ -L obj-debug ]; then\ @@ -149,12 +153,5 @@ clean-release: fi $(RM) -r *.o *.d bin-release obj-release - - -FORCE: - - - doc: doxygen - diff --git a/aminimize2/makefile b/aminimize2/makefile index 3d4b105138..dd28431218 100644 --- a/aminimize2/makefile +++ b/aminimize2/makefile @@ -22,7 +22,12 @@ OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(shell find src/ -name all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf +FORCE: + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -79,14 +84,8 @@ obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: build-debug - -release: build-release - -clean: clean-debug clean-release - $(RM) -r doc - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction bin-debug/$(EXECUTABLE): obj-debug/ $(OBJECTS_DEBUG) if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -110,26 +109,31 @@ bin-release/$(EXECUTABLE): obj-release/ $(OBJECTS_RELEASE) fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls - -obj-debug/: FORCE | obj-debug/makefile +obj-debug/: FORCE | obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" obj-release/: FORCE | obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies $(OBJECTS_DEBUG): obj-debug/ $(OBJECTS_RELEASE): obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets -build-debug: bin-debug/$(EXECUTABLE) - -build-release: bin-release/$(EXECUTABLE) +debug: bin-debug/$(EXECUTABLE) +release: bin-release/$(EXECUTABLE) +clean: clean-debug clean-release + $(RM) -r doc clean-debug: if [ -L obj-debug ]; then\ @@ -149,12 +153,5 @@ clean-release: fi $(RM) -r *.o *.d bin-release obj-release - - -FORCE: - - - doc: doxygen - diff --git a/anormalize2/makefile b/anormalize2/makefile index 3d4b105138..dd28431218 100644 --- a/anormalize2/makefile +++ b/anormalize2/makefile @@ -22,7 +22,12 @@ OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(shell find src/ -name all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf +FORCE: + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -79,14 +84,8 @@ obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: build-debug - -release: build-release - -clean: clean-debug clean-release - $(RM) -r doc - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction bin-debug/$(EXECUTABLE): obj-debug/ $(OBJECTS_DEBUG) if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -110,26 +109,31 @@ bin-release/$(EXECUTABLE): obj-release/ $(OBJECTS_RELEASE) fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls - -obj-debug/: FORCE | obj-debug/makefile +obj-debug/: FORCE | obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" obj-release/: FORCE | obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies $(OBJECTS_DEBUG): obj-debug/ $(OBJECTS_RELEASE): obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets -build-debug: bin-debug/$(EXECUTABLE) - -build-release: bin-release/$(EXECUTABLE) +debug: bin-debug/$(EXECUTABLE) +release: bin-release/$(EXECUTABLE) +clean: clean-debug clean-release + $(RM) -r doc clean-debug: if [ -L obj-debug ]; then\ @@ -149,12 +153,5 @@ clean-release: fi $(RM) -r *.o *.d bin-release obj-release - - -FORCE: - - - doc: doxygen - diff --git a/arand2/makefile b/arand2/makefile index 3d4b105138..dd28431218 100644 --- a/arand2/makefile +++ b/arand2/makefile @@ -22,7 +22,12 @@ OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(shell find src/ -name all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf +FORCE: + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -79,14 +84,8 @@ obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: build-debug - -release: build-release - -clean: clean-debug clean-release - $(RM) -r doc - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction bin-debug/$(EXECUTABLE): obj-debug/ $(OBJECTS_DEBUG) if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -110,26 +109,31 @@ bin-release/$(EXECUTABLE): obj-release/ $(OBJECTS_RELEASE) fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls - -obj-debug/: FORCE | obj-debug/makefile +obj-debug/: FORCE | obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" obj-release/: FORCE | obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies $(OBJECTS_DEBUG): obj-debug/ $(OBJECTS_RELEASE): obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets -build-debug: bin-debug/$(EXECUTABLE) - -build-release: bin-release/$(EXECUTABLE) +debug: bin-debug/$(EXECUTABLE) +release: bin-release/$(EXECUTABLE) +clean: clean-debug clean-release + $(RM) -r doc clean-debug: if [ -L obj-debug ]; then\ @@ -149,12 +153,5 @@ clean-release: fi $(RM) -r *.o *.d bin-release obj-release - - -FORCE: - - - doc: doxygen - diff --git a/araw2/makefile b/araw2/makefile index 3d4b105138..dd28431218 100644 --- a/araw2/makefile +++ b/araw2/makefile @@ -22,7 +22,12 @@ OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(shell find src/ -name all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf +FORCE: + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -79,14 +84,8 @@ obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: build-debug - -release: build-release - -clean: clean-debug clean-release - $(RM) -r doc - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction bin-debug/$(EXECUTABLE): obj-debug/ $(OBJECTS_DEBUG) if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -110,26 +109,31 @@ bin-release/$(EXECUTABLE): obj-release/ $(OBJECTS_RELEASE) fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls - -obj-debug/: FORCE | obj-debug/makefile +obj-debug/: FORCE | obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" obj-release/: FORCE | obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies $(OBJECTS_DEBUG): obj-debug/ $(OBJECTS_RELEASE): obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets -build-debug: bin-debug/$(EXECUTABLE) - -build-release: bin-release/$(EXECUTABLE) +debug: bin-debug/$(EXECUTABLE) +release: bin-release/$(EXECUTABLE) +clean: clean-debug clean-release + $(RM) -r doc clean-debug: if [ -L obj-debug ]; then\ @@ -149,12 +153,5 @@ clean-release: fi $(RM) -r *.o *.d bin-release obj-release - - -FORCE: - - - doc: doxygen - diff --git a/arename2/makefile b/arename2/makefile index 3d4b105138..dd28431218 100644 --- a/arename2/makefile +++ b/arename2/makefile @@ -22,7 +22,12 @@ OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(shell find src/ -name all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf +FORCE: + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -79,14 +84,8 @@ obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: build-debug - -release: build-release - -clean: clean-debug clean-release - $(RM) -r doc - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction bin-debug/$(EXECUTABLE): obj-debug/ $(OBJECTS_DEBUG) if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -110,26 +109,31 @@ bin-release/$(EXECUTABLE): obj-release/ $(OBJECTS_RELEASE) fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls - -obj-debug/: FORCE | obj-debug/makefile +obj-debug/: FORCE | obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" obj-release/: FORCE | obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies $(OBJECTS_DEBUG): obj-debug/ $(OBJECTS_RELEASE): obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets -build-debug: bin-debug/$(EXECUTABLE) - -build-release: bin-release/$(EXECUTABLE) +debug: bin-debug/$(EXECUTABLE) +release: bin-release/$(EXECUTABLE) +clean: clean-debug clean-release + $(RM) -r doc clean-debug: if [ -L obj-debug ]; then\ @@ -149,12 +153,5 @@ clean-release: fi $(RM) -r *.o *.d bin-release obj-release - - -FORCE: - - - doc: doxygen - diff --git a/areverse2/makefile b/areverse2/makefile index 3d4b105138..dd28431218 100644 --- a/areverse2/makefile +++ b/areverse2/makefile @@ -22,7 +22,12 @@ OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(shell find src/ -name all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf +FORCE: + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -79,14 +84,8 @@ obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: build-debug - -release: build-release - -clean: clean-debug clean-release - $(RM) -r doc - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction bin-debug/$(EXECUTABLE): obj-debug/ $(OBJECTS_DEBUG) if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -110,26 +109,31 @@ bin-release/$(EXECUTABLE): obj-release/ $(OBJECTS_RELEASE) fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls - -obj-debug/: FORCE | obj-debug/makefile +obj-debug/: FORCE | obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" obj-release/: FORCE | obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies $(OBJECTS_DEBUG): obj-debug/ $(OBJECTS_RELEASE): obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets -build-debug: bin-debug/$(EXECUTABLE) - -build-release: bin-release/$(EXECUTABLE) +debug: bin-debug/$(EXECUTABLE) +release: bin-release/$(EXECUTABLE) +clean: clean-debug clean-release + $(RM) -r doc clean-debug: if [ -L obj-debug ]; then\ @@ -149,12 +153,5 @@ clean-release: fi $(RM) -r *.o *.d bin-release obj-release - - -FORCE: - - - doc: doxygen - diff --git a/arun2/makefile b/arun2/makefile index 3d4b105138..dd28431218 100644 --- a/arun2/makefile +++ b/arun2/makefile @@ -22,7 +22,12 @@ OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(shell find src/ -name all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf +FORCE: + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -79,14 +84,8 @@ obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: build-debug - -release: build-release - -clean: clean-debug clean-release - $(RM) -r doc - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction bin-debug/$(EXECUTABLE): obj-debug/ $(OBJECTS_DEBUG) if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -110,26 +109,31 @@ bin-release/$(EXECUTABLE): obj-release/ $(OBJECTS_RELEASE) fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls - -obj-debug/: FORCE | obj-debug/makefile +obj-debug/: FORCE | obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" obj-release/: FORCE | obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies $(OBJECTS_DEBUG): obj-debug/ $(OBJECTS_RELEASE): obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets -build-debug: bin-debug/$(EXECUTABLE) - -build-release: bin-release/$(EXECUTABLE) +debug: bin-debug/$(EXECUTABLE) +release: bin-release/$(EXECUTABLE) +clean: clean-debug clean-release + $(RM) -r doc clean-debug: if [ -L obj-debug ]; then\ @@ -149,12 +153,5 @@ clean-release: fi $(RM) -r *.o *.d bin-release obj-release - - -FORCE: - - - doc: doxygen - diff --git a/astat2/makefile b/astat2/makefile index 3d4b105138..dd28431218 100644 --- a/astat2/makefile +++ b/astat2/makefile @@ -22,7 +22,12 @@ OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(shell find src/ -name all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf +FORCE: + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -79,14 +84,8 @@ obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: build-debug - -release: build-release - -clean: clean-debug clean-release - $(RM) -r doc - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction bin-debug/$(EXECUTABLE): obj-debug/ $(OBJECTS_DEBUG) if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -110,26 +109,31 @@ bin-release/$(EXECUTABLE): obj-release/ $(OBJECTS_RELEASE) fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls - -obj-debug/: FORCE | obj-debug/makefile +obj-debug/: FORCE | obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" obj-release/: FORCE | obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies $(OBJECTS_DEBUG): obj-debug/ $(OBJECTS_RELEASE): obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets -build-debug: bin-debug/$(EXECUTABLE) - -build-release: bin-release/$(EXECUTABLE) +debug: bin-debug/$(EXECUTABLE) +release: bin-release/$(EXECUTABLE) +clean: clean-debug clean-release + $(RM) -r doc clean-debug: if [ -L obj-debug ]; then\ @@ -149,12 +153,5 @@ clean-release: fi $(RM) -r *.o *.d bin-release obj-release - - -FORCE: - - - doc: doxygen - diff --git a/astringology2/makefile b/astringology2/makefile index 3d4b105138..dd28431218 100644 --- a/astringology2/makefile +++ b/astringology2/makefile @@ -22,7 +22,12 @@ OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(shell find src/ -name all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf +FORCE: + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -79,14 +84,8 @@ obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: build-debug - -release: build-release - -clean: clean-debug clean-release - $(RM) -r doc - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction bin-debug/$(EXECUTABLE): obj-debug/ $(OBJECTS_DEBUG) if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -110,26 +109,31 @@ bin-release/$(EXECUTABLE): obj-release/ $(OBJECTS_RELEASE) fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls - -obj-debug/: FORCE | obj-debug/makefile +obj-debug/: FORCE | obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" obj-release/: FORCE | obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies $(OBJECTS_DEBUG): obj-debug/ $(OBJECTS_RELEASE): obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets -build-debug: bin-debug/$(EXECUTABLE) - -build-release: bin-release/$(EXECUTABLE) +debug: bin-debug/$(EXECUTABLE) +release: bin-release/$(EXECUTABLE) +clean: clean-debug clean-release + $(RM) -r doc clean-debug: if [ -L obj-debug ]; then\ @@ -149,12 +153,5 @@ clean-release: fi $(RM) -r *.o *.d bin-release obj-release - - -FORCE: - - - doc: doxygen - diff --git a/atrim2/makefile b/atrim2/makefile index 3d4b105138..dd28431218 100644 --- a/atrim2/makefile +++ b/atrim2/makefile @@ -22,7 +22,12 @@ OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(shell find src/ -name all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf +FORCE: + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -79,14 +84,8 @@ obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: build-debug - -release: build-release - -clean: clean-debug clean-release - $(RM) -r doc - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction bin-debug/$(EXECUTABLE): obj-debug/ $(OBJECTS_DEBUG) if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -110,26 +109,31 @@ bin-release/$(EXECUTABLE): obj-release/ $(OBJECTS_RELEASE) fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls - -obj-debug/: FORCE | obj-debug/makefile +obj-debug/: FORCE | obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" obj-release/: FORCE | obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies $(OBJECTS_DEBUG): obj-debug/ $(OBJECTS_RELEASE): obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets -build-debug: bin-debug/$(EXECUTABLE) - -build-release: bin-release/$(EXECUTABLE) +debug: bin-debug/$(EXECUTABLE) +release: bin-release/$(EXECUTABLE) +clean: clean-debug clean-release + $(RM) -r doc clean-debug: if [ -L obj-debug ]; then\ @@ -149,12 +153,5 @@ clean-release: fi $(RM) -r *.o *.d bin-release obj-release - - -FORCE: - - - doc: doxygen - diff --git a/makefile b/makefile index 35b4706069..a49aa345a9 100644 --- a/makefile +++ b/makefile @@ -12,23 +12,14 @@ ifndef JOBS JOBS := 1 endif -STD_LIB = alib2std -DATA_LIB = alib2data -COMMON_LIB = alib2common -STR_LIB = alib2str -RAW_LIB = alib2raw -ALGO_LIB = alib2algo -ELGO_LIB = alib2elgo -MEASUREPP_LIB = alib2measurepp - -SUBDIRS_LIBS = $(STD_LIB) \ - $(COMMON_LIB) \ - $(DATA_LIB) \ - $(STR_LIB) \ - $(RAW_LIB) \ - $(ALGO_LIB) \ - $(ELGO_LIB) \ - $(MEASUREPP_LIB) +SUBDIRS_LIBS = alib2std \ + alib2common \ + alib2data \ + alib2str \ + alib2raw \ + alib2algo \ + alib2elgo \ + alib2measurepp \ SUBDIRS_BINS = aecho2 \ aarbology2 \ @@ -87,20 +78,20 @@ endif SUBDIRS_WITH_MAKE = $(dir $(wildcard */makefile)) -.PHONY: $(addsuffix .all-debug , $(SUBDIRS_LIBS) $(SUBDIRS_BINS)) \ - $(addsuffix .all-release, $(SUBDIRS_LIBS) $(SUBDIRS_BINS))\ - $(addsuffix .build-debug , $(SUBDIRS_LIBS) $(SUBDIRS_BINS)) \ - $(addsuffix .build-release, $(SUBDIRS_LIBS) $(SUBDIRS_BINS))\ - $(addsuffix .build-debug-tests , $(SUBDIRS_LIBS) $(SUBDIRS_BINS)) \ - $(addsuffix .build-release-tests, $(SUBDIRS_LIBS) $(SUBDIRS_BINS))\ - all-debug build-debug build-test-debug unit-test-debug clean-debug \ - all-release build-release build-test-release unit-test-release clean-release \ - debug release clean doc all +.PHONY: build-debug clean-debug \ + build-release clean-release \ + debug release clean doc all all: @echo "What to do master?" -debug: all-debug +debug build-debug: + for dir in $(SUBDIRS_LIBS); do \ + $(MAKE) $@ -C $$dir; \ + done + for dir in $(SUBDIRS_BINS); do \ + $(MAKE) debug -C $$dir; \ + done if [ ! -w $(addsuffix -debug, $(BINFOLDER)) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(addsuffix -debug, $(BINFOLDER)) $(subst /, , $(addsuffix -debug, $(BINFOLDER))) 2>/dev/null;\ fi;\ @@ -116,15 +107,17 @@ debug: all-debug for dir in $(SUBDIRS_BINS); do \ cp $$dir/bin-debug/* $(addsuffix -debug, $(BINFOLDER)); \ done - ./tests.examples.sh debug $(JOBS) - ./tests.adeterminize.sh debug $(JOBS) - ./tests.aconversion.sh debug $(JOBS) - ./tests.aderivation.aintegral.sh debug $(JOBS) - ./tests.astringology.sh debug $(JOBS) - ./tests.anormalize.sh debug $(JOBS) - ./tests.aarbology.sh debug $(JOBS) + if [ "$@" == "debug" ]; then for test in $(wildcard tests.*.sh); do \ + ./$$test debug $(JOBS); \ + done; fi -release: all-release +release build-release: + for dir in $(SUBDIRS_LIBS); do \ + $(MAKE) $@ -C $$dir \ + done \ + for dir in $(SUBDIRS_BINS); do \ + $(MAKE) release -C $$dir \ + done \ if [ ! -w $(addsuffix -release, $(BINFOLDER)) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(addsuffix -release, $(BINFOLDER)) $(subst /, , $(addsuffix -release, $(BINFOLDER))) 2>/dev/null;\ fi;\ @@ -140,204 +133,13 @@ release: all-release for dir in $(SUBDIRS_BINS); do \ cp $$dir/bin-release/* $(addsuffix -release, $(BINFOLDER)); \ done - ./tests.examples.sh release $(JOBS) - ./tests.adeterminize.sh release $(JOBS) - ./tests.aconversion.sh release $(JOBS) - ./tests.aderivation.aintegral.sh release $(JOBS) - ./tests.astringology.sh release $(JOBS) - ./tests.anormalize.sh release $(JOBS) - ./tests.aarbology.sh release $(JOBS) + if [ "$@" == "release" ]; then for test in $(wildcard tests.*.sh); do \ + ./$$test debug $(JOBS); \ + done; fi -clean : clean-debug clean-release +clean: clean-debug clean-release $(RM) -r bin-debug bin-release - - -all-debug : $(addsuffix .all-debug , $(SUBDIRS_LIBS) $(SUBDIRS_BINS)) - -all-release : $(addsuffix .all-release, $(SUBDIRS_LIBS) $(SUBDIRS_BINS)) - - - -build-debug : $(addsuffix .build-debug , $(SUBDIRS_LIBS) $(SUBDIRS_BINS)) - -build-release: $(addsuffix .build-release, $(SUBDIRS_LIBS) $(SUBDIRS_BINS)) - - - -build-tests-debug : $(addsuffix .build-tests-debug , $(SUBDIRS_LIBS)) - -build-tests-release: $(addsuffix .build-tests-release, $(SUBDIRS_LIBS)) - - - -$(addsuffix .all-debug, $(STD_LIB)): - $(MAKE) debug -C $(basename $@) - -$(addsuffix .all-debug, $(COMMON_LIB)): $(addsuffix .all-debug, $(STD_LIB)) - $(MAKE) debug -C $(basename $@) - -$(addsuffix .all-debug, $(DATA_LIB)): $(addsuffix .all-debug, $(COMMON_LIB)) - $(MAKE) debug -C $(basename $@) - -$(addsuffix .all-debug, $(STR_LIB)): $(addsuffix .all-debug, $(DATA_LIB)) - $(MAKE) debug -C $(basename $@) - -$(addsuffix .all-debug, $(RAW_LIB)): $(addsuffix .all-debug, $(STR_LIB)) - $(MAKE) debug -C $(basename $@) - -$(addsuffix .all-debug, $(ALGO_LIB)): $(addsuffix .all-debug, $(RAW_LIB)) - $(MAKE) debug -C $(basename $@) - -$(addsuffix .all-debug, $(ELGO_LIB)): $(addsuffix .all-debug, $(ALGO_LIB)) - $(MAKE) debug -C $(basename $@) - -$(addsuffix .all-debug, $(MEASUREPP_LIB)): $(addsuffix .all-debug, $(ELGO_LIB)) - $(MAKE) debug -C $(basename $@) - -$(addsuffix .all-debug, $(SUBDIRS_BINS)): $(addsuffix .all-debug, $(MEASUREPP_LIB)) - $(MAKE) debug -C $(basename $@) - - - -$(addsuffix .all-release, $(STD_LIB)): - $(MAKE) release -C $(basename $@) - -$(addsuffix .all-release, $(COMMON_LIB)): $(addsuffix .all-release, $(STD_LIB)) - $(MAKE) release -C $(basename $@) - -$(addsuffix .all-release, $(DATA_LIB)): $(addsuffix .all-release, $(COMMON_LIB)) - $(MAKE) release -C $(basename $@) - -$(addsuffix .all-release, $(STR_LIB)): $(addsuffix .all-release, $(DATA_LIB)) - $(MAKE) release -C $(basename $@) - -$(addsuffix .all-release, $(RAW_LIB)): $(addsuffix .all-release, $(STR_LIB)) - $(MAKE) release -C $(basename $@) - -$(addsuffix .all-release, $(ALGO_LIB)): $(addsuffix .all-release, $(RAW_LIB)) - $(MAKE) release -C $(basename $@) - -$(addsuffix .all-release, $(ELGO_LIB)): $(addsuffix .all-release, $(ALGO_LIB)) - $(MAKE) release -C $(basename $@) - -$(addsuffix .all-release, $(MEASUREPP_LIB)): $(addsuffix .all-release, $(ELGO_LIB)) - $(MAKE) release -C $(basename $@) - -$(addsuffix .all-release, $(SUBDIRS_BINS)): $(addsuffix .all-release, $(MEASUREPP_LIB)) - $(MAKE) release -C $(basename $@) - - - -$(addsuffix .build-debug, $(STD_LIB)): - $(MAKE) build-debug -C $(basename $@) - -$(addsuffix .build-debug, $(COMMON_LIB)): $(addsuffix .build-debug, $(STD_LIB)) - $(MAKE) build-debug -C $(basename $@) - -$(addsuffix .build-debug, $(DATA_LIB)): $(addsuffix .build-debug, $(COMMON_LIB)) - $(MAKE) build-debug -C $(basename $@) - -$(addsuffix .build-debug, $(STR_LIB)): $(addsuffix .build-debug, $(DATA_LIB)) - $(MAKE) build-debug -C $(basename $@) - -$(addsuffix .build-debug, $(RAW_LIB)): $(addsuffix .build-debug, $(STR_LIB)) - $(MAKE) build-debug -C $(basename $@) - -$(addsuffix .build-debug, $(ALGO_LIB)): $(addsuffix .build-debug, $(RAW_LIB)) - $(MAKE) build-debug -C $(basename $@) - -$(addsuffix .build-debug, $(ELGO_LIB)): $(addsuffix .build-debug, $(ALGO_LIB)) - $(MAKE) build-debug -C $(basename $@) - -$(addsuffix .build-debug, $(MEASUREPP_LIB)): $(addsuffix .build-debug, $(ELGO_LIB)) - $(MAKE) build-debug -C $(basename $@) - -$(addsuffix .build-debug, $(SUBDIRS_BINS)): $(addsuffix .build-debug, $(MEASUREPP_LIB)) - $(MAKE) build-debug -C $(basename $@) - - - -$(addsuffix .build-release, $(STD_LIB)): - $(MAKE) build-release -C $(basename $@) - -$(addsuffix .build-release, $(COMMON_LIB)): $(addsuffix .build-release, $(STD_LIB)) - $(MAKE) build-release -C $(basename $@) - -$(addsuffix .build-release, $(DATA_LIB)): $(addsuffix .build-release, $(COMMON_LIB)) - $(MAKE) build-release -C $(basename $@) - -$(addsuffix .build-release, $(STR_LIB)): $(addsuffix .build-release, $(DATA_LIB)) - $(MAKE) build-release -C $(basename $@) - -$(addsuffix .build-release, $(RAW_LIB)): $(addsuffix .build-release, $(STR_LIB)) - $(MAKE) build-release -C $(basename $@) - -$(addsuffix .build-release, $(ALGO_LIB)): $(addsuffix .build-release, $(RAW_LIB)) - $(MAKE) build-release -C $(basename $@) - -$(addsuffix .build-release, $(ELGO_LIB)): $(addsuffix .build-release, $(ALGO_LIB)) - $(MAKE) build-release -C $(basename $@) - -$(addsuffix .build-release, $(MEASUREPP_LIB)): $(addsuffix .build-release, $(ELGO_LIB)) - $(MAKE) build-release -C $(basename $@) - -$(addsuffix .build-release, $(SUBDIRS_BINS)): $(addsuffix .build-release, $(MEASUREPP_LIB)) - $(MAKE) build-release -C $(basename $@) - - - -$(addsuffix .build-tests-debug, $(STD_LIB)): $(addsuffix .build-debug, $(STD_LIB)) - $(MAKE) build-tests-debug -C $(basename $@) - -$(addsuffix .build-tests-debug, $(COMMON_LIB)): $(addsuffix .build-tests-debug, $(STD_LIB)) $(addsuffix .build-debug, $(COMMON_LIB)) - $(MAKE) build-tests-debug -C $(basename $@) - -$(addsuffix .build-tests-debug, $(DATA_LIB)): $(addsuffix .build-tests-debug, $(COMMON_LIB)) $(addsuffix .build-debug, $(DATA_LIB)) - $(MAKE) build-tests-debug -C $(basename $@) - -$(addsuffix .build-tests-debug, $(STR_LIB)): $(addsuffix .build-tests-debug, $(DATA_LIB)) $(addsuffix .build-debug, $(STR_LIB)) - $(MAKE) build-tests-debug -C $(basename $@) - -$(addsuffix .build-tests-debug, $(RAW_LIB)): $(addsuffix .build-tests-debug, $(STR_LIB)) $(addsuffix .build-debug, $(RAW_LIB)) - $(MAKE) build-tests-debug -C $(basename $@) - -$(addsuffix .build-tests-debug, $(ALGO_LIB)): $(addsuffix .build-tests-debug, $(RAW_LIB)) $(addsuffix .build-debug, $(ALGO_LIB)) - $(MAKE) build-tests-debug -C $(basename $@) - -$(addsuffix .build-tests-debug, $(ELGO_LIB)): $(addsuffix .build-tests-debug, $(ALGO_LIB)) $(addsuffix .build-debug, $(ELGO_LIB)) - $(MAKE) build-tests-debug -C $(basename $@) - -$(addsuffix .build-tests-debug, $(MEASUREPP_LIB)): $(addsuffix .build-tests-debug, $(ELGO_LIB)) $(addsuffix .build-debug, $(MEASUREPP_LIB)) - $(MAKE) build-tests-debug -C $(basename $@) - - -$(addsuffix .build-tests-release, $(STD_LIB)): $(addsuffix .build-release, $(STD_LIB)) - $(MAKE) build-tests-release -C $(basename $@) - -$(addsuffix .build-tests-release, $(COMMON_LIB)): $(addsuffix .build-tests-release, $(STD_LIB)) $(addsuffix .build-release, $(COMMON_LIB)) - $(MAKE) build-tests-release -C $(basename $@) - -$(addsuffix .build-tests-release, $(DATA_LIB)): $(addsuffix .build-tests-release, $(COMMON_LIB)) $(addsuffix .build-release, $(DATA_LIB)) - $(MAKE) build-tests-release -C $(basename $@) - -$(addsuffix .build-tests-release, $(STR_LIB)): $(addsuffix .build-tests-release, $(COMMON_LIB)) $(addsuffix .build-release, $(STR_LIB)) - $(MAKE) build-tests-release -C $(basename $@) - -$(addsuffix .build-tests-release, $(RAW_LIB)): $(addsuffix .build-tests-release, $(STR_LIB)) $(addsuffix .build-release, $(RAW_LIB)) - $(MAKE) build-tests-release -C $(basename $@) - -$(addsuffix .build-tests-release, $(ALGO_LIB)): $(addsuffix .build-tests-release, $(RAW_LIB)) $(addsuffix .build-release, $(ALGO_LIB)) - $(MAKE) build-tests-release -C $(basename $@) - -$(addsuffix .build-tests-release, $(ELGO_LIB)): $(addsuffix .build-tests-release, $(ALGO_LIB)) $(addsuffix .build-release, $(ELGO_LIB)) - $(MAKE) build-tests-release -C $(basename $@) - -$(addsuffix .build-tests-release, $(MEASUREPP_LIB)): $(addsuffix .build-tests-release, $(ELGO_LIB)) $(addsuffix .build-release, $(MEASUREPP_LIB)) - $(MAKE) build-tests-release -C $(basename $@) - - - clean-debug: for dir in $(SUBDIRS_WITH_MAKE); do \ $(MAKE) clean-debug -C $$dir; \ @@ -348,8 +150,6 @@ clean-release: $(MAKE) clean-release -C $$dir; \ done - - doc: $(MAKE) doc -C alib2std $(MAKE) doc -C alib2data diff --git a/tniceprint/makefile b/tniceprint/makefile index 3d4b105138..dd28431218 100644 --- a/tniceprint/makefile +++ b/tniceprint/makefile @@ -22,7 +22,12 @@ OBJECTS_RELEASE:=$(patsubst src/%.cpp, obj-release/%.o, $(shell find src/ -name all: @echo "What to do master?" -obj%/makefile: makefile makefile.conf +FORCE: + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# make subdir makefile + +%/makefile: makefile makefile.conf if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ ln -s /tmp/`date +'%s%N'`-$(dir $@) $(subst /, , $(dir $@)) 2>/dev/null;\ fi;\ @@ -79,14 +84,8 @@ obj%/makefile: makefile makefile.conf $${NEW_LINE}\ -include \$$(DEPENDENCIES)" > $@ -debug: build-debug - -release: build-release - -clean: clean-debug clean-release - $(RM) -r doc - - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# final lib/bin construction bin-debug/$(EXECUTABLE): obj-debug/ $(OBJECTS_DEBUG) if [ ! -w $(dir $@) ] && [ $(USE_RAMDISK) -eq 1 ]; then\ @@ -110,26 +109,31 @@ bin-release/$(EXECUTABLE): obj-release/ $(OBJECTS_RELEASE) fi $(CXX) $(OBJECTS_RELEASE) -o $@ $(LDFLAGS_RELEASE) +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# subdir make calls - -obj-debug/: FORCE | obj-debug/makefile +obj-debug/: FORCE | obj-debug/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-debug) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-g -O0 -DDEBUG" obj-release/: FORCE | obj-release/makefile $(MAKE) -C $@ OBJECTS_BASE_DIR=$(realpath obj-release) SOURCES_BASE_DIR=$(realpath src) CXX_OTHER_FLAGS="-O3 -DNDEBUG -DRELEASE" - +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# objects dependencies $(OBJECTS_DEBUG): obj-debug/ $(OBJECTS_RELEASE): obj-release/ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# main targets -build-debug: bin-debug/$(EXECUTABLE) - -build-release: bin-release/$(EXECUTABLE) +debug: bin-debug/$(EXECUTABLE) +release: bin-release/$(EXECUTABLE) +clean: clean-debug clean-release + $(RM) -r doc clean-debug: if [ -L obj-debug ]; then\ @@ -149,12 +153,5 @@ clean-release: fi $(RM) -r *.o *.d bin-release obj-release - - -FORCE: - - - doc: doxygen - -- GitLab