GNUmakefile.in 9.69 KB
Newer Older
1
#
2
# Copyright (c) 2000-2012 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 swish.conf 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)

Chad Barb's avatar
Chad Barb committed
149
150
151
# 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
152
DOWNLOADFILES += $(wildcard $(SRCDIR)/downloads/*.zip)
Chad Barb's avatar
   
Chad Barb committed
153
DOWNLOADFILES += $(wildcard $(SRCDIR)/downloads/*.exe)
Chad Barb's avatar
Chad Barb committed
154

155
156
157
#
# This stuff only gets installed on the main site
#
158
ifeq ($(CVSSUPPORT),1)
159
	CVSWEBFILES  = $(wildcard $(SRCDIR)/cvsweb/*.php3)
Leigh B. Stoller's avatar
Leigh B. Stoller committed
160
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.php)
161
162
163
164
165
166
167
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.conf)
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.gif)
	CVSWEBCGI    = $(wildcard $(SRCDIR)/cvsweb/*.cgi)

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

168
169
170
171
172
173
174
175
176
177
178
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

179
180
181
182
183
ifeq ($(CHATSUPPORT),1) 
	INSTALL_OPSJABBER = $(INSTALL_DATA) $(SRCDIR)/jabber/jeti.php \
			$(INSTALL_DIR)/opsdir/www/jabber
endif

184
185
186
#
# Kill the directory part of the names. The vpath rule will do the rest.
#
187
ALLFILES  = $(notdir $(FILES))
188
ALLFLOORMAPS  = $(notdir $(FLOORMAPFILES))
189
190
191
192
ALLPIXES  = $(notdir $(PIXFILES))
ALLDOCS   = $(notdir $(DOCFILES))
ALLTUTS   = $(notdir $(TUTFILES))
ALLICONS  = $(notdir $(AUTOICONS))
193
ALLPGENI  = $(notdir $(PGENIFILES))
Chad Barb's avatar
Chad Barb committed
194
ALLDOWNLOADS = $(notdir $(DOWNLOADFILES))
195
ALLCVSWEB = $(notdir $(CVSWEBFILES))
196
ALLOPSCVSWEB = $(notdir $(OPSCVSWEBFILES))
197
ALLBUI    = $(notdir $(BUIFILES))
198
ALLNL     = $(notdir $(NLFILES))
199
ALLHY     = $(notdir $(HYFILES))
200
ALLTT     = $(notdir $(TTFILES))
201
ALLUM     = $(notdir $(UMFILES))
202
ALLJS     = $(notdir $(JSFILES))
203
ALLWISTATS = $(notdir $(WIRELESSSTATSFILES))
204
ALLBLOB   = $(notdir $(BLOBFILES))
205

206
INSTALLFILES = $(addprefix $(INSTALL_SBINDIR)/, htmlinstall) \
207
	$(addprefix $(INSTALL_WWWDIR)/, $(ALLFILES)) \
208
	$(addprefix $(INSTALL_WWWDIR)/floormap/, $(ALLFLOORMAPS)) \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
209
	$(addprefix $(INSTALL_WWWDIR)/pix/, $(ALLPIXES)) \
210
	$(addprefix $(INSTALL_WWWDIR)/tutorial/, $(ALLTUTS)) \
211
	$(addprefix $(INSTALL_WWWDIR)/doc/, $(ALLDOCS)) \
212
	$(addprefix $(INSTALL_WWWDIR)/protogeni/, $(ALLPGENI)) \
Chad Barb's avatar
Chad Barb committed
213
	$(addprefix $(INSTALL_WWWDIR)/downloads/, $(ALLDOWNLOADS)) \
214
	$(addprefix $(INSTALL_WWWDIR)/buildui/, $(ALLBUI)) \
215
	$(addprefix $(INSTALL_WWWDIR)/netlab/, $(ALLNL)) \
216
	$(addprefix $(INSTALL_WWWDIR)/hyperviewer/, $(ALLHY)) \
217
	$(addprefix $(INSTALL_WWWDIR)/timetree/, $(ALLTT)) \
218
	$(addprefix $(INSTALL_WWWDIR)/usermap/, $(ALLUM)) \
219
	$(addprefix $(INSTALL_WWWDIR)/js/, $(ALLJS)) \
220
	$(addprefix $(INSTALL_WWWDIR)/wireless-stats/, $(ALLWISTATS)) \
221
	$(addprefix $(INSTALL_WWWDIR)/autostatus-icons/, $(ALLICONS)) \
222
	$(addprefix $(INSTALL_WWWDIR)/blob/, $(ALLBLOB)) \
223
	$(addprefix $(INSTALL_LIBEXECDIR)/, websearch) \
224
	$(addprefix $(INSTALL_SBINDIR)/, htmlinstall) \
225
	$(addprefix $(INSTALL_WWWDIR)/cvsweb/, $(ALLCVSWEB)) \
226
	$(addprefix $(INSTALL_DIR)/opsdir/www/cvsweb/, $(ALLOPSCVSWEB)) \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
227
	$(INSTALL_WWWDIR)/wikidocs/wiki/ignore.html \
228
	$(INSTALL_WWWDIR)/doc/LICENSE.txt \
229
	$(addprefix $(INSTALL_ETCDIR)/, swish.conf)
230
231

install: $(INSTALLFILES)
232
	-mkdir -p $(INSTALL_WWWDIR)/wikidocs/wiki
233
	(swish-e -c ./swish.conf)
234
235
	cd $(INSTALL_WWWDIR) && \
		rm -f tbdb.html; \
236
237
238
		ln -s index.html tbdb.html; \
		rm -f icons; \
		ln -s /usr/local/www/icons icons;
239
240
241
242
ifeq ($(CHATSUPPORT),1) 
	-mkdir -p $(INSTALL_DIR)/opsdir/www/jabber
	$(INSTALL_OPSJABBER)
endif
243
244
245
	$(INSTALL_CVSWEBCGI)
	$(INSTALL_OPSCVSWEBCONF)
	$(INSTALL_OPSCVSWEBCGI)
246

247
post-install:
248

249
250
boss-install:	install

251
252
253
254
255
uninstall:
	rm -f $(INSTALLFILES)

force-install:	uninstall install

256
$(INSTALL_WWWDIR)/doc/LICENSE.txt: $(TESTBED_SRCDIR)/AGPL-COPYING
257
258
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
259
260
261
262
263
264
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@)

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

266
$(INSTALL_WWWDIR)/%: %
267
	@echo "Installing $<"
268
	-mkdir -p $(patsubst %/,%,$(dir $@))
269
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 
Timothy Stack's avatar
   
Timothy Stack committed
270

271
272
273
274
275
$(INSTALL_DIR)/opsdir/www/%.html: %.html htmlinstall
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
	$(HTMLINSTALL) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 

276
277
278
279
280
$(INSTALL_DIR)/opsdir/www/%: %
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 

281
282
283
clean:		clean-subdirs
distclean:	distclean-subdirs

Timothy Stack's avatar
   
Timothy Stack committed
284
285
286
287
288
289
290
# 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)