Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

gdp / apps / Makefile @ master

History | View | Annotate | Download (4.84 KB)

1 055d3009 Eric Allman
#
2
#  ----- BEGIN LICENSE BLOCK -----
3
#	Applications for the Global Data Plane
4
#	From the Ubiquitous Swarm Lab, 490 Cory Hall, U.C. Berkeley.
5
#
6 c87dd166 Eric Allman
#	Copyright (c) 2015-2019, Regents of the University of California.
7 6bd5476b Eric Allman
#	All rights reserved.
8 055d3009 Eric Allman
#
9 6bd5476b Eric Allman
#	Permission is hereby granted, without written agreement and without
10
#	license or royalty fees, to use, copy, modify, and distribute this
11
#	software and its documentation for any purpose, provided that the above
12
#	copyright notice and the following two paragraphs appear in all copies
13
#	of this software.
14 055d3009 Eric Allman
#
15 6bd5476b Eric Allman
#	IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
16
#	SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST
17
#	PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
18
#	EVEN IF REGENTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19 055d3009 Eric Allman
#
20 6bd5476b Eric Allman
#	REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
21 055d3009 Eric Allman
#	LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22 6bd5476b Eric Allman
#	FOR A PARTICULAR PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION,
23
#	IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO
24
#	OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
25
#	OR MODIFICATIONS.
26 055d3009 Eric Allman
#  ----- END LICENSE BLOCK -----
27
#
28
29 6d91bdca Eric Allman
BINALL_ZC=	gdp-zcbrowse
30 eae1d3ec Eric Allman
BINALL=		\
31 6065974c Eric Allman
		log-exists \
32 9c59e638 Eric Allman
		log-mirror \
33 eae1d3ec Eric Allman
		gdp-create \
34 6e2cccae Eric Allman
		gdp-reader \
35 728cb9ee Nicholas Sun
		gdp-writer \
36 29e6f6d0 Christopher Brooks
		$(BINALL_ZC) \
37 9c59e638 Eric Allman
38 29e6f6d0 Christopher Brooks
SBINALL_ZC= 	gdp-zcpublish
39 0e6d0600 Eric Allman
SBINALL=	\
40 815ee3e5 Eric Allman
		gdp-find-xname \
41 59c6c7e0 Eric Allman
		gdp-name-add \
42 728cb9ee Nicholas Sun
		gdp-name-xlate \
43 4a6db795 Eric Allman
		gdp-delete \
44 be19c14d Eric Allman
		gdp-log-view \
45 29e6f6d0 Christopher Brooks
		$(SBINALL_ZC) \
46 a555e771 Rick Pratt
		gdp-rest \
47 fa7cfdb9 Eric Allman
#		gdp-log-check \
48 e18fea5e Eric Allman
49 596605f2 Eric Allman
MAN1ALL=	gdp-reader.1 \
50
		gdp-writer.1 \
51 6065974c Eric Allman
		log-exists.1 \
52 596605f2 Eric Allman
		log-mirror.1 \
53
54
MAN3ALL=
55
56
MAN5ALL=
57
58
MAN7ALL=
59
60 eae1d3ec Eric Allman
MAN8ALL=	\
61
		gdp-create.8 \
62
		gdp-delete.8 \
63 be19c14d Eric Allman
		gdp-log-view.8 \
64 b6e19f27 Eric Allman
		gdp-name-add.8 \
65 2786071d Eric Allman
#		gdp-log-check.8 \
66 eae1d3ec Eric Allman
#		gcl-clone.8 \
67 596605f2 Eric Allman
68
MANALL=		${MAN1ALL} ${MAN3ALL} ${MAN5ALL} ${MAN7ALL} ${MAN8ALL}
69
70
# files that should be removed on "make clean"
71
CLEANALL=	${BINALL} ${SBINALL}
72
# files that should be made public
73 b185537e Eric Allman
PUBALL=		${SCRIPTS} ${BINALL} ${SBINALL} ${MANALL}
74 596605f2 Eric Allman
# "make all" targets (may be overlaps)
75
ALL=		${CLEANALL} ${PUBALL}
76 e18fea5e Eric Allman
77 cca3bf6e Eric Allman
DESTDIR=
78 bd34b3a7 Eric Allman
LOCALROOT=	/usr
79
INSTALLROOT=	${DESTDIR}${LOCALROOT}
80
BINDIR=		${INSTALLROOT}/bin
81
SBINDIR=	${INSTALLROOT}/sbin
82 596605f2 Eric Allman
MANDIR=		${INSTALLROOT}/share/man
83 4deac29c Eric Allman
ALLDIRS=	${BINDIR} \
84
		${SBINDIR} \
