From 0ba6606eecb39929a628cb254e8bf5283e811c26 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Mon, 13 Jan 2020 21:06:05 +0100 Subject: First commit --- Makefile | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..af47b09 --- /dev/null +++ b/Makefile @@ -0,0 +1,77 @@ +PROJECTNAME=minicc + +CXX=clang++-8 +#CXX=g++-8 + +#CXXFLAGS=-O0 -D_DEBUG +# -fprofile-instr-generate -fcoverage-mapping +# gcc:--coverage +CXXFLAGS=-O2 -DNDEBUG + +CXXFLAGS+= -Wall -std=c++17 -I. -Ilib + +ifeq ($(CXX),clang++-8) +# currently broken: +# ld.lld-8: error: undefined symbol: boost::re_detail_106700::cpp_regex_traits_implementation::transform(char const*, char const*) const +#CXXFLAGS+= -stdlib=libc++ +endif + +CXXTESTFLAGS=-Igoogletest/include -Igooglemock/include/ -Igoogletest -Igooglemock + +LIBS=\ +-lboost_context \ +-lboost_coroutine \ +-lboost_program_options \ +-lboost_system \ +-lboost_thread \ +-lboost_filesystem \ +-lboost_regex \ +-lpthread + +ifeq ($(CXX),clang++-8) +LIBS+= \ +-fuse-ld=lld-8 \ +-lstdc++ \ +-lstdc++fs +#-lc++ \ +#-lc++abi \ +#-lc++fs +else +LIBS+= \ +-lstdc++ \ +-lstdc++fs +endif + +SRC=\ + minicc.cpp \ + googletest/src/gtest-all.cpp \ + googlemock/src/gmock-all.cpp + +all: test-$(PROJECTNAME) + ./test-$(PROJECTNAME) + +# testsuite ---------------------------------------------- +test-$(PROJECTNAME): $(SRC:.cpp=.o) + $(CXX) $(CXXFLAGS) $^ $(LIBS) -o $@ + +%.o: %.cpp + $(CXX) $(CXXFLAGS) $(CXXTESTFLAGS) -c $< -o $@ + +googletest/src/%.o: googletest/src/%.cc + $(CXX) $(CXXFLAGS) $(CXXTESTFLAGS) -c $< -o $@ + +# dependencies + +ADD_DEP=Makefile + +# misc --------------------------------------------------- +clean: + -rm -f test-$(PROJECTNAME) + -find . -name '*.o' -o -name '*.d' -o -name '*.gcno' -o -name '*.gcda' | xargs rm + +zip: clean + -rm -f ../$(PROJECTNAME).zip + zip -r ../$(PROJECTNAME).zip * + ls -l ../$(PROJECTNAME).zip + +.PHONY: clean all zip -- cgit v1.2.3