Skip to content

Commit 7d6428f

Browse files
committed
Allow usage of user-specific compiler and linker flags
1 parent b50ced8 commit 7d6428f

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
all: testrunner simplecpp
22

3-
testrunner: test.cpp simplecpp.o
4-
$(CXX) -Wall -Wextra -pedantic -g -std=c++0x simplecpp.o test.cpp -o testrunner
3+
testrunner: test.o simplecpp.o
4+
$(CXX) $(LDFLAGS) simplecpp.o test.o -o testrunner
5+
6+
test.o: test.cpp
7+
$(CXX) $(CXXFLAGS) -Wall -Wextra -pedantic -g -std=c++0x -c test.cpp
58

69
simplecpp.o: simplecpp.cpp simplecpp.h
7-
$(CXX) -Wall -Wextra -pedantic -g -std=c++0x -c simplecpp.cpp
10+
$(CXX) $(CXXFLAGS) -Wall -Wextra -pedantic -g -std=c++0x -c simplecpp.cpp
811

912
test: testrunner simplecpp
1013
g++ -fsyntax-only simplecpp.cpp && ./testrunner && python run-tests.py
@@ -13,4 +16,4 @@ simplecpp: main.cpp simplecpp.o
1316
$(CXX) -Wall -g -std=c++0x main.cpp simplecpp.o -o simplecpp
1417

1518
clean:
16-
rm testrunner simplecpp simplecpp.o
19+
rm -f testrunner simplecpp *.o

0 commit comments

Comments
 (0)