-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
38 lines (32 loc) · 805 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
CC = g++
INCLUDES =
DEFINE_FLAGS=
ifeq (${mode}, release)
FLAGS = -O3 -march=native -std=c++17
else
mode = debug
FLAGS = -O0 -g -std=c++17
endif
GL_FLAGS =
LIB_FLAGS =
OBJS =
PROJECT_NAME = gp_project
ifeq (${mode}, debug)
PROJECT = ${PROJECT_NAME}_debug
else
PROJECT = ${PROJECT_NAME}
endif
${PROJECT}: ${OBJS} main.o clean_emacs_files
@echo "Building on "${mode}" mode"
@echo ".........................."
${CC} ${INCLUDES} ${FLAGS} ${DEFINE_FLAGS} ${OBJS} main.o -o $@ ${GL_FLAGS} ${LIB_FLAGS}
-make clean
main.o:
${CC} ${INCLUDES} ${FLAGS} ${DEFINE_FLAGS} -c main.cpp -o $@ ${GL_FLAGS} ${LIB_FLAGS}
.PHONEY: clean clean_emacs_files clean_all
clean:
-rm -rf ${OBJS} main.o
clean_emacs_files:
-rm -rf *~
clean_all: clean clean_emacs_files
-rm -rf ${PROJECT_NAME} ${PROJECT_NAME}_debug