-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (47 loc) · 941 Bytes
/
Makefile
File metadata and controls
57 lines (47 loc) · 941 Bytes
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
all: obj/ build/ obj/main.cpp.o build/emmg
OSMODE := l
obj/:
ifeq (${OSMODE}, l)
mkdir -p obj
else
mkdir obj
endif
build/:
ifeq (${OSMODE}, l)
mkdir -p build
else
mkdir build
endif
obj/main.cpp.o: src/main.cpp
ifeq (${OSMODE}, l)
${CXX} src/main.cpp -c -o obj/main.cpp.o
else
${CXX} src/main.cpp -c -o obj/main.cpp.o
endif
build/emmg: obj/main.cpp.o
ifeq (${OSMODE}, l)
${CXX} obj/main.cpp.o -o build/emmg
else
${CXX} obj/main.cpp.o -o build/emmg
endif
clean:
rm -r obj
rm -r build
.PHONY: clean
ifeq (${OSMODE}, l)
install:
install build/emmg /usr/local/bin/
.PHONY: install
endif
gencommands:
mkdir emmgtemp
ifeq (${OSMODE}, l)
clang src/main.cpp -MJ emmgtemp/0.json -fsyntax-only
else
clang src/main.cpp -MJ emmgtemp/0.json -fsyntax-only
endif
# not cross platform here sad i think
echo [ > emmgtemp/[
echo ] > emmgtemp/]
cat emmgtemp/[ emmgtemp/*.json emmgtemp/] > compile_commands.json
rm -r emmgtemp