diff --git a/Makefile b/Makefile index 70cc850..ff5b96b 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ export CXXFLAGS export AR -all: src tests +all: src src: FORCE @@ -13,9 +13,15 @@ src: FORCE tests: FORCE + $(MAKE) -C src $(MAKE) -C tests +tests-gcc10: FORCE + env CXX=g++10 CXXFLAGS="-Wl,-rpath=/usr/local/lib/gcc10/ -Wall -pedantic -O0 -g3 -std=c++20 -I../src -I/usr/local/include" $(MAKE) -C src + env CXX=g++10 CXXFLAGS="-Wl,-rpath=/usr/local/lib/gcc10/ -Wall -pedantic -O0 -g3 -std=c++20 -I../src -I/usr/local/include" $(MAKE) -C tests + + clean: FORCE $(MAKE) -C src clean $(MAKE) -C tests clean @@ -26,5 +32,7 @@ depend: FORCE $(MAKE) -C tests depend + + FORCE: diff --git a/tests/Makefile b/tests/Makefile index bd4e83f..6d6de49 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -11,27 +11,23 @@ CXXFLAGS = -Wall -pedantic -O2 -std=c++20 -I../src -I/usr/local/include endif - progname = tests +pikotoolslibfile = ../src/pikotools.a -all: $(progname) pikotools +all: $(progname) -$(progname): $(objfiles) pikotools - $(CXX) $(CXXFLAGS) -o $(progname) $(objfiles) ../src/pikotools.a +$(progname): $(objfiles) FORCE + $(CXX) $(CXXFLAGS) -o $(progname) $(objfiles) $(pikotoolslibfile) %.o: %.cpp $(CXX) -c $(CXXFLAGS) -o $@ $< -pikotools: FORCE - $(MAKE) -C ../src -FORCE: - clean: rm -f $(objfiles) @@ -42,5 +38,8 @@ depend: makedepend -Y. -I../src -f- $(sourcefiles) > Makefile.dep +FORCE: + + -include Makefile.dep