GNUmakefile.in 9.27 KB
Newer Older
1
#
2
# EMULAB-COPYRIGHT
3
# Copyright (c) 2000-2011 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

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

22
include $(OBJDIR)/Makeconf
23

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

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

33
include $(TESTBED_SRCDIR)/GNUmakerules
34

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

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

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

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

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

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

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

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

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

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

111 112
PGENIFILES = $(wildcard $(SRCDIR)/protogeni/*.php3)

Leigh B. Stoller's avatar
Leigh B. Stoller committed
113
WEBDBFILES = $(wildcard $(SRCDIR)/webdb/*.php3)
114
WEBDBFILES += $(wildcard $(SRCDIR)/webdb/*.php)
Leigh B. Stoller's avatar
Leigh B. Stoller committed
115

116 117 118 119 120
HYFILES  = $(wildcard $(SRCDIR)/hyperviewer/*.php3)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.html)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.jpg)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.gif)

121 122 123 124
TTFILES  = $(wildcard $(SRCDIR)/timetree/*.png)
TTFILES += $(wildcard $(SRCDIR)/timetree/*.js)
TTFILES += $(wildcard $(SRCDIR)/timetree/*.css)

125 126 127 128
UMFILES  = $(wildcard $(SRCDIR)/usermap/*.php)
UMFILES += $(wildcard $(SRCDIR)/usermap/*.png)
UMFILES += $(wildcard $(SRCDIR)/usermap/*.js)

129 130
JSFILES += $(wildcard $(SRCDIR)/js/*.js)

131 132
BLOBFILES += $(wildcard blob/*.php3)

Chad Barb's avatar
Chad Barb committed
133 134 135
# 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
136
DOWNLOADFILES += $(wildcard $(SRCDIR)/downloads/*.zip)
Chad Barb's avatar
 
Chad Barb committed
137
DOWNLOADFILES += $(wildcard $(SRCDIR)/downloads/*.exe)
Chad Barb's avatar
Chad Barb committed
138

139 140 141
#
# This stuff only gets installed on the main site
#
142
ifeq ($(CVSSUPPORT),1)
143
	CVSWEBFILES  = $(wildcard $(SRCDIR)/cvsweb/*.php3)
Leigh B. Stoller's avatar
Leigh B. Stoller committed
144
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.php)
145 146 147 148 149 150 151
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.conf)
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.gif)
	CVSWEBCGI    = $(wildcard $(SRCDIR)/cvsweb/*.cgi)

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

152 153 154 155 156 157 158 159 160 161 162
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

163 164 165 166 167
ifeq ($(CHATSUPPORT),1) 
	INSTALL_OPSJABBER = $(INSTALL_DATA) $(SRCDIR)/jabber/jeti.php \
			$(INSTALL_DIR)/opsdir/www/jabber
endif

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

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

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

235
post-install:
236

237 238
boss-install:	install

239 240 241 242 243
uninstall:
	rm -f $(INSTALLFILES)

force-install:	uninstall install

244
$(INSTALL_WWWDIR)/doc/LICENSE.txt: $(TESTBED_SRCDIR)/AGPL-COPYING
245 246
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
247 248 249 250 251 252
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@)

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

254
$(INSTALL_WWWDIR)/%: %
255
	@echo "Installing $<"
256
	-mkdir -p $(patsubst %/,%,$(dir $@))
257
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 
Timothy Stack's avatar
 
Timothy Stack committed
258

259 260 261 262 263
$(INSTALL_DIR)/opsdir/www/%.html: %.html htmlinstall
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
	$(HTMLINSTALL) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 

264 265 266 267 268
$(INSTALL_DIR)/opsdir/www/%: %
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 

269 270 271
clean:		clean-subdirs
distclean:	distclean-subdirs

Timothy Stack's avatar
 
Timothy Stack committed
272 273 274 275 276 277 278
# 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)