Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

gdp / Makefile @ master

History | View | Annotate | Download (6.01 KB)

1
#
2
#  ----- BEGIN LICENSE BLOCK -----
3
#	GDP: 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
# DESTDIR is just for staging.  LOCALROOT should be /usr or /usr/local.
30
DESTDIR=
31
LOCALROOT=	/usr
32
INSTALLROOT=	${DESTDIR}${LOCALROOT}
33
DOCROOT=	${INSTALLROOT}/share/doc/gdp
34
DOCDIR=		${DOCROOT}/`${ADM}/gdp-get-version.sh mm`
35
CLEANEXTRA=	gdp-client*.deb gdp-server*.deb gdp-python*.deb \
36
		README*.html \
37
		libs/*.a libs/*.so* libs/*.dylib \
38

    
39
all: all-nodoc
40

    
41
all-nodoc:
42
	(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

    
50
all-withdoc: all-nodoc
51
	(cd doc &&	${MAKE} all)	# needs pandoc
52

    
53
all-clientonly:
54
	(cd ep &&	${MAKE} all)
55
	(cd gdp &&	${MAKE} all)
56
	(cd apps &&	${MAKE} all)
57

    
58
# Build without avahi, the zero-conf facility that
59
# can be tricky to compile under Mac OS X.
60
all_noavahi:
61
	(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

    
70
clean:
71
	(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
	rm -f ${CLEANEXTRA}
80

    
81
# Install libraries needed to run (but not compile) applications
82
# (FIXME: this installs static as well as shared libraries)
83
install-lib:
84
	(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

    
91
# Install code used by GDP-based application developers (including old names).
92
# For the time being client installs include development files.
93
install-dev-c install-client: install-include install-lib
94
	(cd gdp &&	${MAKE} install DESTDIR=${DESTDIR} LOCALROOT=${LOCALROOT})
95
	(cd apps &&	${MAKE} install DESTDIR=${DESTDIR} LOCALROOT=${LOCALROOT})
96

    
97
# Install code used by the log server
98
install-gdplogd: install-lib
99
	(cd gdplogd &&	${MAKE} install DESTDIR=${DESTDIR} LOCALROOT=${LOCALROOT})
100
	(cd util &&	${MAKE} install DESTDIR=${DESTDIR} LOCALROOT=${LOCALROOT})
101

    
102
# Install all documentation
103
install-doc:
104
	(cd doc &&	${MAKE} install DESTDIR=${DESTDIR} LOCALROOT=${LOCALROOT})
105
	mkdir -p ${DOCDIR}
106
	cp -rp examples ${DOCDIR}
107

    
108
# 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
# 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
install: install-dev-c install-gdplogd install-doc
117

    
118
GDPROOT=	~gdp
119
GDPALL=		adm/start-* \
120
		adm/run-* \
121
		apps/gcl-create \
122
		apps/gdp-rest \
123
		apps/gdp-reader \
124
		apps/gdp-writer \
125
		gdplogd/gdplogd \
126

    
127
CSRCS=		ep/*.[ch] \
128
		gdp/*.[ch] \
129
		gdplogd/*.[ch] \
130
		scgilib/scgilib.[ch] \
131
		apps/*.[ch] \
132

    
133
CTAGS=		ctags
134

    
135
tags: .FORCE
136
	${CTAGS} ${CSRCS}
137

    
138
.FORCE:
139

    
140
# Install Python interface in system paths. Optional (including old name)
141
install-dev-python install-python: install-dev-c
142
	(cd lang/python &&	$(MAKE) install) 
143

    
144
# Build the Java interface to the GDP. Optional for the GDP per se.
145
all_Java:
146
	(cd lang/java &&	${MAKE} clean all)
147

    
148
install_Java:
149
	(cd lang/java &&	${MAKE} clean install)
150

    
151
clean_Java:
152
	(cd lang/java &&	${MAKE} clean)
153

    
154
# 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
	(cd lang/js &&		${MAKE} clean all)
158

    
159
clean_JavaScript:
160
	(cd lang/js &&		${MAKE} clean)
161

    
162
# Build the debian-style package.  Must be done on the oldest system
163
# around because of dependencies.
164

    
165
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

    
170

    
171
ADM=		adm
172
UPDATE_LICENSE=	${ADM}/update-license.sh
173
GET_VERSION_INFO=	${ADM}/get-version-info.sh
174

    
175
update-license:
176
	${UPDATE_LICENSE} Makefile *.[ch]
177
	(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

    
187
git-version.txt: .FORCE
188
	${GET_VERSION_INFO} > /dev/null
189

    
190
# Not made by default
191
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
PANDOC=		pandoc
200
PANFLAGS=	-sS -c doc/gdpdoc.css
201

    
202
.SUFFIXES: .md .html
203

    
204
.md.html:
205
	${PANDOC} ${PANFLAGS} -o $@ $<
206

    
207
README_html: ${READMES_HTML}