Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

gdp / apps / Makefile @ master

History | View | Annotate | Download (4.83 KB)

1
#
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
#	Copyright (c) 2015-2019, Regents of the University of California.
7
#	All rights reserved.
8
#
9
#	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
#
15
#	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
#
20
#	REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
21
#	LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22
#	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
#  ----- END LICENSE BLOCK -----
27
#
28

    
29
BINALL_ZC=	gdp-zcbrowse
30
BINALL=		\
31
		log-exists \
32
		log-mirror \
33
		gdp-create \
34
		gdp-reader \
35
		gdp-writer \
36
		$(BINALL_ZC) \
37

    
38
SBINALL_ZC= 	gdp-zcpublish
39
SBINALL=	\
40
		gdp-find-xname \
41
		gdp-name-add \
42
		gdp-name-xlate \
43
		gdp-delete \
44
		gdp-log-view \
45
		$(SBINALL_ZC) \
46
		gdp-rest \
47
#		gdp-log-check \
48

    
49
MAN1ALL=	gdp-reader.1 \
50
		gdp-writer.1 \
51
		log-exists.1 \
52
		log-mirror.1 \
53

    
54
MAN3ALL=
55

    
56
MAN5ALL=
57

    
58
MAN7ALL=
59

    
60
MAN8ALL=	\
61
		gdp-create.8 \
62
		gdp-delete.8 \
63
		gdp-log-view.8 \
64
		gdp-name-add.8 \
65
#		gdp-log-check.8 \
66
#		gcl-clone.8 \
67

    
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
PUBALL=		${SCRIPTS} ${BINALL} ${SBINALL} ${MANALL}
74
# "make all" targets (may be overlaps)
75
ALL=		${CLEANALL} ${PUBALL}
76

    
77
DESTDIR=
78
LOCALROOT=	/usr
79
INSTALLROOT=	${DESTDIR}${LOCALROOT}
80
BINDIR=		${INSTALLROOT}/bin
81
SBINDIR=	${INSTALLROOT}/sbin
82
MANDIR=		${INSTALLROOT}/share/man
83
ALLDIRS=	${BINDIR} \
84
		${SBINDIR} \
85
		${MANDIR}/man1 \
86
		${MANDIR}/man8
87

    
88
INSTALLFLAGS=
89
INSTALL=	install ${INSTALLFLAGS}
90
CP=		cp
91

    
92
LOCAL1=		/usr/local
93
LOCAL2=		/opt/local
94
LOCAL3=		/usr/local/opt/openssl
95
INCROOT=	..
96
INCSEARCH=	${INCLOCAL} \
97
		-I${INCROOT} \
98
		`mysql_config --include` \
99
		-I${LOCAL1}/include \
100
		-I${LOCAL2}/include \
101
		-I${LOCAL3}/include
102
LIBROOT=	${INCROOT}
103
LIBSEARCH=	${LIBLOCAL} \
104
		-L${LIBROOT}/gdp \
105
		-L${LIBROOT}/ep \
106
		-L${LOCAL1}/lib \
107
		-L${LOCAL2}/lib \
108
		-L${LOCAL3}/lib
109
INCGDP=		-I${INCROOT}
110
LIBGDP=		-lgdp
111
INCEP=
112
LIBEP=		-lep
113
LIBJANSSON=	-ljansson
114
LIBEVENT2=	-levent -levent_pthreads -pthread
115
LIBCRYPTO=	-lcrypto
116
LIBPROTO_C=	-lprotobuf-c
117
LIBMYSQL=	`mysql_config --libs`
118
LIBSQLITE=	-lsqlite3
119
LIBADD=		`sh ../adm/add-libs.sh`
120
INCS=		${INCSEARCH} ${INCGDP} ${INCEP}
121
LDFLAGS+=	${LIBSEARCH} ${SANITIZE} ${LDADD}
122
LDLIBS=		${LIBGDP} \
123
		${LIBEP} \
124
		${LIBEVENT2} \
125
		${LIBCRYPTO} \
126
		${LIBPROTO_C} \
127
		${LIBJANSSON} \
128
		${LIBMYSQL} \
129
		${LIBADD}
130
PG=
131
WALL=		-Wall
132
G=		-g
133
O=		-O
134
STD=
135
COPTS=		${PG} ${WALL} $G $O ${STD} ${SANITIZE}
136
CFLAGS+=	${COPTS} ${INCS} ${CCADD}
137
MKDIR=		mkdir -p
138

    
139
all:	${ALL}
140

    
141
# 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
gdp-log-check.o: ../gdplogd/logd_disklog.c ../gdplogd/logd_gcl.c
147

    
148
gdp-log-view: gdp-log-view.o
149
	${CC} ${INCS} -o $@ ${LDFLAGS} gdp-log-view.o ${LDLIBS} ${LIBSQLITE}
150

    
151
gdp-log-view.o: gdp-log-view.c ../gdplogd/logd_sqlite.c ../gdp/gdp_hongd.h
152

    
153
gdp-name-add.o: gdp-name-add.c ../gdp/gdp_hongd.h
154
	${CC} -c -o $@ ${CFLAGS} `mysql_config --cflags` gdp-name-add.c
155

    
156
gdp-name-xlate.o: ../gdp/gdp_hongd.h
157

    
158
gdp-rest:	gdp-rest.c ../scgilib/scgilib.o
159
	${CC} ${INCS} -o $@ ${LDFLAGS} gdp-rest.c ${LDLIBS} ../scgilib/scgilib.o
160

    
161
${CLEANALL}:	${LIBROOT}/gdp/libgdp.a ${LIBROOT}/ep/libep.a
162

    
163
clean:
164
	-rm -f ${CLEANALL} *.o *.core
165

    
166
install:	${ALLDIRS} ${PUBALL} FORCE
167
	test -z "${BINALL}"  || ${INSTALL} ${BINALL}  ${BINDIR}
168
	test -z "${SBINALL}" || ${INSTALL} ${SBINALL} ${SBINDIR}
169
	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

    
175
${ALLDIRS}:
176
	${MKDIR} $@
177

    
178
ADM=		../adm
179
UPDATE_LICENSE=	${ADM}/update-license.sh
180

    
181
update-license:
182
	${UPDATE_LICENSE} Makefile *.[ch]
183

    
184
# 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
	${CC} ${CFLAGS} ${LDFLAGS} -o $@ $< ${LDLIBS}
189

    
190
FORCE: