aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 505778f9130073449da4e6c0871f579159c1bcaf (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
44
45
46
47
48
49
50
CFLAGS = -Wall -Wextra -Werror -g3 -std=c89 -pedantic -fPIE -DDEBUG
#CFLAGS = -O3 -flto -static -s
LIBS = -lgc
OBJ = build/main.o build/tokenizer.o build/parser.o build/program.o build/bytecode.o build/value.o build/command.o build/buffer.o build/hash_map.o build/list.o
CC = cc

build: build_dir $(OBJ)
	$(CC) -o build/tsl $(OBJ) $(LIBS)

clean:
	rm $(OBJ) build/tsl

build_dir:
	mkdir -p build

compiledb:
	make clean; bear make

install: build
	install -Dm755 build/tsl /usr/local/bin/tsl

build/main.o: src/main.c include/tokenizer.h
	$(CC) -c src/main.c -o build/main.o $(CFLAGS)

build/tokenizer.o: src/tokenizer.c include/tokenizer.h
	$(CC) -c src/tokenizer.c -o build/tokenizer.o $(CFLAGS)

build/parser.o: src/parser.c include/parser.h
	$(CC) -c src/parser.c -o build/parser.o $(CFLAGS)

build/program.o: src/program.c include/program.h
	$(CC) -c src/program.c -o build/program.o $(CFLAGS)

build/bytecode.o: src/bytecode.c include/bytecode.h
	$(CC) -c src/bytecode.c -o build/bytecode.o $(CFLAGS)

build/value.o: src/value.c include/value.h
	$(CC) -c src/value.c -o build/value.o $(CFLAGS)

build/command.o: src/command.c include/command.h
	$(CC) -c src/command.c -o build/command.o $(CFLAGS)

build/buffer.o: src/std/buffer.c include/std/buffer.h
	$(CC) -c src/std/buffer.c -o build/buffer.o $(CFLAGS)

build/hash_map.o: src/std_gc/hash_map.c include/std_gc/hash_map.h
	$(CC) -c src/std_gc/hash_map.c -o build/hash_map.o $(CFLAGS)

build/list.o: src/std_gc/list.c include/std_gc/list.h
	$(CC) -c src/std_gc/list.c -o build/list.o $(CFLAGS)