-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (37 loc) · 915 Bytes
/
Makefile
File metadata and controls
53 lines (37 loc) · 915 Bytes
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
CC=gcc
CFLAGS=
SRC= ./utils/toml/tomlc17.c ./src/mem_dbg/mem_dbg.c ./utils/macro.c ./src/helpers/strbuf.c
OBJ=$(SRC:%.c=%.o)
DEP=$(OBJ:%.o=%.d)
EXE=./utils/utils.exe
TARGET=/usr/local
DLLSRC= ./src/lexer/lexer.c ./src/lexer/tokens.c ./src/helpers/helpers.c ./src/helpers/strbuf.c ./src/mem_dbg/mem_dbg.c
DLLOBJ= $(DLLSRC:%.c=%.o)
THEDLL= /usr/lib/liblexer.so
macro: debug
./utils/utils.exe verbose
aldl:
rm -f $(THEDLL)
sudo make dll
dll: $(DLLOBJ)
dll: DLL
.NOTPARALLEL: dll
DLL: $(THEDLL)
$(THEDLL): $(DLLOBJ)
$(CC) -shared -o $(THEDLL) $^ -I ./include
debug: CFLAGS += -g
debug: $(EXE)
remake: clean debug
.NOTPARALLEL: remake
release: CFLAGS += -O3 -DNDEBUG
release: clean $(EXE)
.NOTPARALLEL: release
clean:
rm -f $(OBJ) $(DEP)
install: all
cp $(EXE) $(TARGET)/bin
$(EXE): $(OBJ)
$(CC) -o $@ $^ -Ltomlc17 -Lhelpers
-include $(DEP)
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $< -I ./include