changed the way of building in Makefiles

pull/4/head
Tomasz Sowa 2 years ago
parent da6a36a205
commit fe82f63efb

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

@ -11,26 +11,22 @@ 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:
@ -42,5 +38,8 @@ depend:
makedepend -Y. -I../src -f- $(sourcefiles) > Makefile.dep
FORCE:
-include Makefile.dep

Loading…
Cancel
Save