GNUmakefile.in 11.4 KB
Newer Older
1
#
Leigh B Stoller's avatar
Leigh B Stoller committed
2
# Copyright (c) 2000-2015 University of Utah and the Flux Group.
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 
# {{{EMULAB-LICENSE
# 
# This file is part of the Emulab network testbed software.
# 
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
# 
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
# License for more details.
# 
# You should have received a copy of the GNU Affero General Public License
# along with this file.  If not, see <http://www.gnu.org/licenses/>.
# 
# }}}
22
#
23
24
25
26
27
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ..
SUBDIR		= www

28
29
30
31
32
#
# A hack for only installing some things if installing on the main site
#
MAINSITE        = emulab.net
OURDOMAIN       = @OURDOMAIN@
33
CVSSUPPORT      = @CVSSUPPORT@
34
CHATSUPPORT     = @CHATSUPPORT@
35
PGENISUPPORT    = @PROTOGENI_SUPPORT@
36

37
38
39
# Filter program
HTMLINSTALL     = $(INSTALL_SBINDIR)/htmlinstall  

40
include $(OBJDIR)/Makeconf
41

42
SUBDIRS = tutorial
Timothy Stack's avatar
   
Timothy Stack committed
43

44
45
46
47
#
# Force dependencies to make sure configure regenerates if the .in file
# is changed.
# 
48
all: defs.php3 dbdefs.php3 websearch htmlinstall xmlrpc.php3 \
49
	xmlrpcpipe.php3 blob/read.php3 all-subdirs
50

51
include $(TESTBED_SRCDIR)/GNUmakerules
52

