changed the way of building in Makefiles

This commit is contained in:
Tomasz Sowa 2021-05-17 03:20:51 +02:00
parent da6a36a205
commit fe82f63efb
2 changed files with 16 additions and 9 deletions

View File

@ -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:

View File

@ -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