GNUmakefile.in 7.41 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)
46
47
48
49
50
51
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
52

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

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

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

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

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

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

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

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

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

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

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

114
115
116
117
118
#
# 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
119
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.php)
120
121
122
123
124
125
126
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.conf)
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.gif)
	CVSWEBCGI    = $(wildcard $(SRCDIR)/cvsweb/*.cgi)

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

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

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

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

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

194
post-install:
195

196
197
boss-install:	install

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

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

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

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