From f8c4fe1614cc79df9f97c8a7754cf2a5aaf5063d Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Tue, 9 Jul 2024 18:58:56 +0200 Subject: Use libreichwein, and googletest from Debian --- Makefile | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index ee38b53..c2e42ff 100644 --- a/Makefile +++ b/Makefile @@ -15,12 +15,14 @@ CXXFLAGS+= -Wall -I. -std=c++20 CXXFLAGS+= -fPIE -DVERSION=\"$(VERSION)\" ifeq ($(CXX),clang++) -CXXFLAGS+=-stdlib=libc++ +#CXXFLAGS+=-stdlib=libc++ endif -CXXTESTFLAGS+=-Igoogletest/include -Igooglemock/include/ -Igoogletest -Igooglemock +CXXTESTFLAGS+=-I/usr/src/googletest/googletest/include -I/usr/src/googletest/googlemock/include/ -I/usr/src/googletest/googletest -I/usr/src/googletest/googlemock LIBS=\ +-lreichwein \ +-lfmt \ -lboost_context \ -lboost_coroutine \ -lboost_program_options \ @@ -32,9 +34,9 @@ LIBS=\ ifeq ($(CXX),clang++) LIBS+= \ --fuse-ld=lld-11 \ --lc++ \ --lc++abi +-fuse-ld=lld-14 \ +#-lc++ \ +#-lc++abi #-lc++fs #-lstdc++ \ #-lstdc++fs @@ -96,11 +98,9 @@ PROGSRC=\ flowgraph/node.cpp \ flowgraph/scope.cpp \ flowgraph/storage.cpp \ - file.cpp \ grammer.cpp \ lexer.cpp \ - minicc.cpp \ - programopts.cpp + minicc.cpp TESTSRC=\ tests/test-asm.cpp \ @@ -110,9 +110,6 @@ TESTSRC=\ tests/test-flowgraph.cpp \ tests/test-grammer.cpp \ tests/test-lexer.cpp \ - tests/test-minicc.cpp \ - googlemock/src/gmock-all.cpp \ - googletest/src/gtest-all.cpp \ $(PROGSRC) SRC=$(PROGSRC) mcc.cpp @@ -136,8 +133,8 @@ systemtest: mcc runtest --srcdir systemtest --tool mcc # --all # testsuite ---------------------------------------------- -test-$(PROJECTNAME): dep $(TESTSRC:.cpp=.o) - $(CXX) $(CXXFLAGS) $(TESTSRC:.cpp=.o) $(LIBS) -o $@ +test-$(PROJECTNAME): dep $(TESTSRC:.cpp=.o) libgmock.a + $(CXX) $(CXXFLAGS) libgmock.a $(TESTSRC:.cpp=.o) $(LIBS) -o $@ mcc: dep $(SRC:.cpp=.o) $(CXX) $(CXXFLAGS) $(SRC:.cpp=.o) $(LIBS) -o $@ @@ -150,8 +147,11 @@ dep: $(TESTSRC:.cpp=.d) mcc.d %.o: %.cpp %.d $(CXX) $(CXXFLAGS) $(CXXTESTFLAGS) -c $< -o $@ -googletest/src/%.o: googletest/src/%.cc - $(CXX) $(CXXFLAGS) $(CXXTESTFLAGS) -c $< -o $@ +libgmock.a: + $(CXX) $(CXXFLAGS) $(CXXTESTFLAGS) -c /usr/src/googletest/googletest/src/gtest-all.cc + $(CXX) $(CXXFLAGS) $(CXXTESTFLAGS) -c /usr/src/googletest/googlemock/src/gmock-all.cc + $(CXX) $(CXXFLAGS) $(CXXTESTFLAGS) -c /usr/src/googletest/googlemock/src/gmock_main.cc + ar -rv libgmock.a gmock-all.o gtest-all.o gmock_main.o # dependencies -- cgit v1.2.3