-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (35 loc) · 1.68 KB
/
Makefile
File metadata and controls
49 lines (35 loc) · 1.68 KB
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
45
46
47
48
49
CXX = g++
CXXFLAGS = -Iinclude `llvm-config --system-libs --cppflags --ldflags --libs core` -std=c++23 -lboost_program_options -Wall -Wextra -Wpedantic -g
OBJS = analyzer.o codegen.o diagnostic.o ir.o levenshtein.o lexer.o main.o out_fmt.o parser.o resolver.o resolver/desugar.o resolver/identify.o resolver/lower.o resolver/symbols.o resolver/types.o resolver/types/bound_equality.o resolver/types/can_unify.o resolver/types/constrain.o resolver/types/copy.o resolver/types/decide_remaining.o resolver/types/decision.o resolver/types/infer.o resolver/types/instantiate.o resolver/types/specialization.o resolver/types/traits.o resolver/types/type_info.o resolver/types/type_name.o resolver/types/unify.o test.o token.o ast/expression.o ast/function.o ast/identifier.o ast/module.o ast/statement.o ast/struct.o ast/tag.o ast/trait.o ast/type.o
BUILD_DIR := build
SRC_DIR := src
OBJS := $(addprefix $(BUILD_DIR)/,$(OBJS))
SRCS := $(OBJS:$(BUILD_DIR)/%.o=$(SRC_DIR)/%.cpp)
./chc: $(OBJS)
$(CXX) $(CXXFLAGS) $^ -o ./chc
.PHONY: build
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp
@mkdir -p $(dir $@)
$(CXX) -c $(CXXFLAGS) -MMD -MP $< -o $@
.PHONY: clean cleanall build run test tidy cleancallgrind callgrind
clean:
rm -rf $(BUILD_DIR) chc
cleanall:
rm -rf $(BUILD_DIR) chc compile_commands.json
build: ./chc
run: ./chc
./chc my_module
gcc -o main output.o my_module_print_integer.c
./main
test: ./chc
./chc --run-compiler-tests
compile_commands.json:
make cleanall
bear -- make -j4
tidy: compile_commands.json
clang-tidy -header-filter=.* $(SRCS)
cleancallgrind:
rm -f vgcore.* callgrind.*
callgrind: ./chc cleancallgrind
valgrind --dump-instr=yes --tool=callgrind ./chc my_module
-include $(OBJS:.o=.d)