-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (31 loc) · 897 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
CC = g++
GCCVERSION = $(shell gcc --version | grep 4\\.4\\.)
INCDIR = inc
LIBINCDIR = lib/ahatlogger/AhatLogger/inc
OBJDIR = obj
SRCDIR = src
INCLUDEDIR = -I$(INCDIR) -I$(LIBINCDIR)
LIBDIR = lib/ahatlogger/AhatLogger/lib
LINKLIB = -L$(LIBDIR)
LIBS = -lpthread -lahatlogger
ETC = -std=gnu++0x -g
TARGET = AhatDummyServer
INCS := $(wildcard $(INCDIR)/*.h)
SRCS := $(wildcard $(SRCDIR)/*.cpp)
OBJS = $(SRCS:$(SRCDIR)/%.cpp=$(OBJDIR)/%.o)
ifeq "$(GCCVERSION)" ""
ETC += -std=c++11
else
ETC += -std=c++0x -D_GLIBCXX_USE_NANOSLEEP
endif
all : ${TARGET}
$(TARGET) : $(OBJDIR) $(OBJS) $(LIBDIR)
$(CC) -o $@ $(OBJS) $(INCLUDEDIR) $(LINKLIB) $(LIBS) $(ETC)
$(OBJS) : $(INCS) $(SRCS)
$(CC) -c $(@:$(OBJDIR)%.o=$(SRCDIR)%.cpp) -o $@ $(INCLUDEDIR) $(LINKLIB) $(LIBS) $(ETC)
$(OBJDIR) :
mkdir -p $(OBJDIR)
$(LIBDIR) :
(cd lib/ahatlogger/AhatLogger && make)
clean :
rm -rf $(OBJDIR) ${TARGET}