GNUmakefile.in 8.62 KB
Newer Older
1
#
2
# EMULAB-COPYRIGHT
Timothy Stack's avatar
   
Timothy Stack committed
3
# Copyright (c) 2000-2006 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 \
Timothy Stack's avatar
   
Timothy Stack committed
31
	xmlrpcpipe.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)/ssh-mime.scpt \
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)/favicon.ico
60

61
62
63
AUTOICONS  = $(wildcard $(SRCDIR)/autostatus-icons/*.gif)
AUTOICONS += $(wildcard $(SRCDIR)/autostatus-icons/*.png)

64
FLOORMAPFILES  = $(wildcard $(SRCDIR)/floormap/*.jpg)
65
FLOORMAPFILES += $(wildcard $(SRCDIR)/floormap/*.gif)
66

67
68
69
70
ROBOTRACKFILES  = $(wildcard $(SRCDIR)/robotrack/*.php3)
ROBOTRACKFILES += $(wildcard $(SRCDIR)/robotrack/*.jpg)
ROBOTRACKFILES += $(wildcard $(SRCDIR)/robotrack/*.jar)

71
72
73
WIRELESSSTATSFILES = $(wildcard $(SRCDIR)/wireless-stats/*.php3)
WIRELESSSTATSFILES += $(wildcard $(SRCDIR)/wireless-stats/*.jar)

74
75
76
PIXFILES  = $(wildcard $(SRCDIR)/pix/*.jpg)
PIXFILES += $(wildcard $(SRCDIR)/pix/*.gif)

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

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

95
96
97
98
BUIFILES  = $(wildcard $(SRCDIR)/buildui/*.html)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.jpg)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.gif)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.php3)
99
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.php)
100
101
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.class)

102
103
104
105
106
107
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)

Leigh B. Stoller's avatar
Leigh B. Stoller committed
108
WEBDBFILES = $(wildcard $(SRCDIR)/webdb/*.php3)
109
WEBDBFILES += $(wildcard $(SRCDIR)/webdb/*.php)
Leigh B. Stoller's avatar
Leigh B. Stoller committed
110

111
112
113
114
115
HYFILES  = $(wildcard $(SRCDIR)/hyperviewer/*.php3)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.html)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.jpg)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.gif)

116
117
118
119
120
121
TTFILES  = $(wildcard $(SRCDIR)/timetree/*.png)
TTFILES += $(wildcard $(SRCDIR)/timetree/*.js)
TTFILES += $(wildcard $(SRCDIR)/timetree/*.css)

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

Chad Barb's avatar
Chad Barb committed
122
123
124
# 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
125
DOWNLOADFILES += $(wildcard $(SRCDIR)/downloads/*.zip)
Chad Barb's avatar
   
Chad Barb committed
126
DOWNLOADFILES += $(wildcard $(SRCDIR)/downloads/*.exe)
Chad Barb's avatar
Chad Barb committed
127

128
129
130
#
# This stuff only gets installed on the main site
#
131
ifeq ($(CVSSUPPORT),1)
132
	CVSWEBFILES  = $(wildcard $(SRCDIR)/cvsweb/*.php3)
Leigh B. Stoller's avatar
Leigh B. Stoller committed
133
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.php)
134
135
136
137
138
139
140
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.conf)
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.gif)
	CVSWEBCGI    = $(wildcard $(SRCDIR)/cvsweb/*.cgi)

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

141
142
143
144
145
146
147
148
149
150
151
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

152
153
154
155
156
ifeq ($(CHATSUPPORT),1) 
	INSTALL_OPSJABBER = $(INSTALL_DATA) $(SRCDIR)/jabber/jeti.php \
			$(INSTALL_DIR)/opsdir/www/jabber
endif

157
158
159
#
# Kill the directory part of the names. The vpath rule will do the rest.
#
160
ALLFILES  = $(notdir $(FILES))
161
ALLFLOORMAPS  = $(notdir $(FLOORMAPFILES))
162
163
164
165
166
ALLPIXES  = $(notdir $(PIXFILES))
ALLDOCS   = $(notdir $(DOCFILES))
ALLTUTS   = $(notdir $(TUTFILES))
ALLICONS  = $(notdir $(AUTOICONS))
ALLWEBDB  = $(notdir $(WEBDBFILES))
Chad Barb's avatar
Chad Barb committed
167
ALLDOWNLOADS = $(notdir $(DOWNLOADFILES))
168
ALLCVSWEB = $(notdir $(CVSWEBFILES))
169
ALLOPSCVSWEB = $(notdir $(OPSCVSWEBFILES))
170
ALLBUI    = $(notdir $(BUIFILES))
171
ALLNL     = $(notdir $(NLFILES))
172
ALLHY     = $(notdir $(HYFILES))
173
174
ALLTT     = $(notdir $(TTFILES))
ALLJS     = $(notdir $(JSFILES))
175
ALLROBO   = $(notdir $(ROBOTRACKFILES))
176
ALLWISTATS = $(notdir $(WIRELESSSTATSFILES))
177

178
INSTALLFILES = $(addprefix $(INSTALL_SBINDIR)/, htmlinstall) \
179
	$(addprefix $(INSTALL_WWWDIR)/, $(ALLFILES)) \
180
	$(addprefix $(INSTALL_WWWDIR)/floormap/, $(ALLFLOORMAPS)) \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
181
	$(addprefix $(INSTALL_WWWDIR)/pix/, $(ALLPIXES)) \
182
	$(addprefix $(INSTALL_WWWDIR)/tutorial/, $(ALLTUTS)) \
183
	$(addprefix $(INSTALL_WWWDIR)/doc/, $(ALLDOCS)) \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
184
	$(addprefix $(INSTALL_WWWDIR)/webdb/, $(ALLWEBDB)) \
Chad Barb's avatar
Chad Barb committed
185
	$(addprefix $(INSTALL_WWWDIR)/downloads/, $(ALLDOWNLOADS)) \
186
	$(addprefix $(INSTALL_WWWDIR)/buildui/, $(ALLBUI)) \
187
	$(addprefix $(INSTALL_WWWDIR)/netlab/, $(ALLNL)) \
188
	$(addprefix $(INSTALL_WWWDIR)/hyperviewer/, $(ALLHY)) \
189
190
	$(addprefix $(INSTALL_WWWDIR)/timetree/, $(ALLTT)) \
	$(addprefix $(INSTALL_WWWDIR)/js/, $(ALLJS)) \
191
	$(addprefix $(INSTALL_WWWDIR)/robotrack/, $(ALLROBO)) \
192
	$(addprefix $(INSTALL_WWWDIR)/wireless-stats/, $(ALLWISTATS)) \
193
	$(addprefix $(INSTALL_WWWDIR)/autostatus-icons/, $(ALLICONS)) \
194
	$(addprefix $(INSTALL_LIBEXECDIR)/, websearch) \
195
	$(addprefix $(INSTALL_SBINDIR)/, htmlinstall) \
196
	$(addprefix $(INSTALL_WWWDIR)/cvsweb/, $(ALLCVSWEB)) \
197
	$(addprefix $(INSTALL_DIR)/opsdir/www/cvsweb/, $(ALLOPSCVSWEB)) \
198
	$(INSTALL_WWWDIR)/doc/LICENSE.txt \
199
	$(addprefix $(INSTALL_ETCDIR)/, swish.conf)
200
201

install: $(INSTALLFILES)
202
	(swish-e -c ./swish.conf)
203
204
	cd $(INSTALL_WWWDIR) && \
		rm -f tbdb.html; \
205
206
207
		ln -s index.html tbdb.html; \
		rm -f icons; \
		ln -s /usr/local/www/icons icons;
208
209
210
211
ifeq ($(CHATSUPPORT),1) 
	-mkdir -p $(INSTALL_DIR)/opsdir/www/jabber
	$(INSTALL_OPSJABBER)
endif
212
213
214
	$(INSTALL_CVSWEBCGI)
	$(INSTALL_OPSCVSWEBCONF)
	$(INSTALL_OPSCVSWEBCGI)
215

216
post-install:
217

218
219
boss-install:	install

220
221
222
223
224
uninstall:
	rm -f $(INSTALLFILES)

force-install:	uninstall install

225
226
227
$(INSTALL_WWWDIR)/doc/LICENSE.txt: $(TESTBED_SRCDIR)/LICENSE
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
228
229
230
231
232
233
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@)

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

235
$(INSTALL_WWWDIR)/%: %
236
	@echo "Installing $<"
237
	-mkdir -p $(patsubst %/,%,$(dir $@))
238
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 
Timothy Stack's avatar
   
Timothy Stack committed
239

240
241
242
243
244
$(INSTALL_DIR)/opsdir/www/%.html: %.html htmlinstall
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
	$(HTMLINSTALL) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 

245
246
247
248
249
$(INSTALL_DIR)/opsdir/www/%: %
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 

250
251
252
clean:		clean-subdirs
distclean:	distclean-subdirs

Timothy Stack's avatar
   
Timothy Stack committed
253
254
255
256
257
258
259
# 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)