forked from cksystemsteaching/selfie
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
42 lines (36 loc) · 1.23 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
42
# Compiler flags
CFLAGS := -w -O3 -m32 -D'main(a,b)=main(a,char**argv)'
# Compile selfie.c into selfie executable
selfie: selfie.c
$(CC) $(CFLAGS) $< -o $@
# Consider these targets as targets, not files
.PHONY : test sat all clean
# Test self-compilation, self-execution, and self-hosting
test: selfie
./selfie -c selfie.c -o selfie1.m -s selfie1.s -m 2 -c selfie.c -o selfie2.m -s selfie2.s
diff -q selfie1.m selfie2.m
diff -q selfie1.s selfie2.s
./selfie -c selfie.c -o selfie.m -m 2 -l selfie.m -m 1
./selfie -c selfie.c -o selfie3.m -s selfie3.s -y 3 -l selfie3.m -y 2 -l selfie3.m -y 2 -c selfie.c -o selfie4.m -s selfie4.s
diff -q selfie3.m selfie4.m
diff -q selfie3.s selfie4.s
diff -q selfie1.m selfie3.m
diff -q selfie1.s selfie3.s
./selfie -c selfie.c -o selfie5.m -s selfie5.s -min 4 -l selfie5.m -y 2 -l selfie5.m -y 2 -c selfie.c -o selfie6.m -s selfie6.s
diff -q selfie5.m selfie6.m
diff -q selfie5.s selfie6.s
diff -q selfie3.m selfie5.m
diff -q selfie3.s selfie5.s
./selfie -c -mob 1
# Test SAT solver
sat: selfie
./selfie -sat manuscript/cnfs/rivest.cnf
./selfie -c selfie.c -m 1 -sat manuscript/cnfs/rivest.cnf
# Test everything
all: test sat
# Clean up
clean:
rm -rf *.m
rm -rf *.s
rm -rf selfie
rm -rf selfie.exe