-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (32 loc) · 1.39 KB
/
Makefile
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
# GROUP 48
# PUNEET ANAND 2016B4A70487P
# MAYANK JASORIA 2016B1A70703P
# SHUBHAM TIWARI 2016B4A70945P
# VIBHAV OSWAL 2016B4A70594P
# -- Detect OS for AST compilation --
ifeq ($(OS),Windows_NT)
# Windows
DS=data_structures\pass1.c data_structures\st.c data_structures\stack.c data_structures\linked_list.c data_structures\n_ary_tree.c data_structures\ast.c data_structures\hash_map.c data_structures\queue.c
else
# Linux
DS=data_structures/pass1.c data_structures/st.c data_structures/stack.c data_structures/linked_list.c data_structures/n_ary_tree.c data_structures/ast.c data_structures/hash_map.c data_structures/queue.c
GDB_AUTO=gdb --batch --command=debug.gdb --args ./ast
endif
#-----------------------------------
# set the compiler
CC=gcc
# set compiler flags
CFLAGS=-g -o
#set dependencies for the program
DEPS_PROG=driver.c codeGen.c parser.c lexer.c utils/utils.c data_structures/pass1.c data_structures/pass2.c data_structures/st.c data_structures/stack.c data_structures/linked_list.c data_structures/n_ary_tree.c data_structures/ast.c data_structures/hash_map.c data_structures/queue.c
#set executable name
OUT_NAME=compiler
driver: $(DEPS_PROG)
$(CC) $(CFLAGS) $(OUT_NAME) $(DEPS_PROG)
ast_debug: ast_test.c
$(CC) $(CFLAGS) ast ast_test.c parser.c lexer.c $(DS)
$(GDB_AUTO)
clean:
rm -rf *.o
cleanAll:
rm -rf *.o *.out *.exe *.asm ${OUT_NAME}