blob: 9775895dd459814eb2ad1317f91b72505e496c00 (
plain)
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
|
MUSL_LIB ?= /usr/lib/musl
MUSL_DEV ?= /usr/include/musl
DEFINES ?= -DMUSL_LIB=\"$(MUSL_LIB)\" -DMUSL_DEV=\"$(MUSL_DEV)\"
CFLAGS ?= -std=c99 -Wall -Werror -static -g -O0 $(DEFINES)
.DEFAULT_GOAL := all
BOOTSTRAP_SOURCES = boot/catboot.c boot/common.c boot/lex.c boot/tree.c boot/visit.c boot/parse.c boot/build.c
BOOTSTRAP_TEST_SOURCES = boot/tests/test.c
SOURCES = src/catskill.csk
build/catskill: build $(SOURCES)
echo "No catskill compiler exists yet. Building empty file."
touch ./build/catskill
build/catboot: build $(BOOTSTRAP_SOURCES)
$(CC) $(CFLAGS) -o ./build/catboot ./boot/catboot.c
build/catboot-test: build $(BOOTSTRAP_TEST_SOURCES)
$(CC) $(CFLAGS) -o ./build/catboot-test ./boot/tests/test.c
build:
mkdir -p ./build
.PHONY: all run run-boot clean test test-all
all: build/catskill build/catboot build/catboot-test
run: build/catskill
echo "Not implemented yet."
run-boot: build/catboot
./build/catboot $(ARGS)
test: build/catboot-test
./build/catboot-test $(ARGS)
test-all: build/catboot-test
./build/catboot-test all
clean:
rm -rf build/*
|