-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakefile
57 lines (47 loc) · 940 Bytes
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
W=-fno-common -fno-asynchronous-unwind-tables -fno-stack-protector
O=t
S=t.c
A=`uname -ms`
F=-DPF
L=clang
G=gcc
T=tcc
all: c l
m: c
@$G -Os $W -DPF -Werror -pedantic -nostdlib -ffreestanding -om m.c s.S
@echo
@strip m
@ls -la m
@./m
#tcc
t:
@$T $F -w -o$O $S -O0 -g && ./$O
t32:
@$T $F -m32 -w -o$O $S -Os && ./$O
t64:
@$T $F -m64 -DNOLC -nostdlib -w -o$O $S s.S -Os && ./$O
#gcc
g:
@$G $F $W -o$O $S -O0 -g && ./$O
g32:
@$G $F -m32 $W -o$O $S -Os && ./$O
g64:
@$G $F -m64 -DNOLC $W -nostdlib -ffreestanding -o$O $S s.S -Os && ./$O
#clang
l:
@$L $F -o$O $W $S -O0 -g && ./$O
l32:
@$L $F -m32 -o$O $W $S -Os && ./$O
l64:
@$L $F -m64 -DNOLC -nostdlib -ffreestanding -o$O $S s.S -Os -g && ./$O
#lib
s64:
@$L $F -DLIB -Wno-pointer-sign $W -shared -fPIC -nostdlib -rdynamic $S -Os -o lib$O.so
#local printf(f)
r:
@$G -Wno-format $F -o$O $S -Os -DNOPF && ./$O # should segv
#clean
c:
@rm -f m t l pf
.PHONY: c all
#/:~