-
Notifications
You must be signed in to change notification settings - Fork 75
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (48 loc) · 1.66 KB
/
Copy pathMakefile
File metadata and controls
59 lines (48 loc) · 1.66 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
50
51
52
53
54
55
56
57
58
59
C_COMPILER ?= gcc
BUILD_TYPE ?= Release
INSTALL_PREFIX ?= /usr/local
CFLAGS ?= '-Wextra -Wall -Wpedantic'
default: all
.PHONY: all
# To add sqlite3 support add -DHCC_LINK_SQLITE3=1 to the below like so:
#```
#all:
# cmake -S ./src -B ./build -G 'Unix Makefiles' \
# -DCMAKE_C_COMPILER=$(_C_COMPILER) \
# -DCMAKE_BUILD_TYPE=$(_BUILD_TYPE) \
# -DHCC_LINK_SQLITE3=1 \
# && $(MAKE) -C ./build -j2
#```
all:
cmake -S ./src \
-B ./build \
-G 'Unix Makefiles' \
-DCMAKE_C_COMPILER=$(C_COMPILER) \
-DCMAKE_BUILD_TYPE=$(BUILD_TYPE) \
-DCMAKE_INSTALL_PREFIX=$(INSTALL_PREFIX) \
-DCMAKE_C_FLAGS=$(CFLAGS) \
-DCMAKE_EXPORT_COMPILE_COMMANDS=on \
-DHCC_ENABLE_JIT=on \
&& $(MAKE) -C ./build -j2
install:
$(MAKE) -C ./build install
release-unit-test:
$(MAKE) -C ./build unit-test
unit-test:
cd ./src/tests && ../../hcc ./run.HC -o test-runner && ./test-runner && cd ../../
jit-unit-test:
cd ./src/tests && ../../hcc ./run_jit.HC -o test-runner-jit && ./test-runner-jit && cd ../../
# Hermetic: builds libtos from the tree into a local prefix and
# compiles the (HolyC) harness against it, so the suite tests in-tree
# sources - never whatever happens to be installed in /usr/local.
lsp-test:
mkdir -p ./build/test-prefix/include ./build/test-prefix/lib
cp ./src/holyc-lib/tos.HH ./build/test-prefix/include/tos.HH
cd ./src/holyc-lib && ../../hcc -lib tos --install-dir=$(CURDIR)/build/test-prefix ./all.HC
cd ./src/tests/lsp && ../../../hcc --install-dir=$(CURDIR)/build/test-prefix ./run_lsp_tests.HC -o lsp-test-runner && ./lsp-test-runner
lib-tos:
cd ./src/holyc-lib \
&& ../../hcc -lib tos ./all.HC \
&& cd ../../
clean:
rm -rf ./build ./hcc