From 888f532312c70f907519e0f40f1311b93bdb7870 Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Sun, 14 Nov 2021 23:39:47 -0800 Subject: [PATCH] Add clang support --- Makefile | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index baae783..764d97e 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,25 @@ -CXXFLAGS = -fmodules-ts -std=c++20 -CC = g++ +#CXXFLAGS = -fmodules-ts -std=c++20 +#CXX = g++ -main: main.o helloworld.o +CXX = clang++ +CXXFLAGS = -std=c++20 -fimplicit-modules -fprebuilt-module-path=. -fmodules-cache-path=foo + +APP = hellomodules +OBJS = main.o helloworld.o +MODS = helloworld.pcm + +all: $(APP) clean: - rm main *.o + rm -f $(APP) + rm -f $(OBJS) + rm -f $(MODS) -main.o: main.cc +$(APP): $(OBJS) + $(CXX) $(CXXFLAGS) -o $@ $? + +main.o: main.cc $(MODS) helloworld.o: helloworld.cc + +helloworld.pcm: helloworld.cc + $(CXX) $(CXXFLAGS) -Xclang -emit-module-interface -c helloworld.cc -o helloworld.pcm -- 2.25.1