projects
/
modules.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ebb90e0
)
Add clang support
author
Bernie Innocenti
<bernie@codewiz.org>
Mon, 15 Nov 2021 07:39:47 +0000
(23:39 -0800)
committer
Bernie Innocenti
<bernie@codewiz.org>
Mon, 15 Nov 2021 07:39:47 +0000
(23:39 -0800)
Makefile
patch
|
blob
|
history
diff --git
a/Makefile
b/Makefile
index baae7834099e0ca513b835b506088558b8bababf..764d97e4a9542ea415ac7d5ad212a1a771aafdfa 100644
(file)
--- 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:
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.o: helloworld.cc
+
+helloworld.pcm: helloworld.cc
+ $(CXX) $(CXXFLAGS) -Xclang -emit-module-interface -c helloworld.cc -o helloworld.pcm