-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (41 loc) · 1.31 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
LIBS = -lGL -lglfw3 -lGLEW -lX11 -lpthread -ldl -lz
GPP = g++ -std=c++14 -Wall -I $(srcCor) -I $(srcApp)
GOO = $(GPP) -c
RM = rm -irf
cordir = Gamelan/
appdir = Sandbox/
srcdir = Sources/
bindir = bin/
srcCor = $(cordir)$(srcdir)
srcApp = $(appdir)$(srcdir)
main = $(appdir)$(srcdir)sandbox.cpp
SRC := $(wildcard $(srcCor)*.cpp) $(wildcard $(srcCor)*/*.cpp) $(wildcard $(srcCor)*/*/*.cpp)\
$(wildcard $(srcApp)*.cpp) $(wildcard $(srcApp)*/*.cpp) $(wildcard $(srcApp)*/*/*.cpp)
HEAD := $(wildcard $(srcdir)*.h) $(wildcard $(srcdir)*/*.h) $(wildcard $(srcdir)*/*/*.h)\
$(wildcard $(srcApp)*.h) $(wildcard $(srcApp)*/*.h) $(wildcard $(srcApp)*/*/*.h)
OBJ := $(subst $(srcCor), $(bindir), $(subst $(srcApp), $(bindir), $(SRC:.cpp=.o)))
SUP := $(srcCor)config.h $(srcCor)core.h $(srcCor)gamelan.h
PROG = $(appdir)Prog
all = $(PROG)
$(PROG) : $(OBJ)
$(GPP) $(OBJ) -o $@ $(LIBS)
$(bindir)%.o : $(srcCor)%.cpp $(srcCor)%.h $(SUP)
mkdir -p $(dir $@)
$(GOO) $(word 1, $^) -o $@
$(bindir)%.o : $(srcApp)%.cpp $(srcApp)%.h $(SUP)
mkdir -p $(dir $@)
$(GOO) $(word 1, $^) -o $@
prompt = "Compile _ as main?"
$(bindir)%.o : $(srcApp)%.cpp $(SUP)
#$(prompt:_=$(word 1, $^))
#read REPLY
mkdir -p $(dir $@)
$(GOO) $(word 1, $^) -o $@
.PHONY : clean
clean :
$(RM) $(bindir)*
$(RM) $(PROG)
.PHONY : re
re :
touch $(main)
make