85
		${MANDIR}/man1 \
86
		${MANDIR}/man8
87
88 edf46949 Eric Allman
INSTALLFLAGS=
89
INSTALL=	install ${INSTALLFLAGS}
90 b9209f18 Eric Allman
CP=		cp
91 47c6ea64 Eric Allman
92 a91ce59c Eric Allman
LOCAL1=		/usr/local
93
LOCAL2=		/opt/local
94 2a2ce319 Eric Allman
LOCAL3=		/usr/local/opt/openssl
95 acc40055 Eric Allman
INCROOT=	..
96 475517e0 Eric Allman
INCSEARCH=	${INCLOCAL} \
97
		-I${INCROOT} \
98 e0451f24 Eric Allman
		`mysql_config --include` \
99 475517e0 Eric Allman
		-I${LOCAL1}/include \
100 2a2ce319 Eric Allman
		-I${LOCAL2}/include \
101
		-I${LOCAL3}/include
102 47c6ea64 Eric Allman
LIBROOT=	${INCROOT}
103 475517e0 Eric Allman
LIBSEARCH=	${LIBLOCAL} \
104
		-L${LIBROOT}/gdp \
105 3a80c46d Eric Allman
		-L${LIBROOT}/ep \
106 475517e0 Eric Allman
		-L${LOCAL1}/lib \
107 2a2ce319 Eric Allman
		-L${LOCAL2}/lib \
108
		-L${LOCAL3}/lib
109 47c6ea64 Eric Allman
INCGDP=		-I${INCROOT}
110 559bb7ce Eric Allman
LIBGDP=		-lgdp
111 47c6ea64 Eric Allman
INCEP=
112 559bb7ce Eric Allman
LIBEP=		-lep
113 475517e0 Eric Allman
LIBJANSSON=	-ljansson
114 e07c2b52 Siqi Lin
LIBEVENT2=	-levent -levent_pthreads -pthread
115 ecbc8f12 Eric Allman
LIBCRYPTO=	-lcrypto
116 d65c01e2 Eric Allman
LIBPROTO_C=	-lprotobuf-c
117 e0451f24 Eric Allman
LIBMYSQL=	`mysql_config --libs`
118 be19c14d Eric Allman
LIBSQLITE=	-lsqlite3
119 51113c36 Eric Allman
LIBADD=		`sh ../adm/add-libs.sh`
120 475517e0 Eric Allman
INCS=		${INCSEARCH} ${INCGDP} ${INCEP}
121 a7de91d2 Eric Allman
LDFLAGS+=	${LIBSEARCH} ${SANITIZE} ${LDADD} ${PG}
122 6065974c Eric Allman
LDLIBS=		${LIBGDP} \
123
		${LIBEP} \
124
		${LIBEVENT2} \
125
		${LIBCRYPTO} \
126 d65c01e2 Eric Allman
		${LIBPROTO_C} \
127
		${LIBJANSSON} \
128 59c6c7e0 Eric Allman
		${LIBMYSQL} \
129 51113c36 Eric Allman
		${LIBADD}
