-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
42 lines (34 loc) · 884 Bytes
/
makefile
File metadata and controls
42 lines (34 loc) · 884 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
#
# Tiny C Preprocessor
# Copyright (c) 2025 mzuhi5
#
SHELL=/bin/bash
prep: prep.c
gcc -o $@ -fno-builtin -fno-gnu-unique -O0 -g -Wall $^
prep_self: prep_self.c
gcc -o $@ -fno-builtin -fno-gnu-unique -O0 -g -Wall $^
prep_self.c: prep
./prep prep.c > $@
test: prep
@LIST=`ls test/*.h`; \
for file in $$LIST ;\
do \
diff -w -B <(gcc -E -P $$file) <(./prep $$file) ; \
if [[ $$? -eq 0 ]] then \
echo "PASS: $$file"; \
else \
echo "FAIL: $$file"; \
fi \
done
test_self: prep_self
@echo "checking diff between prep_self.c and output from prep_self."; \
./prep_self prep.c > prep_self_test.c; \
diff -w -B prep_self.c prep_self_test.c > /dev/null; \
if [[ $$? -eq 0 ]] then \
echo "PASS"; \
else \
echo "FAIL"; \
fi
clean:
rm -f prep prep_self a.out prep_self.c prep_self_test.c
.PHONY: clean test test_self