-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
executable file
·49 lines (37 loc) · 1006 Bytes
/
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
BASEPATH = .
SRC_DIR = $(BASEPATH)/src
INC_DIR = $(BASEPATH)/include
OBJ_DIR = $(BASEPATH)/obj
APPNAME = $(BASEPATH)/delaunay
VPATH = $(SRC_DIR)
INC_DIRS = \
$(INC_DIR) \
LIB_DIRS = \
/usr/local/lib
LIBS = \
SOURCES = \
main.cpp \
predicates.cpp \
delaunay.cpp \
vertexreader.cpp \
quadedge.cpp \
edge.cpp \
vertex.cpp \
OBJECTS = $(SOURCES:.cpp=.o)
CC = g++
#CPPFLAGS = -g -Wall
CPPFLAGS = -O
CPPFLAGS += $(addprefix -I, $(INC_DIRS))
LDFLAGS = $(addprefix -L, $(LIB_DIRS)) $(addprefix -l, $(LIBS))
all : $(APPNAME)
$(APPNAME) : $(addprefix $(OBJ_DIR)/, $(OBJECTS))
$(CC) $(CPPFLAGS) $^ $(LDFLAGS) -o $@
$(OBJ_DIR)/%.o : %.cpp
$(CC) $(CPPFLAGS) -MD -c $< -o $@
@cp $(OBJ_DIR)/$*.d $(OBJ_DIR)/$*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $(OBJ_DIR)/$*.d >> $(OBJ_DIR)/$*.P; \
rm -f $(OBJ_DIR)/$*.d
-include $(OBJECTS:%.o=$(OBJ_DIR)/%.P)
clean :
rm $(OBJ_DIR)/* $(APPNAME)