130 47c6ea64 Eric Allman
PG=
131 f9bfb20e Eric Allman
WALL=		-Wall
132 1b663276 Eric Allman
G=		-g
133
O=		-O
134 2443e497 Eric Allman
STD=
135 80da996e Eric Allman
COPTS=		${PG} ${WALL} $G $O ${STD} ${SANITIZE}
136 65822458 Eric Allman
CFLAGS+=	${COPTS} ${INCS} ${CCADD}
137 e18fea5e Eric Allman
MKDIR=		mkdir -p
138 47c6ea64 Eric Allman
139
all:	${ALL}
140
141 29e6f6d0 Christopher Brooks
# Build without avahi, the zero-conf facility that
142
# can be tricky to compile under Mac OS X.
143
all_noavahi:
144
	${MAKE}	STD=-DGDP_OSCF_USE_ZEROCONF=0 LIBAVAHI= BINALL_ZC= SBINALL_ZC= all
145
146 edbb4508 Eric Allman
gdp-log-check.o: ../gdplogd/logd_disklog.c ../gdplogd/logd_gcl.c
147
148 be19c14d Eric Allman
gdp-log-view: gdp-log-view.o
149
	${CC} ${INCS} -o $@ ${LDFLAGS} gdp-log-view.o ${LDLIBS} ${LIBSQLITE}
150
151 0e2c49f6 Eric Allman
gdp-log-view.o: gdp-log-view.c ../gdplogd/logd_sqlite.c ../gdp/gdp_hongd.h
152 be19c14d Eric Allman
153 0e2c49f6 Eric Allman
gdp-name-add.o: gdp-name-add.c ../gdp/gdp_hongd.h
154 e0451f24 Eric Allman
	${CC} -c -o $@ ${CFLAGS} `mysql_config --cflags` gdp-name-add.c
155 59c6c7e0 Eric Allman
156 0e2c49f6 Eric Allman
gdp-name-xlate.o: ../gdp/gdp_hongd.h
157
158 d65c01e2 Eric Allman
gdp-rest:	gdp-rest.c ../scgilib/scgilib.o
159
	${CC} ${INCS} -o $@ ${LDFLAGS} gdp-rest.c ${LDLIBS} ../scgilib/scgilib.o
160 728cb9ee Nicholas Sun
161 e40a661d Eric Allman
${CLEANALL}:	${LIBROOT}/gdp/libgdp.a ${LIBROOT}/ep/libep.a
162 47c6ea64 Eric Allman
163
clean:
164 596605f2 Eric Allman
	-rm -f ${CLEANALL} *.o *.core
165 e18fea5e Eric Allman
166 4deac29c Eric Allman
install:	${ALLDIRS} ${PUBALL} FORCE
167 a5cbe60f Eric Allman
	test -z "${BINALL}"  || ${INSTALL} ${BINALL}  ${BINDIR}
168
	test -z "${SBINALL}" || ${INSTALL} ${SBINALL} ${SBINDIR}
169 b9209f18 Eric Allman
	test -z "${MAN1ALL}" || ${CP} ${MAN1ALL} ${MANDIR}/man1
170
	test -z "${MAN3ALL}" || ${CP} ${MAN3ALL} ${MANDIR}/man3
171
	test -z "${MAN5ALL}" || ${CP} ${MAN5ALL} ${MANDIR}/man5
172
	test -z "${MAN7ALL}" || ${CP} ${MAN7ALL} ${MANDIR}/man7
173
	test -z "${MAN8ALL}" || ${CP} ${MAN8ALL} ${MANDIR}/man8
174 e18fea5e Eric Allman
175 4deac29c Eric Allman
${ALLDIRS}:
176 e18fea5e Eric Allman
	${MKDIR} $@
177 055d3009 Eric Allman
178
ADM=		../adm
179
UPDATE_LICENSE=	${ADM}/update-license.sh
180
181
update-license:
182
	${UPDATE_LICENSE} Makefile *.[ch]
183 596605f2 Eric Allman
184 e40a661d Eric Allman
# Redefine the implicit compile rule; GNU make changed the rule slightly
185
# which causes explicit paths to libgdp.a and libep.a to be added to
186
# the command, which in turn breaks compiling under C++.
187
.c:
188 a7f1f4e4 Eric Allman
	${CC} ${CFLAGS} ${LDFLAGS} -o $@ $< ${LDLIBS}
189 e40a661d Eric Allman
190 596605f2 Eric Allman
FORCE: