-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (32 loc) · 874 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
libpath := $(shell bin/winsdk.exe --type:lib --arch:x64 --kit:um)
cflags += -Oz
cflags += -std=c11
cflags += -Wall
cflags += -Wextra
cflags += -Wno-gnu-empty-initializer
cflags += -pedantic
cflags += -nostdlib
cflags += -ffreestanding
cflags += -fno-stack-check
cflags += -fno-stack-protector
cflags += -mno-stack-arg-probe
cflags += -lkernel32
cflags += -Xlinker /align:16
cflags += -Xlinker /entry:start
cflags += -Xlinker /nodefaultlib
cflags += -Xlinker /subsystem:console
cflags += -Xlinker /libpath:"$(libpath)"
build: bin/smallist.exe bin/smallist32.exe sizes
-
bench: bin/smallist.exe bin/smallist32.exe
@$@
output: bin/smallist.exe
bin\smallist > $@.txt
bin/smallist.exe: smallist.c Makefile
clang $< $(cflags) -o $@
llvm-strip -s $@
bin/smallist32.exe: smallist.c Makefile
clang $< -m32 $(cflags) -o $@
llvm-strip -s $@
sizes:
dir /N bin\*list*.exe