53
54
55
#
# Generate a list of all the files we want to install from the current
# directory and the source directory. 
56
#
57
FILES	= $(wildcard *.css *.jpg *.gif *.png *.html *.php3 *.php *.ico *.jar)
58
59
FILES  += $(wildcard $(SRCDIR)/*.css)
FILES  += $(wildcard $(SRCDIR)/*.jpg)
Chad Barb's avatar
   
Chad Barb committed
60
FILES  += $(wildcard $(SRCDIR)/*.png)
61
62
63
FILES  += $(wildcard $(SRCDIR)/*.gif)
FILES  += $(wildcard $(SRCDIR)/*.html)
FILES  += $(wildcard $(SRCDIR)/*.php3)
64
FILES  += $(wildcard $(SRCDIR)/*.php)
65
FILES  += $(wildcard $(SRCDIR)/*.ico)
Timothy Stack's avatar
   
Timothy Stack committed
66
FILES  += $(wildcard $(SRCDIR)/*.class)
Timothy Stack's avatar
   
Timothy Stack committed
67
FILES  += $(wildcard $(SRCDIR)/*.jar)
Timothy Stack's avatar
   
Timothy Stack committed
68
FILES  += $(wildcard $(SRCDIR)/*.js)
Timothy Stack's avatar
   
Timothy Stack committed
69
FILES  += $(wildcard $(SRCDIR)/*.htc)
70
71
FILES  += $(SRCDIR)/.htaccess $(SRCDIR)/error.shtml \
	  $(SRCDIR)/ssh-mime.pl $(SRCDIR)/rdp-mime.pl \
72
	  $(SRCDIR)/emulab.app \
73
74
75
	  $(SRCDIR)/ssh-mime-winxp.pl $(SRCDIR)/rdp-mime-winxp.pl \
	  $(SRCDIR)/ssh-mime-winxp.c $(SRCDIR)/rdp-mime-winxp.c \
	  $(SRCDIR)/ssh-mime-winxp.exe $(SRCDIR)/rdp-mime-winxp.exe \
76
77
	  $(SRCDIR)/emulab-mime-winxp.zip $(SRCDIR)/emulab-mime-winxp.reg \
	  $(SRCDIR)/emusearch.xml
78
79
80
ifeq ($(TBROOT),/usr/testbed)
FILES  += robots.txt
endif 
81

82
83
84
AUTOICONS  = $(wildcard $(SRCDIR)/autostatus-icons/*.gif)
AUTOICONS += $(wildcard $(SRCDIR)/autostatus-icons/*.png)

85
FLOORMAPFILES  = $(wildcard $(SRCDIR)/floormap/*.jpg)
86
FLOORMAPFILES += $(wildcard $(SRCDIR)/floormap/*.gif)
87

88
89
90
WIRELESSSTATSFILES = $(wildcard $(SRCDIR)/wireless-stats/*.php3)
WIRELESSSTATSFILES += $(wildcard $(SRCDIR)/wireless-stats/*.jar)

91
92
93
PIXFILES  = $(wildcard $(SRCDIR)/pix/*.jpg)
PIXFILES += $(wildcard $(SRCDIR)/pix/*.gif)

Leigh B. Stoller's avatar
Leigh B. Stoller committed
94
DOCFILES  = $(wildcard $(SRCDIR)/doc/*.html)
95
96
DOCFILES += $(wildcard $(SRCDIR)/doc/*.jpg)
DOCFILES += $(wildcard $(SRCDIR)/doc/*.gif)
97
DOCFILES += $(wildcard $(SRCDIR)/doc/*.php3)
98
DOCFILES += $(wildcard $(SRCDIR)/doc/*.php)
99
100
DOCFILES += $(wildcard $(SRCDIR)/doc/*.ps)
DOCFILES += $(wildcard $(SRCDIR)/doc/*.pdf)
101
102
103
104

TUTFILES  = $(wildcard $(SRCDIR)/tutorial/*.html)
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.jpg)
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.gif)
105
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.png)
106
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.php3)
107
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.php)
108
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.ns)
Leigh B. Stoller's avatar
Leigh B. Stoller committed
109
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.txt)
110
TUTFILES += $(SRCDIR)/tutorial/tb_compat.tcl
Leigh B. Stoller's avatar
Leigh B. Stoller committed
111

112
113
114
115
BUIFILES  = $(wildcard $(SRCDIR)/buildui/*.html)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.jpg)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.gif)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.php3)
116
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.php)
117
118
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.class)

119
120
121
122
123
124
NLFILES  = $(wildcard $(SRCDIR)/netlab/*.html)
NLFILES += $(wildcard $(SRCDIR)/netlab/*.php3)
NLFILES += $(wildcard $(SRCDIR)/netlab/*.png)
NLFILES += $(wildcard $(SRCDIR)/netlab/*.gif)
NLFILES += $(wildcard $(SRCDIR)/netlab/*.txt)

125
126
127
PGENIFILES = 
ifeq ($(PGENISUPPORT),1)
    PGENIFILES += $(wildcard $(SRCDIR)/protogeni/*.php3)
128
    PGENIFILES += $(wildcard $(SRCDIR)/protogeni/*.php)
129
130
    PGENIFILES += $(wildcard $(SRCDIR)/protogeni/*.xml)
endif
131

132
133
134
135
136
HYFILES  = $(wildcard $(SRCDIR)/hyperviewer/*.php3)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.html)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.jpg)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.gif)

137
138
139
140
TTFILES  = $(wildcard $(SRCDIR)/timetree/*.png)
TTFILES += $(wildcard $(SRCDIR)/timetree/*.js)
TTFILES += $(wildcard $(SRCDIR)/timetree/*.css)

141
142
143
144
UMFILES  = $(wildcard $(SRCDIR)/usermap/*.php)
UMFILES += $(wildcard $(SRCDIR)/usermap/*.png)
UMFILES += $(wildcard $(SRCDIR)/usermap/*.js)

145
146
JSFILES += $(wildcard $(SRCDIR)/js/*.js)

147
148
BLOBFILES += $(wildcard blob/*.php3)

Leigh B Stoller's avatar
Leigh B Stoller committed
149
APTUIFILES  = $(wildcard $(SRCDIR)/aptui/*.php)
150
APTUIFILES += $(wildcard $(SRCDIR)/aptui/*.ajax)
Leigh B Stoller's avatar
Leigh B Stoller committed
151
APTUIFILES += $(wildcard $(SRCDIR)/aptui/*.png)
152
APTUIFILES += $(wildcard $(SRCDIR)/aptui/*.ico)
153
APTUIFILES += $(wildcard $(SRCDIR)/aptui/*.gif)
154
APTUIFILES += $(wildcard $(SRCDIR)/aptui/.htaccess)
155
156
APTJSFILES  = $(wildcard $(SRCDIR)/aptui/js/*.js)
APTLIBFILES = $(wildcard $(SRCDIR)/aptui/js/lib/*.js)
157
APTJQRFILES = $(wildcard $(SRCDIR)/aptui/js/lib/jQRangeSlider/*.js)
158
APTTEMPLATES = $(wildcard $(SRCDIR)/aptui/template/*.html)
159
160
161
APTCSSFILES = $(wildcard $(SRCDIR)/aptui/css/*.css)
APTFONTS = $(wildcard $(SRCDIR)/aptui/fonts/*)
APTIMAGES = $(wildcard $(SRCDIR)/aptui/images/*)
Leigh B Stoller's avatar
Leigh B Stoller committed
162

Chad Barb's avatar
Chad Barb committed
163
164
165
# need to make it *.gz; with simply "*", 
# we end up sucking over "CVS"
DOWNLOADFILES = $(wildcard $(SRCDIR)/downloads/*.gz)
Chad Barb's avatar
   
Chad Barb committed
166
DOWNLOADFILES += $(wildcard $(SRCDIR)/downloads/*.zip)
Chad Barb's avatar
   
Chad Barb committed
167
DOWNLOADFILES += $(wildcard $(SRCDIR)/downloads/*.exe)
Chad Barb's avatar
Chad Barb committed
168

169
170
171
#
# This stuff only gets installed on the main site
#
172
ifeq ($(CVSSUPPORT),1)
173
	CVSWEBFILES  = $(wildcard $(SRCDIR)/cvsweb/*.php3)
Leigh B. Stoller's avatar
Leigh B. Stoller committed
174
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.php)
175
176
177
178
179
180
181
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.conf)
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.gif)
	CVSWEBCGI    = $(wildcard $(SRCDIR)/cvsweb/*.cgi)

	INSTALL_CVSWEBCGI = $(INSTALL_PROGRAM) $(CVSWEBCGI) $(INSTALL_WWWDIR)/cvsweb
endif

182
183
184
185
186
187
188
189
190
191
192
ifeq ($(CVSSUPPORT),1) 
	OPSCVSWEBFILES  = $(wildcard $(SRCDIR)/cvsweb/*.gif)
	OPSCVSWEBCONF   = $(wildcard $(SRCDIR)/cvsweb/cvsweb-ops.conf)
	OPSCVSWEBCGI    = $(wildcard $(SRCDIR)/cvsweb/*.cgi)

	INSTALL_OPSCVSWEBCGI = $(INSTALL_PROGRAM) $(OPSCVSWEBCGI) \
			$(INSTALL_DIR)/opsdir/www/cvsweb
	INSTALL_OPSCVSWEBCONF = $(INSTALL_DATA) $(OPSCVSWEBCONF) \
			$(INSTALL_DIR)/opsdir/www/cvsweb/cvsweb.conf
endif

193
194
195
196
197
ifeq ($(CHATSUPPORT),1) 
	INSTALL_OPSJABBER = $(INSTALL_DATA) $(SRCDIR)/jabber/jeti.php \
			$(INSTALL_DIR)/opsdir/www/jabber
endif

198
199
200
#
# Kill the directory part of the names. The vpath rule will do the rest.
#
201
ALLFILES  = $(notdir $(FILES))
202
ALLFLOORMAPS  = $(notdir $(FLOORMAPFILES))
203
204
205
206
ALLPIXES  = $(notdir $(PIXFILES))
ALLDOCS   = $(notdir $(DOCFILES))
ALLTUTS   = $(notdir $(TUTFILES))
ALLICONS  = $(notdir $(AUTOICONS))
207
ALLPGENI  = $(notdir $(PGENIFILES))
Chad Barb's avatar
Chad Barb committed
208
ALLDOWNLOADS = $(notdir $(DOWNLOADFILES))
209
ALLCVSWEB = $(notdir $(CVSWEBFILES))
210
ALLOPSCVSWEB = $(notdir $(OPSCVSWEBFILES))
211
ALLBUI    = $(notdir $(BUIFILES))
212
ALLNL     = $(notdir $(NLFILES))
213
ALLHY     = $(notdir $(HYFILES))
214
ALLTT     = $(notdir $(TTFILES))
215
ALLUM     = $(notdir $(UMFILES))
216
ALLJS     = $(notdir $(JSFILES))
217
ALLWISTATS = $(notdir $(WIRELESSSTATSFILES))
218
ALLBLOB   = $(notdir $(BLOBFILES))
Leigh B Stoller's avatar
Leigh B Stoller committed
219
ALLAPTUI  = $(notdir $(APTUIFILES))
220
221
ALLAPTJS  = $(notdir $(APTJSFILES))
ALLAPTLIB = $(notdir $(APTLIBFILES))
222
ALLAPTJQR = $(notdir $(APTJQRFILES))
223
ALLAPTTEMPLATES = $(notdir $(APTTEMPLATES))
224
225
226
ALLAPTCSS = $(notdir $(APTCSSFILES))
ALLAPTFONTS = $(notdir $(APTFONTS))
ALLAPTIMAGES = $(notdir $(APTIMAGES))
227

228
INSTALLFILES = $(addprefix $(INSTALL_SBINDIR)/, htmlinstall) \
229
	$(addprefix $(INSTALL_WWWDIR)/, $(ALLFILES)) \
230
	$(addprefix $(INSTALL_WWWDIR)/floormap/, $(ALLFLOORMAPS)) \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
231
	$(addprefix $(INSTALL_WWWDIR)/pix/, $(ALLPIXES)) \
232
	$(addprefix $(INSTALL_WWWDIR)/tutorial/, $(ALLTUTS)) \
233
	$(addprefix $(INSTALL_WWWDIR)/doc/, $(ALLDOCS)) \
234
	$(addprefix $(INSTALL_WWWDIR)/protogeni/, $(ALLPGENI)) \
Chad Barb's avatar
Chad Barb committed
235
	$(addprefix $(INSTALL_WWWDIR)/downloads/, $(ALLDOWNLOADS)) \
236
	$(addprefix $(INSTALL_WWWDIR)/buildui/, $(ALLBUI)) \
237
	$(addprefix $(INSTALL_WWWDIR)/netlab/, $(ALLNL)) \
238
	$(addprefix $(INSTALL_WWWDIR)/hyperviewer/, $(ALLHY)) \
239
	$(addprefix $(INSTALL_WWWDIR)/timetree/, $(ALLTT)) \
240
	$(addprefix $(INSTALL_WWWDIR)/usermap/, $(ALLUM)) \
241
	$(addprefix $(INSTALL_WWWDIR)/js/, $(ALLJS)) \
242
	$(addprefix $(INSTALL_WWWDIR)/wireless-stats/, $(ALLWISTATS)) \
243
	$(addprefix $(INSTALL_WWWDIR)/autostatus-icons/, $(ALLICONS)) \
244
	$(addprefix $(INSTALL_WWWDIR)/blob/, $(ALLBLOB)) \
245
	$(addprefix $(INSTALL_LIBEXECDIR)/, websearch) \
246
	$(addprefix $(INSTALL_SBINDIR)/, htmlinstall) \
247
	$(addprefix $(INSTALL_WWWDIR)/cvsweb/, $(ALLCVSWEB)) \
248
	$(addprefix $(INSTALL_DIR)/opsdir/www/cvsweb/, $(ALLOPSCVSWEB)) \
249
	$(INSTALL_DIR)/opsdir/www/accept_cert.html \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
250
	$(INSTALL_WWWDIR)/wikidocs/wiki/ignore.html \
251
	$(INSTALL_WWWDIR)/doc/LICENSE.txt
252

Leigh B Stoller's avatar
Leigh B Stoller committed
253
install: $(INSTALLFILES) apt-install
254
	-mkdir -p $(INSTALL_WWWDIR)/wikidocs/wiki
255
256
	cd $(INSTALL_WWWDIR) && \
		rm -f tbdb.html; \
257
258
259
		ln -s index.html tbdb.html; \
		rm -f icons; \
		ln -s /usr/local/www/icons icons;
260
261
262
263
ifeq ($(CHATSUPPORT),1) 
	-mkdir -p $(INSTALL_DIR)/opsdir/www/jabber
	$(INSTALL_OPSJABBER)
endif
264
265
266
	$(INSTALL_CVSWEBCGI)
	$(INSTALL_OPSCVSWEBCONF)
	$(INSTALL_OPSCVSWEBCGI)
267

Leigh B Stoller's avatar
Leigh B Stoller committed
268
apt-install: 	$(addprefix $(INSTALL_WWWDIR)/apt/, $(ALLAPTUI)) \
269
270
	$(addprefix $(INSTALL_WWWDIR)/apt/js/, $(ALLAPTJS)) \
	$(addprefix $(INSTALL_WWWDIR)/apt/js/lib/, $(ALLAPTLIB)) \
271
	$(addprefix $(INSTALL_WWWDIR)/apt/js/lib/jQRangeSlider/, $(ALLAPTJQR)) \
272
	$(addprefix $(INSTALL_WWWDIR)/apt/template/, $(ALLAPTTEMPLATES)) \
273
274
275
	$(addprefix $(INSTALL_WWWDIR)/apt/css/, $(ALLAPTCSS)) \
	$(addprefix $(INSTALL_WWWDIR)/apt/fonts/, $(ALLAPTFONTS)) \
	$(addprefix $(INSTALL_WWWDIR)/apt/images/, $(ALLAPTIMAGES))
Leigh B Stoller's avatar
Leigh B Stoller committed
276

277
post-install:
278

279
280
boss-install:	install

281
282
283
284
285
uninstall:
	rm -f $(INSTALLFILES)

force-install:	uninstall install

286
$(INSTALL_WWWDIR)/doc/LICENSE.txt: $(TESTBED_SRCDIR)/AGPL-COPYING
287
288
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
289
290
291
292
293
294
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@)

$(INSTALL_WWWDIR)/%.html: %.html htmlinstall
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
	$(HTMLINSTALL) $(subst $$,\$$,$<) $(subst $$,\$$,$@)
295

296
$(INSTALL_WWWDIR)/%: %
297
	@echo "Installing $<"
298
	-mkdir -p $(patsubst %/,%,$(dir $@))
299
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 
Timothy Stack's avatar
   
Timothy Stack committed
300

Leigh B Stoller's avatar
Leigh B Stoller committed
301
302
303
304
305
$(INSTALL_WWWDIR)/apt/%: aptui/%
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 

Leigh B Stoller's avatar
Leigh B Stoller committed
306
307
308
309
310
$(INSTALL_WWWDIR)/aptb/%: aptuib/%
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 

311
312
313
314
315
$(INSTALL_DIR)/opsdir/www/%.html: %.html htmlinstall
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
	$(HTMLINSTALL) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 

316
317
318
319
320
$(INSTALL_DIR)/opsdir/www/%: %
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 

321
322
323
clean:		clean-subdirs
distclean:	distclean-subdirs

Timothy Stack's avatar
   
Timothy Stack committed
324
325
326
327
328
329
330
# How to recursively descend into subdirectories to make general
# targets such as `all'.
%.MAKE:
	@$(MAKE) -C $(dir $@) $(basename $(notdir $@))
%-subdirs: $(addsuffix /%.MAKE,$(SUBDIRS)) ;

.PHONY:	$(SUBDIRS)