GNUmakefile.in 12 KB
Newer Older
1
#
2
# Copyright (c) 2000-2019 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
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)
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)
66
FILES  += $(wildcard $(SRCDIR)/*.class)
67
FILES  += $(wildcard $(SRCDIR)/*.jar)
Timothy Stack's avatar
Timothy Stack committed
68
FILES  += $(wildcard $(SRCDIR)/*.js)
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)

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)
Leigh Stoller's avatar
Leigh Stoller committed
101
DOCFILES += $(wildcard $(SRCDIR)/doc/*.svg)
102 103 104 105

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

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

120 121 122 123 124 125
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)

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

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

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

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

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

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

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

166 167 168
APTNEWJSFILES   = $(wildcard $(SRCDIR)/aptui/js/new/*.js)
APTNEWTEMPLATES = $(wildcard $(SRCDIR)/aptui/template/new/*.html)

Chad Barb's avatar
Chad Barb committed
169 170 171
# need to make it *.gz; with simply "*", 
# we end up sucking over "CVS"
DOWNLOADFILES = $(wildcard $(SRCDIR)/downloads/*.gz)
172
DOWNLOADFILES += $(wildcard $(SRCDIR)/downloads/*.zip)
173
DOWNLOADFILES += $(wildcard $(SRCDIR)/downloads/*.exe)
Chad Barb's avatar
Chad Barb committed
174

175 176 177
#
# This stuff only gets installed on the main site
#
178
ifeq ($(CVSSUPPORT),1)
179
	CVSWEBFILES  = $(wildcard $(SRCDIR)/cvsweb/*.php3)
Leigh Stoller's avatar
Leigh Stoller committed
180
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.php)
181 182 183 184 185 186 187
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.conf)
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.gif)
	CVSWEBCGI    = $(wildcard $(SRCDIR)/cvsweb/*.cgi)

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

188 189 190 191 192 193 194 195 196 197 198
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

199 200 201 202 203
ifeq ($(CHATSUPPORT),1) 
	INSTALL_OPSJABBER = $(INSTALL_DATA) $(SRCDIR)/jabber/jeti.php \
			$(INSTALL_DIR)/opsdir/www/jabber
endif

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

234 235 236
ALLAPTNEWJS  = $(notdir $(APTNEWJSFILES))
ALLAPTNEWTEMPLATES = $(notdir $(APTNEWTEMPLATES))

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

Leigh Stoller's avatar
Leigh Stoller committed
262
install: $(INSTALLFILES) apt-install
263
	-mkdir -p $(INSTALL_WWWDIR)/wikidocs/wiki
264 265
	cd $(INSTALL_WWWDIR) && \
		rm -f tbdb.html; \
266 267 268
		ln -s index.html tbdb.html; \
		rm -f icons; \
		ln -s /usr/local/www/icons icons;
269 270 271 272
ifeq ($(CHATSUPPORT),1) 
	-mkdir -p $(INSTALL_DIR)/opsdir/www/jabber
	$(INSTALL_OPSJABBER)
endif
273 274 275
	$(INSTALL_CVSWEBCGI)
	$(INSTALL_OPSCVSWEBCONF)
	$(INSTALL_OPSCVSWEBCGI)
276
	cd $(OBJDIR) && gmake install-setbuildinfo
277

Leigh Stoller's avatar
Leigh Stoller committed
278
apt-install: 	$(addprefix $(INSTALL_WWWDIR)/apt/, $(ALLAPTUI)) \
279 280
	$(addprefix $(INSTALL_WWWDIR)/apt/js/, $(ALLAPTJS)) \
	$(addprefix $(INSTALL_WWWDIR)/apt/js/lib/, $(ALLAPTLIB)) \
281
	$(addprefix $(INSTALL_WWWDIR)/apt/js/lib/jQRangeSlider/, $(ALLAPTJQR)) \
282
	$(addprefix $(INSTALL_WWWDIR)/apt/template/, $(ALLAPTTEMPLATES)) \
283 284
	$(addprefix $(INSTALL_WWWDIR)/apt/css/, $(ALLAPTCSS)) \
	$(addprefix $(INSTALL_WWWDIR)/apt/fonts/, $(ALLAPTFONTS)) \
285 286 287
	$(addprefix $(INSTALL_WWWDIR)/apt/images/, $(ALLAPTIMAGES)) \
	$(addprefix $(INSTALL_WWWDIR)/apt/js/new/, $(ALLAPTNEWJS)) \
	$(addprefix $(INSTALL_WWWDIR)/apt/template/new/, $(ALLAPTNEWTEMPLATES))
288 289 290
	cd $(INSTALL_WWWDIR) && \
		rm -f portal; \
		ln -s apt portal;
Leigh Stoller's avatar
Leigh Stoller committed
291

292
post-install:
293

294 295
boss-install:	install

296 297 298 299 300
uninstall:
	rm -f $(INSTALLFILES)

force-install:	uninstall install

301
$(INSTALL_WWWDIR)/doc/LICENSE.txt: $(TESTBED_SRCDIR)/AGPL-COPYING
302 303
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
304 305 306 307 308 309
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@)

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

311
$(INSTALL_WWWDIR)/%: %
312
	@echo "Installing $<"
313
	-mkdir -p $(patsubst %/,%,$(dir $@))
314
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 
315

Leigh Stoller's avatar
Leigh Stoller committed
316 317 318 319 320
$(INSTALL_WWWDIR)/apt/%: aptui/%
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 

321 322 323 324 325
$(INSTALL_WWWDIR)/aptb/%: aptuib/%
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 

326 327 328 329 330
$(INSTALL_DIR)/opsdir/www/%.html: %.html htmlinstall
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
	$(HTMLINSTALL) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 

331 332 333 334 335
$(INSTALL_DIR)/opsdir/www/%: %
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 

336 337 338
clean:		clean-subdirs
distclean:	distclean-subdirs

339 340 341 342 343 344 345
# 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)