blob: bc8e0ecaee3f442f98c1c6df44a5aa0274d3d1bb (
plain)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
OBJS = \
id.o \
sh.o \
ps.o \
ls.o \
pwd.o \
sleep.o \
date.o \
true.o \
false.o \
hostname.o \
cat.o \
uname.o \
clear.o \
tst.o \
mm.o
APPS = \
id \
sh \
ps \
ls \
pwd \
sleep \
date \
true \
false \
hostname \
cat \
uname \
clear \
tst \
mm
ARCH_FLAGS =
STANDARD_FLAGS = -std=c++17 -nostdinc++ -nostdlib
USERLAND_FLAGS = -ffreestanding -fno-stack-protector -fno-ident
WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings
FLAVOR_FLAGS = -march=i386 -mregparm=3 -m32 -fno-exceptions -fno-rtti -fmerge-all-constants -fno-unroll-loops -fno-pie -fno-pic
OPTIMIZATION_FLAGS = -Os -fno-asynchronous-unwind-tables
INCLUDE_FLAGS = -I.. -I.
DEFINES = -DSERENITY -DSANITIZE_PTRS -DUSERLAND
CXXFLAGS = $(WARNING_FLAGS) $(OPTIMIZATION_FLAGS) $(USERLAND_FLAGS) $(FLAVOR_FLAGS) $(ARCH_FLAGS) $(STANDARD_FLAGS) $(INCLUDE_FLAGS) $(DEFINES)
CXX = g++-8
LD = ld
AR = ar
LDFLAGS = -static --strip-debug -melf_i386 --build-id=none -z norelro -z now -e _start --gc-sections
all: $(OBJS) $(APPS)
id: id.o
$(LD) -o $@ $(LDFLAGS) $< ../LibC/LibC.a
sh: sh.o
$(LD) -o $@ $(LDFLAGS) $< ../LibC/LibC.a
ps: ps.o
$(LD) -o $@ $(LDFLAGS) $< ../LibC/LibC.a
ls: ls.o
$(LD) -o $@ $(LDFLAGS) $< ../LibC/LibC.a
pwd: pwd.o
$(LD) -o $@ $(LDFLAGS) $< ../LibC/LibC.a
sleep: sleep.o
$(LD) -o $@ $(LDFLAGS) $< ../LibC/LibC.a
date: date.o
$(LD) -o $@ $(LDFLAGS) $< ../LibC/LibC.a
true: true.o
$(LD) -o $@ $(LDFLAGS) $< ../LibC/LibC.a
false: false.o
$(LD) -o $@ $(LDFLAGS) $< ../LibC/LibC.a
hostname: hostname.o
$(LD) -o $@ $(LDFLAGS) $< ../LibC/LibC.a
cat: cat.o
$(LD) -o $@ $(LDFLAGS) $< ../LibC/LibC.a
uname: uname.o
$(LD) -o $@ $(LDFLAGS) $< ../LibC/LibC.a
clear: clear.o
$(LD) -o $@ $(LDFLAGS) $< ../LibC/LibC.a
tst: tst.o
$(LD) -o $@ $(LDFLAGS) $< ../LibC/LibC.a
mm: mm.o
$(LD) -o $@ $(LDFLAGS) $< ../LibC/LibC.a
.cpp.o:
@echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<
clean:
@echo "CLEAN"; rm -f $(LIBRARY) $(OBJS)
|