-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (21 loc) · 680 Bytes
/
Makefile
File metadata and controls
28 lines (21 loc) · 680 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
CFLAGS=-std=c99 -g -static -pedantic-errors -Wall -Wno-switch -fstrict-aliasing
INCS=-I .
SRCS=$(wildcard *.c)
OBJS=$(SRCS:.c=.o)
TEST_SRCS=$(wildcard tests/*.c)
TESTS=$(TEST_SRCS:.c=.test)
all: cimple
tests/%.test: cimple tests/%.c
$(CC) -o- -E -P -C tests/$*.c | ./cimple -o tests/$*.s -
$(CC) -o $@ tests/$*.s -xc tests/common
test: $(TESTS)
for i in $^; do echo $$i; ./$$i || exit 1; echo; done
tests/driver.sh
%.o : %.c Makefile
$(CC) $(CFLAGS) $(INCS) -c $< -o $@
cimple: $(OBJS)
$(CC) $(CFLAGS) $(INCS) $(OBJS) -o $@
clean:
rm -rf cimple tmp* $(TESTS) tests/*.s tests/*.test
find * -type f '(' -name '*~' -o -name '*.o' ')' -exec rm {} ';'
.PHONY: test clean