GNUmakefile.in 7.45 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
include $(OBJDIR)/Makeconf
20

Timothy Stack's avatar
   
Timothy Stack committed
21
22
SUBDIRS = garcia-telemetry

23
24
25
26
#
# Force dependencies to make sure configure regenerates if the .in file
# is changed.
# 
Timothy Stack's avatar
   
Timothy Stack committed
27
all: defs.php3 dbdefs.php3 swish.conf websearch xmlrpc.php3 all-subdirs
28

29
include $(TESTBED_SRCDIR)/GNUmakerules
30

31
32
33
#
# Generate a list of all the files we want to install from the current
# directory and the source directory. 
34
#
35
FILES	= $(wildcard *.css *.jpg *.gif *.png *.html *.php3 *.php *.ico *.jar)
36
37
FILES  += $(wildcard $(SRCDIR)/*.css)
FILES  += $(wildcard $(SRCDIR)/*.jpg)
Chad Barb's avatar
   
Chad Barb committed
38
FILES  += $(wildcard $(SRCDIR)/*.png)
39
40
41
FILES  += $(wildcard $(SRCDIR)/*.gif)
FILES  += $(wildcard $(SRCDIR)/*.html)
FILES  += $(wildcard $(SRCDIR)/*.php3)
42
FILES  += $(wildcard $(SRCDIR)/*.php)
43
FILES  += $(wildcard $(SRCDIR)/*.ico)
Timothy Stack's avatar
   
Timothy Stack committed
44
FILES  += $(wildcard $(SRCDIR)/*.class)
Timothy Stack's avatar
   
Timothy Stack committed
45
FILES  += $(wildcard $(SRCDIR)/*.jar)
Timothy Stack's avatar
   
Timothy Stack committed
46
FILES  += $(wildcard $(SRCDIR)/*.js)
47
48
49
50
51
52
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
53

54
55
56
AUTOICONS  = $(wildcard $(SRCDIR)/autostatus-icons/*.gif)
AUTOICONS += $(wildcard $(SRCDIR)/autostatus-icons/*.png)

57
FLOORMAPFILES  = $(wildcard $(SRCDIR)/floormap/*.jpg)
58
FLOORMAPFILES += $(wildcard $(SRCDIR)/floormap/*.gif)
59

60
61
62
63
ROBOTRACKFILES  = $(wildcard $(SRCDIR)/robotrack/*.php3)
ROBOTRACKFILES += $(wildcard $(SRCDIR)/robotrack/*.jpg)
ROBOTRACKFILES += $(wildcard $(SRCDIR)/robotrack/*.jar)

64
65
66
PIXFILES  = $(wildcard $(SRCDIR)/pix/*.jpg)
PIXFILES += $(wildcard $(SRCDIR)/pix/*.gif)

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

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

85
86
87
88
BUIFILES  = $(wildcard $(SRCDIR)/buildui/*.html)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.jpg)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.gif)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.php3)
89
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.php)
90
91
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.class)

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

101
102
103
104
105
HYFILES  = $(wildcard $(SRCDIR)/hyperviewer/*.php3)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.html)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.jpg)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.gif)

106
107
SDRFILES  = $(wildcard $(SRCDIR)/sdr/*.php3)
SDRFILES += $(wildcard $(SRCDIR)/sdr/*.html)
108

Chad Barb's avatar
Chad Barb committed
109
110
111
# 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
112
DOWNLOADFILES += $(wildcard $(SRCDIR)/downloads/*.zip)
Chad Barb's avatar
   
Chad Barb committed
113
DOWNLOADFILES += $(wildcard $(SRCDIR)/downloads/*.exe)
Chad Barb's avatar
Chad Barb committed
114

115
116
117
118
119
#
# This stuff only gets installed on the main site
#
ifeq ($(OURDOMAIN),$(MAINSITE)) 
	CVSWEBFILES  = $(wildcard $(SRCDIR)/cvsweb/*.php3)
Leigh B. Stoller's avatar
Leigh B. Stoller committed
120
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.php)
121
122
123
124
125
126
127
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.conf)
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.gif)
	CVSWEBCGI    = $(wildcard $(SRCDIR)/cvsweb/*.cgi)

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

128
129
130
131
132
133
134
135
136
137
138
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

139
140
141
142
143
ifeq ($(CHATSUPPORT),1) 
	INSTALL_OPSJABBER = $(INSTALL_DATA) $(SRCDIR)/jabber/jeti.php \
			$(INSTALL_DIR)/opsdir/www/jabber
endif

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

install: $(addprefix $(INSTALL_WWWDIR)/, $(ALLFILES)) \
164
	$(addprefix $(INSTALL_WWWDIR)/floormap/, $(ALLFLOORMAPS)) \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
165
	$(addprefix $(INSTALL_WWWDIR)/pix/, $(ALLPIXES)) \
166
	$(addprefix $(INSTALL_WWWDIR)/tutorial/, $(ALLTUTS)) \
167
	$(addprefix $(INSTALL_WWWDIR)/doc/, $(ALLDOCS)) \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
168
	$(addprefix $(INSTALL_WWWDIR)/webdb/, $(ALLWEBDB)) \
Chad Barb's avatar
Chad Barb committed
169
	$(addprefix $(INSTALL_WWWDIR)/downloads/, $(ALLDOWNLOADS)) \
170
	$(addprefix $(INSTALL_WWWDIR)/buildui/, $(ALLBUI)) \
171
	$(addprefix $(INSTALL_WWWDIR)/netlab/, $(ALLNL)) \
172
	$(addprefix $(INSTALL_WWWDIR)/hyperviewer/, $(ALLHY)) \
173
	$(addprefix $(INSTALL_WWWDIR)/sdr/, $(ALLSDR)) \
174
	$(addprefix $(INSTALL_WWWDIR)/robotrack/, $(ALLROBO)) \
175
	$(addprefix $(INSTALL_WWWDIR)/autostatus-icons/, $(ALLICONS)) \
176
	$(addprefix $(INSTALL_LIBEXECDIR)/, websearch) \
177
	$(addprefix $(INSTALL_WWWDIR)/cvsweb/, $(ALLCVSWEB)) \
178
	$(addprefix $(INSTALL_DIR)/opsdir/www/cvsweb/, $(ALLOPSCVSWEB)) \
179
	$(INSTALL_WWWDIR)/doc/LICENSE.txt \
180
	$(addprefix $(INSTALL_ETCDIR)/, swish.conf)
181
	(swish-e -c ./swish.conf)
182
183
	cd $(INSTALL_WWWDIR) && \
		rm -f tbdb.html; \
184
185
186
		ln -s index.html tbdb.html; \
		rm -f icons; \
		ln -s /usr/local/www/icons icons;
187
188
189
190
ifeq ($(CHATSUPPORT),1) 
	-mkdir -p $(INSTALL_DIR)/opsdir/www/jabber
	$(INSTALL_OPSJABBER)
endif
191
192
193
	$(INSTALL_CVSWEBCGI)
	$(INSTALL_OPSCVSWEBCONF)
	$(INSTALL_OPSCVSWEBCGI)
194

195
post-install:
196

197
198
boss-install:	install

199
200
201
202
$(INSTALL_WWWDIR)/doc/LICENSE.txt: $(TESTBED_SRCDIR)/LICENSE
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 
203

204
$(INSTALL_WWWDIR)/%: %
205
	@echo "Installing $<"
206
	-mkdir -p $(patsubst %/,%,$(dir $@))
207
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 
Timothy Stack's avatar
   
Timothy Stack committed
208

209
210
211
212
213
$(INSTALL_DIR)/opsdir/www/%: %
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 

Timothy Stack's avatar
   
Timothy Stack committed
214
215
216
217
218
219
220
# 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)