-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (50 loc) · 2.96 KB
/
Makefile
File metadata and controls
69 lines (50 loc) · 2.96 KB
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
# ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
# make - Name
# ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
MAKE_NAME=lib3dreconstruct
# ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
# make - Directories
# ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
MAKE_BINARY=bin
MAKE_MANUAL=man
MAKE_SOURCE=src
MAKE_OBJECT=obj
# ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
# make - Files
# ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
MAKE_SRC=$(wildcard $(MAKE_SOURCE)/*.cpp)
MAKE_OBJ=$(addprefix $(MAKE_OBJECT)/, $(addsuffix .o, $(notdir $(basename $(MAKE_SRC)))))
# ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
# make - Constants
# ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
MAKE_CC=g++
MAKE_LD=ar
MAKE_COPT=-O3 -Wall -c
MAKE_LOPT=
# ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
# make - All
# ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
all:directories $(MAKE_NAME)
# ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
# make - Binaries
# ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$(MAKE_NAME):$(MAKE_OBJ)
$(MAKE_LD) rcs $(MAKE_BINARY)/$(MAKE_NAME).a $^
# ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
# make - Objects
# ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$(MAKE_OBJECT)/%.o:$(MAKE_SOURCE)/%.cpp
$(MAKE_CC) $(MAKE_COPT) -o $@ $<
# ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
# make - Directories
# ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
directories:
mkdir -p $(MAKE_OBJECT)
mkdir -p $(MAKE_BINARY)
# ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
# make - Cleaning
# ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
clean:
rm $(MAKE_BINARY)/* -f
rm $(MAKE_OBJECT)/*.o -f
# ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////