-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (53 loc) · 1.55 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Based on Makefile from <URL: http://hak5.org/forums/index.php?showtopic=2077&p=27959 >
PROGRAM = modellbasen
############# Main application #################
all: $(PROGRAM)
.PHONY: all
# source files
DEBUG_INFO = YES
#USE_ODBC_CONNECTION = YES
SOURCES = $(shell find -L . -name '*.cpp'|grep -v "/example/"|sort)
OBJECTS = $(SOURCES:.cpp=.o)
DEPS = $(OBJECTS:.o=.dep)
######## compiler- and linker settings #########
CXX = g++
CXXFLAGS = -I/usr/local/include -I/usr/include -W -Wall -Werror -pipe -std=c++11
ifdef DEBUG_INFO
CXXFLAGS += -g -DDEBUG
LIBSFLAGS = -L/usr/local/lib -lPocoDatad -lPocoFoundationd
else
CXXFLAGS += -O3
LIBSFLAGS = -L/usr/local/lib -lPocoData -lPocoFoundation
endif
ifdef USE_ODBC_CONNECTION
CXXFLAGS += -DUSE_ODBC_CONNECTION
ifdef DEBUG_INFO
LIBSFLAGS += -lPocoDataODBCd
else
LIBSFLAGS += -lPocoDataODBC
endif
else
ifdef DEBUG_INFO
LIBSFLAGS += -lPocoDataMySQLd
else
LIBSFLAGS += -lPocoDataMySQL
endif
endif
LIBSFLAGS += -lwt -lwthttp -lboost_system -lboost_thread -lboost_signals -lboost_locale -lpthread -lvips
%.o: %.cpp
$(CXX) $(CXXFLAGS) -o $@ -c $<
%.dep: %.cpp
$(CXX) $(CXXFLAGS) -MM $< -MT $(<:.cpp=.o) > $@
############# Main application #################
$(PROGRAM): $(OBJECTS) $(DEPS)
$(CXX) -o $@ $(OBJECTS) $(LIBSFLAGS)
################ Dependencies ##################
ifneq ($(MAKECMDGOALS),clean)
include $(DEPS)
endif
################### Clean ######################
clean:
find . -name '*~' -delete
-rm -f $(PROGRAM) $(OBJECTS) $(DEPS)
install:
strip -s $(PROGRAM) && cp $(PROGRAM) /usr/local/bin/