GNUmakefile.in 9.46 KB
Newer Older
1
#
2
# EMULAB-COPYRIGHT
3
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
4
# All rights reserved.
5
#
6
7
8
9
10
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ..
SUBDIR		= www

11
12
13
14
15
#
# A hack for only installing some things if installing on the main site
#
MAINSITE        = emulab.net
OURDOMAIN       = @OURDOMAIN@
16
CVSSUPPORT      = @CVSSUPPORT@
17
CHATSUPPORT     = @CHATSUPPORT@
18
PGENISUPPORT    = @PROTOGENI_SUPPORT@
19

20
21
22
# Filter program
HTMLINSTALL     = $(INSTALL_SBINDIR)/htmlinstall  

23
include $(OBJDIR)/Makeconf
24

25
SUBDIRS = garcia-telemetry tutorial
Timothy Stack's avatar
   
Timothy Stack committed
26

27
28
29
30
#
# Force dependencies to make sure configure regenerates if the .in file
# is changed.
# 
31
all: defs.php3 dbdefs.php3 swish.conf websearch htmlinstall xmlrpc.php3 \
32
	xmlrpcpipe.php3 blob/read.php3 all-subdirs
33

34
include $(TESTBED_SRCDIR)/GNUmakerules
35

36
37
38
#
# Generate a list of all the files we want to install from the current
# directory and the source directory. 
39
#
40
FILES	= $(wildcard *.css *.jpg *.gif *.png *.html *.php3 *.php *.ico *.jar)
41
42
FILES  += $(wildcard $(SRCDIR)/*.css)
FILES  += $(wildcard $(SRCDIR)/*.jpg)
Chad Barb's avatar
   
Chad Barb committed
43
FILES  += $(wildcard $(SRCDIR)/*.png)
44
45
46
FILES  += $(wildcard $(SRCDIR)/*.gif)
FILES  += $(wildcard $(SRCDIR)/*.html)
FILES  += $(wildcard $(SRCDIR)/*.php3)
47
FILES  += $(wildcard $(SRCDIR)/*.php)
48
FILES  += $(wildcard $(SRCDIR)/*.ico)
Timothy Stack's avatar
   
Timothy Stack committed
49
FILES  += $(wildcard $(SRCDIR)/*.class)
Timothy Stack's avatar
   
Timothy Stack committed
50
FILES  += $(wildcard $(SRCDIR)/*.jar)
Timothy Stack's avatar
   
Timothy Stack committed
51
FILES  += $(wildcard $(SRCDIR)/*.js)
Timothy Stack's avatar
   
Timothy Stack committed
52
FILES  += $(wildcard $(SRCDIR)/*.htc)
53
54
FILES  += $(SRCDIR)/.htaccess $(SRCDIR)/error.shtml \
	  $(SRCDIR)/ssh-mime.pl $(SRCDIR)/rdp-mime.pl \
55
	  $(SRCDIR)/emulab.app \
56
57
58
	  $(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 \
59
60
	  $(SRCDIR)/emulab-mime-winxp.zip $(SRCDIR)/emulab-mime-winxp.reg \
	  $(SRCDIR)/emusearch.xml
61
62
63
ifeq ($(TBROOT),/usr/testbed)
FILES  += robots.txt
endif 
64

65
66
67
AUTOICONS  = $(wildcard $(SRCDIR)/autostatus-icons/*.gif)
AUTOICONS += $(wildcard $(SRCDIR)/autostatus-icons/*.png)

68
FLOORMAPFILES  = $(wildcard $(SRCDIR)/floormap/*.jpg)
69
FLOORMAPFILES += $(wildcard $(SRCDIR)/floormap/*.gif)
70

71
72
73
74
ROBOTRACKFILES  = $(wildcard $(SRCDIR)/robotrack/*.php3)
ROBOTRACKFILES += $(wildcard $(SRCDIR)/robotrack/*.jpg)
ROBOTRACKFILES += $(wildcard $(SRCDIR)/robotrack/*.jar)

75
76
77
WIRELESSSTATSFILES = $(wildcard $(SRCDIR)/wireless-stats/*.php3)
WIRELESSSTATSFILES += $(wildcard $(SRCDIR)/wireless-stats/*.jar)

78
79
80
PIXFILES  = $(wildcard $(SRCDIR)/pix/*.jpg)
PIXFILES += $(wildcard $(SRCDIR)/pix/*.gif)

Leigh B. Stoller's avatar
Leigh B. Stoller committed
81
DOCFILES  = $(wildcard $(SRCDIR)/doc/*.html)
82
83
DOCFILES += $(wildcard $(SRCDIR)/doc/*.jpg)
DOCFILES += $(wildcard $(SRCDIR)/doc/*.gif)
84
DOCFILES += $(wildcard $(SRCDIR)/doc/*.php3)
85
DOCFILES += $(wildcard $(SRCDIR)/doc/*.php)
86
87
DOCFILES += $(wildcard $(SRCDIR)/doc/*.ps)
DOCFILES += $(wildcard $(SRCDIR)/doc/*.pdf)
88
89
90
91

TUTFILES  = $(wildcard $(SRCDIR)/tutorial/*.html)
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.jpg)
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.gif)
92
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.png)
93
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.php3)
94
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.php)
95
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.ns)
Leigh B. Stoller's avatar
Leigh B. Stoller committed
96
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.txt)
97
TUTFILES += $(SRCDIR)/tutorial/tb_compat.tcl
Leigh B. Stoller's avatar
Leigh B. Stoller committed
98

99
100
101
102
BUIFILES  = $(wildcard $(SRCDIR)/buildui/*.html)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.jpg)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.gif)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.php3)
103
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.php)
104
105
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.class)

106
107
108
109
110
111
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)

112
113
114
PGENIFILES = 
ifeq ($(PGENISUPPORT),1)
    PGENIFILES += $(wildcard $(SRCDIR)/protogeni/*.php3)
115
    PGENIFILES += $(wildcard $(SRCDIR)/protogeni/*.php)
116
117
    PGENIFILES += $(wildcard $(SRCDIR)/protogeni/*.xml)
endif
118

Leigh B. Stoller's avatar
Leigh B. Stoller committed
119
WEBDBFILES = $(wildcard $(SRCDIR)/webdb/*.php3)
120
WEBDBFILES += $(wildcard $(SRCDIR)/webdb/*.php)
Leigh B. Stoller's avatar
Leigh B. Stoller committed
121

122
123
124
125
126
HYFILES  = $(wildcard $(SRCDIR)/hyperviewer/*.php3)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.html)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.jpg)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.gif)

127
128
129
130
TTFILES  = $(wildcard $(SRCDIR)/timetree/*.png)
TTFILES += $(wildcard $(SRCDIR)/timetree/*.js)
TTFILES += $(wildcard $(SRCDIR)/timetree/*.css)

131
132
133
134
UMFILES  = $(wildcard $(SRCDIR)/usermap/*.php)
UMFILES += $(wildcard $(SRCDIR)/usermap/*.png)
UMFILES += $(wildcard $(SRCDIR)/usermap/*.js)

135
136
JSFILES += $(wildcard $(SRCDIR)/js/*.js)

137
138
BLOBFILES += $(wildcard blob/*.php3)

Chad Barb's avatar
Chad Barb committed
139
140
141
# 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
142
DOWNLOADFILES += $(wildcard $(SRCDIR)/downloads/*.zip)
Chad Barb's avatar
   
Chad Barb committed
143
DOWNLOADFILES += $(wildcard $(SRCDIR)/downloads/*.exe)
Chad Barb's avatar
Chad Barb committed
144

145
146
147
#
# This stuff only gets installed on the main site
#
148
ifeq ($(CVSSUPPORT),1)
149
	CVSWEBFILES  = $(wildcard $(SRCDIR)/cvsweb/*.php3)
Leigh B. Stoller's avatar
Leigh B. Stoller committed
150
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.php)
151
152
153
154
155
156
157
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.conf)
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.gif)
	CVSWEBCGI    = $(wildcard $(SRCDIR)/cvsweb/*.cgi)

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

158
159
160
161
162
163
164
165
166
167
168
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

169
170
171
172
173
ifeq ($(CHATSUPPORT),1) 
	INSTALL_OPSJABBER = $(INSTALL_DATA) $(SRCDIR)/jabber/jeti.php \
			$(INSTALL_DIR)/opsdir/www/jabber
endif

174
175
176
#
# Kill the directory part of the names. The vpath rule will do the rest.
#
177
ALLFILES  = $(notdir $(FILES))
178
ALLFLOORMAPS  = $(notdir $(FLOORMAPFILES))
179
180
181
182
183
ALLPIXES  = $(notdir $(PIXFILES))
ALLDOCS   = $(notdir $(DOCFILES))
ALLTUTS   = $(notdir $(TUTFILES))
ALLICONS  = $(notdir $(AUTOICONS))
ALLWEBDB  = $(notdir $(WEBDBFILES))
184
ALLPGENI  = $(notdir $(PGENIFILES))
Chad Barb's avatar
Chad Barb committed
185
ALLDOWNLOADS = $(notdir $(DOWNLOADFILES))
186
ALLCVSWEB = $(notdir $(CVSWEBFILES))
187
ALLOPSCVSWEB = $(notdir $(OPSCVSWEBFILES))
188
ALLBUI    = $(notdir $(BUIFILES))
189
ALLNL     = $(notdir $(NLFILES))
190
ALLHY     = $(notdir $(HYFILES))
191
ALLTT     = $(notdir $(TTFILES))
192
ALLUM     = $(notdir $(UMFILES))
193
ALLJS     = $(notdir $(JSFILES))
194
ALLROBO   = $(notdir $(ROBOTRACKFILES))
195
ALLWISTATS = $(notdir $(WIRELESSSTATSFILES))
196
ALLBLOB   = $(notdir $(BLOBFILES))
197

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

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

241
post-install:
242

243
244
boss-install:	install

245
246
247
248
249
uninstall:
	rm -f $(INSTALLFILES)

force-install:	uninstall install

250
$(INSTALL_WWWDIR)/doc/LICENSE.txt: $(TESTBED_SRCDIR)/AGPL-COPYING
251
252
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
253
254
255
256
257
258
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@)

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

260
$(INSTALL_WWWDIR)/%: %
261
	@echo "Installing $<"
262
	-mkdir -p $(patsubst %/,%,$(dir $@))
263
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 
Timothy Stack's avatar
   
Timothy Stack committed
264

265
266
267
268
269
$(INSTALL_DIR)/opsdir/www/%.html: %.html htmlinstall
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
	$(HTMLINSTALL) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 

270
271
272
273
274
$(INSTALL_DIR)/opsdir/www/%: %
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 

275
276
277
clean:		clean-subdirs
distclean:	distclean-subdirs

Timothy Stack's avatar
   
Timothy Stack committed
278
279
280
281
282
283
284
# 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)