GNUmakefile.in 8.29 KB
Newer Older
1
#
2
# EMULAB-COPYRIGHT
Timothy Stack's avatar
   
Timothy Stack committed
3
# Copyright (c) 2000-2005 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

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

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)
51
52
53
54
55
56
FILES  += $(SRCDIR)/.htaccess $(SRCDIR)/error.shtml \
	  $(SRCDIR)/ssh-mime.pl $(SRCDIR)/rdp-mime.pl \
	  $(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 \
	  $(SRCDIR)/emulab-mime-winxp.zip $(SRCDIR)/emulab-mime-winxp.reg
57

58
59
60
AUTOICONS  = $(wildcard $(SRCDIR)/autostatus-icons/*.gif)
AUTOICONS += $(wildcard $(SRCDIR)/autostatus-icons/*.png)

61
FLOORMAPFILES  = $(wildcard $(SRCDIR)/floormap/*.jpg)
62
FLOORMAPFILES += $(wildcard $(SRCDIR)/floormap/*.gif)
63

64
65
66
67
ROBOTRACKFILES  = $(wildcard $(SRCDIR)/robotrack/*.php3)
ROBOTRACKFILES += $(wildcard $(SRCDIR)/robotrack/*.jpg)
ROBOTRACKFILES += $(wildcard $(SRCDIR)/robotrack/*.jar)

68
69
70
WIRELESSSTATSFILES = $(wildcard $(SRCDIR)/wireless-stats/*.php3)
WIRELESSSTATSFILES += $(wildcard $(SRCDIR)/wireless-stats/*.jar)

71
72
73
PIXFILES  = $(wildcard $(SRCDIR)/pix/*.jpg)
PIXFILES += $(wildcard $(SRCDIR)/pix/*.gif)

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

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

92
93
94
95
BUIFILES  = $(wildcard $(SRCDIR)/buildui/*.html)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.jpg)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.gif)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.php3)
96
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.php)
97
98
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.class)

99
100
101
102
103
104
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
105
WEBDBFILES = $(wildcard $(SRCDIR)/webdb/*.php3)
106
WEBDBFILES += $(wildcard $(SRCDIR)/webdb/*.php)
Leigh B. Stoller's avatar
Leigh B. Stoller committed
107

108
109
110
111
112
HYFILES  = $(wildcard $(SRCDIR)/hyperviewer/*.php3)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.html)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.jpg)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.gif)

113
114
SDRFILES  = $(wildcard $(SRCDIR)/sdr/*.php3)
SDRFILES += $(wildcard $(SRCDIR)/sdr/*.html)
115

Chad Barb's avatar
Chad Barb committed
116
117
118
# 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
119
DOWNLOADFILES += $(wildcard $(SRCDIR)/downloads/*.zip)
Chad Barb's avatar
   
Chad Barb committed
120
DOWNLOADFILES += $(wildcard $(SRCDIR)/downloads/*.exe)
Chad Barb's avatar
Chad Barb committed
121

122
123
124
#
# This stuff only gets installed on the main site
#
125
ifeq ($(CVSSUPPORT),1)
126
	CVSWEBFILES  = $(wildcard $(SRCDIR)/cvsweb/*.php3)
Leigh B. Stoller's avatar
Leigh B. Stoller committed
127
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.php)
128
129
130
131
132
133
134
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.conf)
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.gif)
	CVSWEBCGI    = $(wildcard $(SRCDIR)/cvsweb/*.cgi)

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

135
136
137
138
139
140
141
142
143
144
145
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

146
147
148
149
150
ifeq ($(CHATSUPPORT),1) 
	INSTALL_OPSJABBER = $(INSTALL_DATA) $(SRCDIR)/jabber/jeti.php \
			$(INSTALL_DIR)/opsdir/www/jabber
endif

151
152
153
#
# Kill the directory part of the names. The vpath rule will do the rest.
#
154
ALLFILES  = $(notdir $(FILES))
155
ALLFLOORMAPS  = $(notdir $(FLOORMAPFILES))
156
157
158
159
160
ALLPIXES  = $(notdir $(PIXFILES))
ALLDOCS   = $(notdir $(DOCFILES))
ALLTUTS   = $(notdir $(TUTFILES))
ALLICONS  = $(notdir $(AUTOICONS))
ALLWEBDB  = $(notdir $(WEBDBFILES))
Chad Barb's avatar
Chad Barb committed
161
ALLDOWNLOADS = $(notdir $(DOWNLOADFILES))
162
ALLCVSWEB = $(notdir $(CVSWEBFILES))
163
ALLOPSCVSWEB = $(notdir $(OPSCVSWEBFILES))
164
ALLBUI    = $(notdir $(BUIFILES))
165
ALLNL     = $(notdir $(NLFILES))
166
ALLHY     = $(notdir $(HYFILES))
167
ALLSDR   = $(notdir $(SDRFILES))
168
ALLROBO   = $(notdir $(ROBOTRACKFILES))
169
ALLWISTATS = $(notdir $(WIRELESSSTATSFILES))
170

171
INSTALLFILES = $(addprefix $(INSTALL_SBINDIR)/, htmlinstall) \
172
	$(addprefix $(INSTALL_WWWDIR)/, $(ALLFILES)) \
173
	$(addprefix $(INSTALL_WWWDIR)/floormap/, $(ALLFLOORMAPS)) \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
174
	$(addprefix $(INSTALL_WWWDIR)/pix/, $(ALLPIXES)) \
175
	$(addprefix $(INSTALL_WWWDIR)/tutorial/, $(ALLTUTS)) \
176
	$(addprefix $(INSTALL_WWWDIR)/doc/, $(ALLDOCS)) \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
177
	$(addprefix $(INSTALL_WWWDIR)/webdb/, $(ALLWEBDB)) \
Chad Barb's avatar
Chad Barb committed
178
	$(addprefix $(INSTALL_WWWDIR)/downloads/, $(ALLDOWNLOADS)) \
179
	$(addprefix $(INSTALL_WWWDIR)/buildui/, $(ALLBUI)) \
180
	$(addprefix $(INSTALL_WWWDIR)/netlab/, $(ALLNL)) \
181
	$(addprefix $(INSTALL_WWWDIR)/hyperviewer/, $(ALLHY)) \
182
	$(addprefix $(INSTALL_WWWDIR)/sdr/, $(ALLSDR)) \
183
	$(addprefix $(INSTALL_WWWDIR)/robotrack/, $(ALLROBO)) \
184
	$(addprefix $(INSTALL_WWWDIR)/wireless-stats/, $(ALLWISTATS)) \
185
	$(addprefix $(INSTALL_WWWDIR)/autostatus-icons/, $(ALLICONS)) \
186
	$(addprefix $(INSTALL_LIBEXECDIR)/, websearch) \
187
	$(addprefix $(INSTALL_SBINDIR)/, htmlinstall) \
188
	$(addprefix $(INSTALL_WWWDIR)/cvsweb/, $(ALLCVSWEB)) \
189
	$(addprefix $(INSTALL_DIR)/opsdir/www/cvsweb/, $(ALLOPSCVSWEB)) \
190
	$(INSTALL_WWWDIR)/doc/LICENSE.txt \
191
	$(addprefix $(INSTALL_ETCDIR)/, swish.conf)
192
193

install: $(INSTALLFILES)
194
	(swish-e -c ./swish.conf)
195
196
	cd $(INSTALL_WWWDIR) && \
		rm -f tbdb.html; \
197
198
199
		ln -s index.html tbdb.html; \
		rm -f icons; \
		ln -s /usr/local/www/icons icons;
200
201
202
203
ifeq ($(CHATSUPPORT),1) 
	-mkdir -p $(INSTALL_DIR)/opsdir/www/jabber
	$(INSTALL_OPSJABBER)
endif
204
205
206
	$(INSTALL_CVSWEBCGI)
	$(INSTALL_OPSCVSWEBCONF)
	$(INSTALL_OPSCVSWEBCGI)
207

208
post-install:
209

210
211
boss-install:	install

212
213
214
215
216
uninstall:
	rm -f $(INSTALLFILES)

force-install:	uninstall install

217
218
219
$(INSTALL_WWWDIR)/doc/LICENSE.txt: $(TESTBED_SRCDIR)/LICENSE
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
220
221
222
223
224
225
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@)

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

227
$(INSTALL_WWWDIR)/%: %
228
	@echo "Installing $<"
229
	-mkdir -p $(patsubst %/,%,$(dir $@))
230
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 
Timothy Stack's avatar
   
Timothy Stack committed
231

232
233
234
235
236
$(INSTALL_DIR)/opsdir/www/%.html: %.html htmlinstall
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
	$(HTMLINSTALL) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 

237
238
239
240
241
$(INSTALL_DIR)/opsdir/www/%: %
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 

Timothy Stack's avatar
   
Timothy Stack committed
242
243
244
245
246
247
248
# 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)