This repository has been archived by the owner on Jun 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (41 loc) · 1.51 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
# Copyright (C) 2012, Rus V. Brushkoff, All rights reserved
BOOST_LIB_PATH := /usr/lib64
BOOST_INCLUDE_PATH := /usr/include
JSON_LIB_PATH := /usr/lib64
JSON_INCLUDE_PATH := /usr/local/include/json_spirit
# -Wsequence-point
# -Wstrict-aliasing
# -O2
CFLAGS = -g3 -Wall -Wno-strict-aliasing -Wno-sequence-point -Winvalid-pch -std=gnu++0x -D_REENTRANT -D_GNU_SOURCE -D_THREAD_SAFE -I$(BOOST_INCLUDE_PATH) -I$(JSON_INCLUDE_PATH) -I.
LDFLAGS = -L$(BOOST_LIB_PATH) -L$(JSON_LIB_PATH)
CXX := g++
EXE=orientpp
VERSION_FILE = version.cpp
BUILD_NUMBER := $(strip $(subst ;,,$(subst int OrientPP::ORIENTPP_BUILD_NUMBER =,,$(shell /usr/bin/grep "int OrientPP::ORIENTPP_BUILD_NUMBER = " $(VERSION_FILE)))))
LDFLAGS := $(LDFLAGS) -lboost_system -lboost_date_time -lboost_program_options -lboost_thread -lpthread -ljson_spirit
OBJS = test.o version.o log.o orient.o
$(EXE): $(OBJS)
$(CXX) $(CFLAGS) $(OBJS) -o $@ -Wl,--start-group $(LDFLAGS) -Wl,--end-group
%.o: %.cpp
$(CXX) -MD -c $(CFLAGS) $< -o $@
%.gch: %.h
$(CXX) -MD -c $(CFLAGS) $< -o $@
version:
@./scripts/version.sh
incr:
@BLD=`expr $(BUILD_NUMBER) + 1`; \
echo "OrientPP build number" $$BLD; \
sed -i "s/ORIENTPP_BUILD_NUMBER[ = ]*[0-9][0-9]*/ORIENTPP_BUILD_NUMBER = $$BLD/" $(VERSION_FILE)
# cleanup by removing generated files
#
.PHONY: clean
clean:
rm -f *.o *.gch $(EXE) *.d DEADJOE out
dcp:
@git diff
@git commit -a
@git push ssh://git@voip/home/git/orientpp
@./scripts/version.sh
test:
@$(EXE) 2 > tests/log.txt 2>&1; cat tests/log.txt
-include $(wildcard *.d)