GNUmakefile.in 6.43 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 16
#
# A hack for only installing some things if installing on the main site
#
MAINSITE        = emulab.net
OURDOMAIN       = @OURDOMAIN@

17
include $(OBJDIR)/Makeconf
18

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

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

27
include $(TESTBED_SRCDIR)/GNUmakerules
28

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

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

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

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

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

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

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

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

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

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

103
USRPFILES  = $(wildcard $(SRCDIR)/usrp/*.php3)
104 105
USRPFILES += $(wildcard $(SRCDIR)/usrp/*.html)

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

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

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

125 126 127
#
# Kill the directory part of the names. The vpath rule will do the rest.
#
128
ALLFILES  = $(notdir $(FILES))
129
ALLFLOORMAPS  = $(notdir $(FLOORMAPFILES))
130 131 132 133 134
ALLPIXES  = $(notdir $(PIXFILES))
ALLDOCS   = $(notdir $(DOCFILES))
ALLTUTS   = $(notdir $(TUTFILES))
ALLICONS  = $(notdir $(AUTOICONS))
ALLWEBDB  = $(notdir $(WEBDBFILES))
Chad Barb's avatar
Chad Barb committed
135
ALLDOWNLOADS = $(notdir $(DOWNLOADFILES))
136 137
ALLCVSWEB = $(notdir $(CVSWEBFILES))
ALLBUI    = $(notdir $(BUIFILES))
138
ALLNL     = $(notdir $(NLFILES))
139
ALLHY     = $(notdir $(HYFILES))
140
ALLUSRP   = $(notdir $(USRPFILES))
141
ALLROBO   = $(notdir $(ROBOTRACKFILES))
142 143

install: $(addprefix $(INSTALL_WWWDIR)/, $(ALLFILES)) \
144
	$(addprefix $(INSTALL_WWWDIR)/floormap/, $(ALLFLOORMAPS)) \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
145
	$(addprefix $(INSTALL_WWWDIR)/pix/, $(ALLPIXES)) \
146
	$(addprefix $(INSTALL_WWWDIR)/tutorial/, $(ALLTUTS)) \
147
	$(addprefix $(INSTALL_WWWDIR)/doc/, $(ALLDOCS)) \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
148
	$(addprefix $(INSTALL_WWWDIR)/webdb/, $(ALLWEBDB)) \
Chad Barb's avatar
Chad Barb committed
149
	$(addprefix $(INSTALL_WWWDIR)/downloads/, $(ALLDOWNLOADS)) \
150
	$(addprefix $(INSTALL_WWWDIR)/buildui/, $(ALLBUI)) \
151
	$(addprefix $(INSTALL_WWWDIR)/netlab/, $(ALLNL)) \
152
	$(addprefix $(INSTALL_WWWDIR)/hyperviewer/, $(ALLHY)) \
153
	$(addprefix $(INSTALL_WWWDIR)/usrp/, $(ALLUSRP)) \
154
	$(addprefix $(INSTALL_WWWDIR)/robotrack/, $(ALLROBO)) \
155
	$(addprefix $(INSTALL_WWWDIR)/autostatus-icons/, $(ALLICONS)) \
156
	$(addprefix $(INSTALL_LIBEXECDIR)/, websearch) \
157
	$(addprefix $(INSTALL_WWWDIR)/cvsweb/, $(ALLCVSWEB)) \
158
	$(INSTALL_WWWDIR)/doc/LICENSE.txt \
159
	$(addprefix $(INSTALL_ETCDIR)/, swish.conf)
160
	(swish-e -c ./swish.conf)
161 162
	cd $(INSTALL_WWWDIR) && \
		rm -f tbdb.html; \
163 164 165
		ln -s index.html tbdb.html; \
		rm -f icons; \
		ln -s /usr/local/www/icons icons;
166
		$(INSTALL_CVSWEBCGI)
167

168
post-install:
169

170 171
boss-install:	install

172 173 174 175
$(INSTALL_WWWDIR)/doc/LICENSE.txt: $(TESTBED_SRCDIR)/LICENSE
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 
176

177
$(INSTALL_WWWDIR)/%: %
178
	@echo "Installing $<"
179
	-mkdir -p $(patsubst %/,%,$(dir $@))
180
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 
Timothy Stack's avatar
 
Timothy Stack committed
181 182 183 184 185 186 187 188

# 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)