GNUmakefile.in 8.05 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
PIXFILES  = $(wildcard $(SRCDIR)/pix/*.jpg)
PIXFILES += $(wildcard $(SRCDIR)/pix/*.gif)

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

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

89
90
91
92
BUIFILES  = $(wildcard $(SRCDIR)/buildui/*.html)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.jpg)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.gif)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.php3)
93
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.php)
94
95
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.class)

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

105
106
107
108
109
HYFILES  = $(wildcard $(SRCDIR)/hyperviewer/*.php3)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.html)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.jpg)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.gif)

110
111
SDRFILES  = $(wildcard $(SRCDIR)/sdr/*.php3)
SDRFILES += $(wildcard $(SRCDIR)/sdr/*.html)
112

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

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

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

132
133
134
135
136
137
138
139
140
141
142
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

143
144
145
146
147
ifeq ($(CHATSUPPORT),1) 
	INSTALL_OPSJABBER = $(INSTALL_DATA) $(SRCDIR)/jabber/jeti.php \
			$(INSTALL_DIR)/opsdir/www/jabber
endif

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

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

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

203
post-install:
204

205
206
boss-install:	install

207
208
209
210
211
uninstall:
	rm -f $(INSTALLFILES)

force-install:	uninstall install

212
213
214
$(INSTALL_WWWDIR)/doc/LICENSE.txt: $(TESTBED_SRCDIR)/LICENSE
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
215
216
217
218
219
220
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@)

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

222
$(INSTALL_WWWDIR)/%: %
223
	@echo "Installing $<"
224
	-mkdir -p $(patsubst %/,%,$(dir $@))
225
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 
Timothy Stack's avatar
   
Timothy Stack committed
226

227
228
229
230
231
$(INSTALL_DIR)/opsdir/www/%.html: %.html htmlinstall
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
	$(HTMLINSTALL) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 

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

Timothy Stack's avatar
   
Timothy Stack committed
237
238
239
240
241
242
243
# 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)