-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (31 loc) · 754 Bytes
/
Copy pathMakefile
File metadata and controls
43 lines (31 loc) · 754 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
# 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
TESTS := tests/test_variable.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 clean
ci: ${OBJS} ${HDRS}
${CC} ${CC_FLAGS} -o $@ ${OBJS}
test: ci
chmod +x driver.sh
./driver.sh ${TESTS}
clean:
${RM} *.o *.so