-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (26 loc) · 888 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
#Makefile
# CFLAGS = -c -g -O3 -Wall -std=c++0x -flto -DNDEBUG -MMD -MP
# FINAL_CFLAGS = -g -O3 -Wall -std=c++0x -flto -DNDEBUG
CFLAGS := -c -g -O3 -Wall -std=c++0x -flto -MMD -MP
FINAL_CFLAGS := -g -O3 -Wall -std=c++0x -flto
# CFLAGS = -c -g -O0 -Wall -std=c++0x -MMD -MP
# FINAL_CFLAGS = -g -O0 -Wall -std=c++0x
# CFLAGS = -c -g -O1 -Wall -std=c++0x -DNDEBUG -MMD -MP
# FINAL_CFLAGS = -g -O1 -Wall -std=c++0x -DNDEBUG
TARGET := astranza2
SRC_DIR := ./src
OBJ_DIR := ./obj
SRCS = $(shell ls $(SRC_DIR)/*.cpp)
OBJS = $(subst $(SRC_DIR), $(OBJ_DIR), $(SRCS:.cpp=.o))
DEPS = $(OBJS:.o=.d)
INCLUDE = -I ./include
CC := g++
all: $(TARGET)
-include $(DEPS)
$(TARGET): $(OBJS)
$(CC) $(FINAL_CFLAGS) $(INCLUDE) -o $@ $^ -lreadline
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
$(CC) $(CFLAGS) $(INCLUDE) -o $@ -c $<
clean:
rm -f $(TARGET) $(OBJS) $(DEPS) $(SRC_DIR)/*~
.PHONY: all clean