-
Notifications
You must be signed in to change notification settings - Fork 37
/
Makefile_Linux
47 lines (31 loc) · 1.23 KB
/
Makefile_Linux
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
COMPILER = g++
CFLAGS = -g -MMD -MP -std=c++11 -O3 -fopenmp -pthread
WFLAGS = -pedantic -Wignored-qualifiers -Wreturn-type -Wmaybe-uninitialized -Wbool-compare -Wshadow -Wunused-but-set-variable -Wunused-variable
OPTGTK =
LIBS = -lboost_system -I./ -L./ -lai
SRCDIR = .
SHARE_DIR = share
SHARE_SOURCES = $(wildcard ./$(SHARE_DIR)/*.cpp)
SOURCES = $(wildcard *.cpp)
OBJDIR = ./obj
SHARE_OBJDIR = ./$(SHARE_DIR)/obj
OBJECTS = $(addprefix $(OBJDIR)/, $(notdir $(SOURCES:.cpp=.o)))
SHARE_OBJECTS = $(addprefix $(SHARE_OBJDIR)/, $(notdir $(SHARE_SOURCES:.cpp=.o)))
DEPENDS = $(OBJECTS:.o=.d)
SHARE_DEPENDS = $(SHARE_OBJECTS:.o=.d)
HEADERS = $(SOURCES:.cpp=.hpp)
SHARE_HEADERS = $(SHARE_SOURCES:.cpp=.hpp)
TARGET = system.exe
$(TARGET): $(OBJECTS) $(SHARE_OBJECTS)
$(COMPILER) $(OBJECTS) $(SHARE_OBJECTS) $(CFLAGS) $(WFLAGS) $(LIBS) -o $@
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp $(SRCDIR)/%.hpp
$(COMPILER) $< -c $(CFLAGS) $(WFLAGS) $(OPTGTK) $(LIBS) -o $@
$(SHARE_OBJDIR)/%.o: $(SHARE_DIR)/%.cpp $(SHARE_DIR)/%.hpp
$(COMPILER) $< -c $(CFLAGS) $(WFLAGS) $(LIBS) -o $@
test:
echo $(SHARE_OBJECTS)
test1:
echo $(SHARE_DEPENDS)
clean:
-rm -f $(OBJECTS) $(SHARE_OBJECTS) $(DEPENDS) $(SHARE_DEPENDS) $(TARGET)
-include $(DEPENDS) $(SHARE_DEPENDS)