-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.inc
86 lines (64 loc) · 1.83 KB
/
Makefile.inc
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
VZMROOT ?= .
#MODE = test
ARCH=$(shell uname -s)
PLAT=$(shell uname -m)
ifneq "" "$(findstring ia64,$(PLAT))"
__ia64__=true
endif
LIBVZM = libvzm.a
LIBVZ_SRC = -Wl,-Bstatic -lvzsock -Wl,-Bdynamic -luuid -lvzctl2 -ldl \
-lploop -lboost_system -lboost_thread -lzstd
LIBVZ_TEMPL = ${LIBVZ_SRC} -lvztt
LIBVZ_DST = -Wl,-Bstatic -lvzsock -Wl,-Bdynamic -luuid -lvzctl2 -ldl -lvztt \
-lploop -lboost_system -lboost_thread -lzstd
LIBDIR = ${VZMROOT}/lib
# ld flags
LDFLAGS+= -L/usr/local/lib $(LGCOV)
TARCH=$(shell uname -i)
ifeq "$(TARCH)" "x86_64"
LDFLAGS += -L/usr/kerberos/lib64
else
LDFLAGS += -L/usr/kerberos/lib
endif
LDFLAGS += -g
# Set include
INCDIRS = vzmcontrol
SUBDIRS = ${INCDIRS} bin
# set include flags
INCFLAGS ?= \
$(shell for ops in ${INCDIRS} ; do \
FS="$$FS -I${VZMROOT}/$$ops" ; \
done ; \
echo $$FS)
INCFLAGS += -I/usr/kerberos/include
CC = gcc
MFLAGS = -pthread -Werror -Wall -W -Wformat -g ${INCFLAGS} ${VZFS} -Wno-unused-parameter -Wno-missing-field-initializers
MFLAGS += -D_FILE_OFFSET_BITS=64 -DNDEBUG -D_VZLIN_ -DBOOST_BIND_GLOBAL_PLACEHOLDERS
# -pg
LPTHREAD = -lpthread
ifeq "${FIU_ENABLE}" "yes"
MFLAGS += -DFIU_ENABLE
LIBVZ_SRC += -lfiu
LIBVZ_DST += -lfiu
endif
CFLAGS += ${MFLAGS} -Wall -D_GNU_SOURCE -Wno-unused-parameter -Wno-missing-field-initializers
CXXFLAGS += ${MFLAGS} --std=c++98
#[ia64] gcc -pthread does not add -D_REENTRANT
#http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10865
#http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20705
ifeq "$(TARCH)" "ia64"
CXXFLAGS += -D_REENTRANT
endif
#.SUFFIXES: .o .cpp .c
#.c.o:
# gcc -c ${CFLAGS} $<
SOURCE ?= $(wildcard *.cpp *.c)
SOURCEH ?= $(wildcard *.h)
.depend:: ${SOURCE} ${SOURCEH}
g++ -MM ${CXXFLAGS} ${SOURCE} >.depend
depend_remove:
find ${VZMROOT} -name .depend | xargs rm
depend:: depend_remove .depend
install::
DEPEND_FILE ?= .depend
include ${DEPEND_FILE}