Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

gdp / Makefile @ master

History | View | Annotate | Download (6.01 KB)

1 055d3009 Eric Allman
#
2
#  ----- BEGIN LICENSE BLOCK -----
3
#	GDP: 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 bd34b3a7 Eric Allman
# DESTDIR is just for staging.  LOCALROOT should be /usr or /usr/local.
30
DESTDIR=
31
LOCALROOT=	/usr
32
INSTALLROOT=	${DESTDIR}${LOCALROOT}
33 5e95f5f4 Eric Allman
DOCROOT=	${INSTALLROOT}/share/doc/gdp
34
DOCDIR=		${DOCROOT}/`${ADM}/gdp-get-version.sh mm`
35 06acf435 Eric Allman
CLEANEXTRA=	gdp-client*.deb gdp-server*.deb gdp-python*.deb \
36 7adbb63b Eric Allman
		README*.html \
37
		libs/*.a libs/*.so* libs/*.dylib \
38 29e6f6d0 Christopher Brooks
39 646872a2 Eric Allman
all: all-nodoc
40
41
all-nodoc:
42 9d3867c0 Eric Allman
	(cd ep &&	${MAKE} all)
43
	(cd gdp &&	${MAKE} all)
44
	(cd gdplogd &&	${MAKE} all)
45
	(cd apps &&	${MAKE} all)
46
	(cd util &&	${MAKE} all)
47
	(cd examples &&	${MAKE} all)
48
	(cd scgilib &&	${MAKE} all)
49 47c6ea64 Eric Allman
50 646872a2 Eric Allman
all-withdoc: all-nodoc
51 9d3867c0 Eric Allman
	(cd doc &&	${MAKE} all)	# needs pandoc
52 646872a2 Eric Allman
53
all-clientonly:
54 9d3867c0 Eric Allman
	(cd ep &&	${MAKE} all)
55
	(cd gdp &&	${MAKE} all)
56
	(cd apps &&	${MAKE} all)
57 646872a2 Eric Allman
58 29e6f6d0 Christopher Brooks
# Build without avahi, the zero-conf facility that
59
# can be tricky to compile under Mac OS X.
60
all_noavahi:
61 9d3867c0 Eric Allman
	(cd ep &&	${MAKE} all)
62
	(cd gdp &&	${MAKE} all_noavahi)
63
	(cd scgilib &&	${MAKE} all)
64
	(cd gdplogd &&	${MAKE} all_noavahi)
65
	(cd apps &&	${MAKE} all_noavahi)
66
	(cd util &&	${MAKE} all)
67
	(cd examples &&	${MAKE} all_noavahi)
68
	(cd lang/js &&	${MAKE} all_noavahi)
69 29e6f6d0 Christopher Brooks
70 47c6ea64 Eric Allman
clean:
71 9d3867c0 Eric Allman
	(cd doc &&	${MAKE} clean)
72
	(cd ep &&	${MAKE} clean)
73
	(cd gdp &&	${MAKE} clean)
74
	(cd scgilib &&	${MAKE} clean)
75
	(cd gdplogd &&	${MAKE} clean)
76
	(cd apps &&	${MAKE} clean)
77
	(cd util &&	${MAKE} clean)
78
	(cd examples &&	${MAKE} clean)
79 7adbb63b Eric Allman
	rm -f ${CLEANEXTRA}
80 e18fea5e Eric Allman
81 390904c6 Eric Allman
# Install libraries needed to run (but not compile) applications
82
# (FIXME: this installs static as well as shared libraries)
83
install-lib:
84 c9ba48c9 Eric Allman
	(cd ep &&	${MAKE} install-lib DESTDIR=${DESTDIR} LOCALROOT=${LOCALROOT})
85
	(cd gdp &&	${MAKE} install-lib DESTDIR=${DESTDIR} LOCALROOT=${LOCALROOT})
86
87
install-include:
88
	(cd ep &&	${MAKE} install-include DESTDIR=${DESTDIR} LOCALROOT=${LOCALROOT})
89
	(cd gdp &&	${MAKE} install-include DESTDIR=${DESTDIR} LOCALROOT=${LOCALROOT})
90 390904c6 Eric Allman
91 4006c00b Eric Allman
# Install code used by GDP-based application developers (including old names).
92
# For the time being client installs include development files.
93 c9ba48c9 Eric Allman
install-dev-c install-client: install-include install-lib
94
	(cd gdp &&	${MAKE} install DESTDIR=${DESTDIR} LOCALROOT=${LOCALROOT})
95 9d3867c0 Eric Allman
	(cd apps &&	${MAKE} install DESTDIR=${DESTDIR} LOCALROOT=${LOCALROOT})
96 3ccf4025 Nitesh Mor
97 2786071d Eric Allman
# Install code used by the log server
98 390904c6 Eric Allman
install-gdplogd: install-lib
99 9d3867c0 Eric Allman
	(cd gdplogd &&	${MAKE} install DESTDIR=${DESTDIR} LOCALROOT=${LOCALROOT})
100
	(cd util &&	${MAKE} install DESTDIR=${DESTDIR} LOCALROOT=${LOCALROOT})
101 3ccf4025 Nitesh Mor
102 390904c6 Eric Allman
# Install all documentation
103 3ccf4025 Nitesh Mor
install-doc:
104 9d3867c0 Eric Allman
	(cd doc &&	${MAKE} install DESTDIR=${DESTDIR} LOCALROOT=${LOCALROOT})
105 5e95f5f4 Eric Allman
	mkdir -p ${DOCDIR}
106
	cp -rp examples ${DOCDIR}
107 3ccf4025 Nitesh Mor
108 c9ba48c9 Eric Allman
# Used only for language installs (???)
109
install-local:
110
	(cd ep &&	${MAKE} install-local DESTDIR=${DESTDIR} LOCALROOT=${LOCALROOT})
111
	(cd gdp &&	${MAKE} install-local DESTDIR=${DESTDIR} LOCALROOT=${LOCALROOT})
112
113 a0f9ebba Nitesh Mor
# Split it into sub-targets to mimic our distribution, also
114
#   used by the debian packaging scripts. So if you change it here,
115
#   make sure you don't break the packaging.
116 4006c00b Eric Allman
install: install-dev-c install-gdplogd install-doc
117 bd34b3a7 Eric Allman
118 f33e594e Eric Allman
GDPROOT=	~gdp
119
GDPALL=		adm/start-* \
120
		adm/run-* \
121
		apps/gcl-create \
122
		apps/gdp-rest \
123 6e2cccae Eric Allman
		apps/gdp-reader \
124
		apps/gdp-writer \
125 f33e594e Eric Allman
		gdplogd/gdplogd \
126
127 a7ab7f37 Eric Allman
CSRCS=		ep/*.[ch] \
128
		gdp/*.[ch] \
129 d7ad3b75 Eric Allman
		gdplogd/*.[ch] \
130 a7ab7f37 Eric Allman
		scgilib/scgilib.[ch] \
131
		apps/*.[ch] \
132
133 a194934d Eric Allman
CTAGS=		ctags
134
135 910eb631 Eric Allman
tags: .FORCE
136 d0da2db7 Eric Allman
	${CTAGS} ${CSRCS}
137 6123ed04 Alec Dara-Abrams
138 910e16dc Eric Allman
.FORCE:
139
140 4006c00b Eric Allman
# Install Python interface in system paths. Optional (including old name)
141
install-dev-python install-python: install-dev-c
142 9d3867c0 Eric Allman
	(cd lang/python &&	$(MAKE) install) 
143 6df5f94d Nitesh Mor
144 296eeac9 Christopher Brooks
# Build the Java interface to the GDP. Optional for the GDP per se.
145
all_Java:
146 9d3867c0 Eric Allman
	(cd lang/java &&	${MAKE} clean all)
147 296eeac9 Christopher Brooks
148
install_Java:
149 9d3867c0 Eric Allman
	(cd lang/java &&	${MAKE} clean install)
150 296eeac9 Christopher Brooks
151
clean_Java:
152 9d3867c0 Eric Allman
	(cd lang/java &&	${MAKE} clean)
153 296eeac9 Christopher Brooks
154 6123ed04 Alec Dara-Abrams
# Build the Node.js/JavaScript GDP accessing apps and the Node.js/JS
155
# RESTful GDP interface.  Optional for the GDP per se.
156
all_JavaScript:
157 9d3867c0 Eric Allman
	(cd lang/js &&		${MAKE} clean all)
158 6123ed04 Alec Dara-Abrams
159
clean_JavaScript:
160 9d3867c0 Eric Allman
	(cd lang/js &&		${MAKE} clean)
161 968edcba Eric Allman
162
# Build the debian-style package.  Must be done on the oldest system
163
# around because of dependencies.
164
165 990d8ebf Nitesh Mor
debian-package: all
166
	adm/deb-pkg/client/package.sh
167
	adm/deb-pkg/server/package.sh
168
	lang/python/deb-pkg/package.sh
169 34e05ead Nitesh Mor
170 055d3009 Eric Allman
171
ADM=		adm
172
UPDATE_LICENSE=	${ADM}/update-license.sh
173 74c71346 Eric Allman
GET_VERSION_INFO=	${ADM}/get-version-info.sh
174 055d3009 Eric Allman
175
update-license:
176
	${UPDATE_LICENSE} Makefile *.[ch]
177 9d3867c0 Eric Allman
	(cd ep &&	 ${MAKE} update-license)
178
	(cd gdp &&	 ${MAKE} update-license)
179
	(cd gdplogd &&	 ${MAKE} update-license)
180
	(cd apps &&	 ${MAKE} update-license)
181
	(cd doc &&	 ${MAKE} update-license)
182
	(cd lang &&	 ${MAKE} update-license)
183
	(cd test &&	 ${MAKE} update-license)
184
	(cd examples &&	 ${MAKE} update-license)
185
	(cd util &&	 ${MAKE} update-license)
186 a5c5c509 Eric Allman
187 74c71346 Eric Allman
git-version.txt: .FORCE
188
	${GET_VERSION_INFO} > /dev/null
189
190 a5c5c509 Eric Allman
# Not made by default
191 a194934d Eric Allman
READMES_HTML= \
192
	README.html \
193
	README-admin.html \
194
	README-CAAPI.html \
195
	README-compiling.html \
196
	README-deb.html \
197
	README-developers.html \
198
199 a5c5c509 Eric Allman
PANDOC=		pandoc
200 c924c712 Eric Allman
PANFLAGS=	-sS -c doc/gdpdoc.css
201 a5c5c509 Eric Allman
202 a194934d Eric Allman
.SUFFIXES: .md .html
203
204
.md.html:
205 a5c5c509 Eric Allman
	${PANDOC} ${PANFLAGS} -o $@ $<
206 34e05ead Nitesh Mor
207 a194934d Eric Allman
README_html: ${READMES_HTML}