-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
72 lines (46 loc) · 1.25 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
.DEFAULT_GOAL := alaska
MAKEFLAGS += --no-print-directory
ROOT=$(shell pwd)
export PATH:=$(ROOT)/local/bin:$(PATH)
export LD_LIBRARY_PATH:=$(ROOT)/local/lib:$(LD_LIBRARY_PATH)
CC=clang
CXX=clang++
export CC
export CXX
BUILD=build
BUILD_REQ=$(BUILD)/Makefile
$(BUILD)/Makefile:
@mkdir -p $(BUILD)
@cd $(BUILD) && cmake ../ -DCMAKE_INSTALL_PREFIX:PATH=$(ROOT)/local
alaska: $(BUILD_REQ)
@$(MAKE) -C $(BUILD) install
@cp build/compile_commands.json .
sanity: alaska
@local/bin/alaska -O3 test/sanity.c -o build/sanity
@build/sanity
test: alaska
@build/runtime/alaska_test
.PHONY: alaska all
# Run compilation unit tests to validate that the compiler can
# handle all the funky control flow in the GCC test suite
unit: alaska FORCE
tools/unittest.py
docs:
@doxygen Doxyfile
# Defer to CMake to clean itself, if the build folder exists
clean:
[ -d $(BUILD) ] && make -C $(BUILD) clean
rm -f .*.o*
mrproper:
rm -rf $(BUILD) .*.o*
docker:
docker build -t alaska .
docker run -it --rm alaska bash
deps: local/bin/gclang local/bin/clang
local/bin/gclang:
tools/build_gclang.sh
local/bin/clang:
tools/get_llvm.sh
redis: FORCE
nix develop --command bash -c "source enable && make -C test/redis"
FORCE: # anything you want to force, depend on this