From b0cac4997b5767526b29187fecf2a87aa1b0ebef Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sun, 29 Mar 2020 16:28:34 +0200 Subject: Add CLI --- Makefile | 30 +++++++++++++++++++----------- mcc.cpp | 6 ++++++ 2 files changed, 25 insertions(+), 11 deletions(-) create mode 100644 mcc.cpp diff --git a/Makefile b/Makefile index 4a693c8..e338d84 100644 --- a/Makefile +++ b/Makefile @@ -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 $< diff --git a/mcc.cpp b/mcc.cpp new file mode 100644 index 0000000..da2a981 --- /dev/null +++ b/mcc.cpp @@ -0,0 +1,6 @@ +// CLI + +int main(int argc, char* argv[]) +{ + return 0; +} -- cgit v1.2.3