summaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2024-07-09 18:58:56 +0200
committerRoland Reichwein <mail@reichwein.it>2024-07-09 18:58:56 +0200
commitf8c4fe1614cc79df9f97c8a7754cf2a5aaf5063d (patch)
treea5912910fc40b408c05172d438cd0d53192b2211 /Makefile
parentc156b07da6e8550f989919c3a015acdedfe8664f (diff)
Use libreichwein, and googletest from Debian
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile30
1 files changed, 15 insertions, 15 deletions
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