GNUmakefile.in 7.16 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

18
include $(OBJDIR)/Makeconf
19

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

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

28
include $(TESTBED_SRCDIR)/GNUmakerules
29

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

184
post-install:
185

186
187
boss-install:	install

188
189
190
191
$(INSTALL_WWWDIR)/doc/LICENSE.txt: $(TESTBED_SRCDIR)/LICENSE
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 
192

193
$(INSTALL_WWWDIR)/%: %
194
	@echo "Installing $<"
195
	-mkdir -p $(patsubst %/,%,$(dir $@))
196
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 
Timothy Stack's avatar
   
Timothy Stack committed
197

198
199
200
201
202
$(INSTALL_DIR)/opsdir/www/%: %
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 

Timothy Stack's avatar
   
Timothy Stack committed
203
204
205
206
207
208
209
# 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)