-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmakefile
22 lines (18 loc) · 837 Bytes
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
CC = gcc
CFLAGS-DEBUG = -g -DDEBUG -lm -Wall -I lexicalParser/include -I cli -I compiler -I objectAndClass/include -I utils -I vm -I gc -W -Wstrict-prototypes -Wmissing-prototypes -Wsystem-headers
CFLAGS-NORMAL = -g -lm -Wall -I lexicalParser/include -I cli -I compiler -I objectAndClass/include -I utils -I vm -I gc -W -Wstrict-prototypes -Wmissing-prototypes -Wsystem-headers
TARGET = stove
DIRS = lexicalParser/include cli objectAndClass/include utils vm compiler gc
CFILES = $(foreach dir,$(DIRS),$(wildcard $(dir)/*.c))
OBJS = $(patsubst %.c,%.o,$(CFILES))
d: CFLAGS = $(CFLAGS-DEBUG)
d: $(OBJS)
$(CC) -o $(TARGET) $(OBJS) $(CFLAGS-DEBUG)
n: CFLAGS = $(CFLAGS-NORMAL)
n: $(OBJS)
$(CC) -o $(TARGET) $(OBJS) $(CFLAGS)
clean:
-del $(TARGET) $(OBJS)
-for %%d in ($(DIRS)) do (del /Q /S "%%d\*.o")
-del $(TARGET).exe
r: clean n