-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
44 lines (36 loc) · 1.07 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
_mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
I := $(patsubst %/,%,$(dir $(_mkfile_path)))
ifneq ($(words $(MAKECMDGOALS)),1)
.DEFAULT_GOAL = all
%:
@$(MAKE) $@ --no-print-directory -rRf $(firstword $(MAKEFILE_LIST))
else
ifndef ECHO
T := $(shell $(MAKE) $(MAKECMDGOALS) --no-print-directory \
-nrRf $(firstword $(MAKEFILE_LIST)) \
ECHO="COUNTTHIS" | grep -c "COUNTTHIS")
N := x
C = $(words $N)$(eval N := x $N)
ECHO = python3.11 $(I)/src/util/compiler_progress.py --stepno=$C --nsteps=$T
endif
# Copyright (c) 2020-2023, Fuechs and Contributors.
# All rights reserved.
src = $(wildcard src/*.cpp src/*/*.cpp src/*/*/*.cpp)
obj = $(src:.cpp=.o)
hdr = $(wildcard src/*.hpp src/*/*.hpp src/*/*/*.hpp)
out = fux
cflags = -g -O3 -std=c++20
ldflags = -g
llvmflags = `llvm-config --cxxflags --ldflags --system-libs --libs core`
all: $(src) $(obj) $(out)
$(out): $(obj)
@$(ECHO) Linking $@
# @clang++ $(llvmflags) $(ldflags) $^ -o $@
@clang++ $(ldflags) $^ -o $@
%.o: %.cpp $(hdr)
@$(ECHO) Compiling $<
@clang++ $(cflags) -c $< -o $@
clean:
@rm $(obj)
@echo Done.
endif