diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-03-29 16:28:34 +0200 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-03-29 16:28:34 +0200 |
commit | b0cac4997b5767526b29187fecf2a87aa1b0ebef (patch) | |
tree | 4f98d43cb2a03d87e17cf35240911a2fc6ae2474 /Makefile | |
parent | b7e53bf9d091874d8028b37f6e4940b504cc9234 (diff) |
Add CLI
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 30 |
1 files changed, 19 insertions, 11 deletions
@@ -42,32 +42,40 @@ LIBS+= \ -lstdc++fs endif -SRC=\ +PROGSRC=\ bnf.cpp \ cpp.cpp \ - test-cpp.cpp \ cppbnf.cpp \ - test-cppbnf.cpp \ grammer.cpp \ - test-grammer.cpp \ lexer.cpp \ - test-lexer.cpp \ minicc.cpp \ - test-minicc.cpp \ elf.cpp \ - test-elf.cpp \ file.cpp \ + +TESTSRC=\ + test-cpp.cpp \ + test-cppbnf.cpp \ + test-grammer.cpp \ + test-lexer.cpp \ + test-minicc.cpp \ + test-elf.cpp \ googletest/src/gtest-all.cpp \ - googlemock/src/gmock-all.cpp + googlemock/src/gmock-all.cpp \ + $(PROGSRC) + +SRC=$(PROGSRC) mcc.cpp -all: test-$(PROJECTNAME) +all: test-$(PROJECTNAME) mcc ./test-$(PROJECTNAME) # testsuite ---------------------------------------------- -test-$(PROJECTNAME): $(SRC:.cpp=.o) +test-$(PROJECTNAME): $(TESTSRC:.cpp=.o) + $(CXX) $(CXXFLAGS) $^ $(LIBS) -o $@ + +mcc: $(SRC:.cpp=.o) $(CXX) $(CXXFLAGS) $^ $(LIBS) -o $@ -dep: $(SRC:.cpp=.d) +dep: $(TESTSRC:.cpp=.d) mcc.d %.d: %.cpp $(CXX) $(CXXFLAGS) $(CXXTESTFLAGS) -MM -MP -MF $@ -c $< |