From: Bernie Innocenti Date: Mon, 15 Nov 2021 07:39:47 +0000 (-0800) Subject: Add clang support X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=888f532312c70f907519e0f40f1311b93bdb7870;p=modules.git Add clang support --- 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