forked from CS429-S2022/CI-Lab-Student
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (39 loc) · 1006 Bytes
/
Copy pathMakefile
File metadata and controls
53 lines (39 loc) · 1006 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
# Definitions
CC = gcc
CC_FLAGS = -fomit-frame-pointer -fno-asynchronous-unwind-tables -ggdb -Wall -Werror
CC_OPTIONS = -c
CC_SO_OPTIONS = -shared -fpic
CC_DL_OPTIONS = -rdynamic
OD = objdump
OD_FLAGS = -d -h -r -s -S -t
RM = /bin/rm -f
LD = gcc
LIBS = -ldl
SRCS := ci.c handle_args.c interface.c lex.c parse.c eval.c print.c err_handler.c variable.c
OBJS := $(SRCS:%.c=%.o)
HDRS := ci.h node.h
TEST_WEEK_1 := tests/test_week1.txt
TEST_WEEK_2 := tests/test_week2.txt
TEST_WEEK_3 := tests/test_week3.txt
# Generic rules
%.i: %.c
${CC} ${CC_OPTIONS} -E ${CC_FLAGS} $<
%.s: %.c
${CC} ${CC_OPTIONS} -S ${CC_FLAGS} $<
%.o: %.c
${CC} ${CC_OPTIONS} ${CC_FLAGS} $<
# Targets
all: ci test_week1 test_week2 test_week3 clean
ci: ${OBJS} ${HDRS}
${CC} ${CC_FLAGS} -o $@ ${OBJS}
test_week1: ci
chmod +x driver.sh
./driver.sh ${TEST_WEEK_1}
test_week2: ci
chmod +x driver.sh
./driver.sh ${TEST_WEEK_2}
test_week3: ci
chmod +x driver.sh
./driver.sh ${TEST_WEEK_3}
clean:
${RM} *.o *.so _output*