aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 399128b427bb7c00ee52b59624a87b1c7cef4698 (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
CFLAGS = -Wall -Wextra -g3 -ansi -pedantic -fPIE
LIBS = -Wl,-Bdynamic -lcurl
OBJ = build/main.o build/tokenizer.o build/parser.o build/bytecode.o build/buffer.o build/hash_map.o
CC = cc

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

clean:
	rm $(OBJ) build/tsl

build_dir:
	mkdir -p build

compiledb:
	make clean; bear make

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/bytecode.o: src/bytecode.c include/bytecode.h
	$(CC) -c src/bytecode.c -o build/bytecode.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/hash_map.c include/std/hash_map.h
	$(CC) -c src/std/hash_map.c -o build/hash_map.o $(CFLAGS)