-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
115 lines (80 loc) · 2.43 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
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
104
105
106
107
108
109
110
111
112
113
114
115
# TODO: UBAH STRUKTUR FILE INI
# =====
# pengaturan untuk compiler - g++
# =====
CPP=g++
CPPFLAGS=-Wall
# =====
# perintah untuk os
# =====
CD=cd
RMFLAGS=-r
RM=rm $(RMFLAGS)
# =====
# daftar direktori
# =====
SRC=src
BUILD=build
ARGDIR=$(SRC)/args
FUNCDIR=$(SRC)/functions
DTDIR=$(SRC)/data-types
NMSPCDIR=$(SRC)/namespace
EXE=
# =====
# daftar aplikasi dan name `make`
# =====
EPS=ep_inparr ep_cashier
FUNCS=fbasic void inline auto
DTS=dbasic array1d enum class struct
ARGS=argc argv envp
NMSPCS=nbasic
# =====
# koleksi aplikasi
# =====
EP=ep
FUNC=func
DT=dt
AR=ar
NMS=nms
all: $(DT) $(FUNC) $(EP) $(AR)
$(AR): $(ARGS)
argc: $(BUILD) $(ARGDIR)/argc/src/argc.cpp
$(CPP) $(CPPFLAGS) $(ARGDIR)/argc/src/argc.cpp -o $(BUILD)/argc${EXE}
argv: $(BUILD) $(ARGDIR)/argv/src/argv.cpp
$(CPP) $(CPPFLAGS) $(ARGDIR)/argv/src/argv.cpp -o $(BUILD)/argv${EXE}
envp: $(BUILD) $(ARGDIR)/envp/src/envp.cpp
$(CPP) $(CPPFLAGS) $(ARGDIR)/envp/src/envp.cpp -o $(BUILD)/envp${EXE}
$(FUNC): $(FUNCS)
fbasic: $(BUILD) $(FUNCDIR)/basic/src/basic.cpp
$(CPP) $(CPPFLAGS) $(FUNCDIR)/basic/src/basic.cpp -o $(BUILD)/$@${EXE}
void: $(BUILD) $(FUNCDIR)/void/src/void.cpp
$(CPP) $(CPPFLAGS) $(FUNCDIR)/void/src/void.cpp -o $(BUILD)/$@${EXE}
inline: $(BUILD) $(FUNCDIR)/inline/src/inline.cpp
$(CPP) $(CPPFLAGS) $(FUNCDIR)/inline/src/inline.cpp -o $(BUILD)/$@${EXE}
auto: $(BUILD) $(FUNCDIR)/auto/src/auto.cpp
$(CPP) $(CPPFLAGS) $(FUNCDIR)/auto/src/auto.cpp -o $(BUILD)/$@${EXE}
$(DT): $(DTS)
dbasic: $(BUILD) $(DTDIR)/basic/src/basic.cpp
$(CPP) $(CPPFLAGS) $(DTDIR)/basic/src/basic.cpp -o $(BUILD)/$@${EXE}
struct: $(BUILD) $(DTDIR)/struct/src/struct.cpp
$(CPP) $(CPPFLAGS) $(DTDIR)/struct/src/struct.cpp -o $(BUILD)/$@${EXE}
enum: $(BUILD) $(DTDIR)/enum/src/enum.cpp
$(CPP) $(CPPFLAGS) $(DTDIR)/enum/src/enum.cpp -o $(BUILD)/$@${EXE}
class: $(BUILD) $(DTDIR)/class/src/class.cpp
$(CPP) $(CPPFLAGS) $(DTDIR)/class/src/class.cpp -o $(BUILD)/$@${EXE}
array1d: $(BUILD) $(DTDIR)/array/array1d/src/array1d.cpp
$(CPP) $(CPPFLAGS) $(DTDIR)/array/array1d/src/array1d.cpp -o $(BUILD)/$@${EXE}
$(NMS): $(NMSPCS)
nbasic: $(BUILD) $(NMSPCDIR)/basic/src/basic.cpp
$(CPP) $(CPPFLAGS) $(NMSPCDIR)/basic/src/basic.cpp -o $(BUILD)/$@${EXE}
$(EP): $(EPS)
ep_inparr:
$(CD) example-programs/input-array/ && make
ep_cashier:
$(CD) example-programs/cashier/ && make
ep_cashier-vector:
$(CD) example-programs/cashier-vector/ && make && ./build/main
clean:
./clean.sh
$(BUILD):
mkdir $@