-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (35 loc) · 1.15 KB
/
Makefile
File metadata and controls
56 lines (35 loc) · 1.15 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
TARGETDIR = .
TARGET = ring-catcher
CC = g++
USE_RFM = true
CPP_FLAGS += -std=c++0x -mcmodel=medium -D_REENTRANT -Wall -Wextra #-Wpedantic
INCLUDE_FLAGS += -Iinclude/
COMPILE.cpp = g++ -c $(CPP_FLAGS) $(INCLUDE_FLAGS) $(EIHS_FLAGS)
DBGTARGET = $(TARGETDIR)/$(TARGET)-dbg
RELTARGET = $(TARGETDIR)/$(TARGET)
DBGCFLAGS = -g -DDEBUG
RELCFLAGS = -O2 -fno-strict-aliasing
CPPSOURCES = $(wildcard ./src/*.cpp)
DBGCPPOBJFILES = $(CPPSOURCES:./src/%.cpp=./obj/debug/%.o)
RELCPPOBJFILES = $(CPPSOURCES:./src/%.cpp=./obj/release/%.o)
#.PHONY: clean Debug Release install
all: Release Debug
install:
install -d $(TARGETDIR)
install $(RELTARGET) $(EXEC_DIR)
Release: $(RELTARGET)
Debug: $(DBGTARGET)
$(RELTARGET): $(RELCPPOBJFILES)
@mkdir -p $(TARGETDIR)
$(CC) -o $@ $(RELCPPOBJFILES)
$(DBGTARGET): $(DBGCPPOBJFILES)
@mkdir -p $(TARGETDIR)
$(CC) -o $@ $(DBGCPPOBJFILES)
$(RELCPPOBJFILES): obj/release/%.o: ./src/%.cpp
@mkdir -p obj/release
$(COMPILE.cpp) $(RELCFLAGS) -o $@ $<
$(DBGCPPOBJFILES): obj/debug/%.o: ./src/%.cpp
@mkdir -p obj/debug
$(COMPILE.cpp) $(DBGCFLAGS) -o $@ $<
clean:
-$(RM) -rf $(DBGTARGET) $(RELTARGET) obj/ bin/ *~ *.d *.csv .dep