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

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

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

78
79
80
81
BUIFILES  = $(wildcard $(SRCDIR)/buildui/*.html)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.jpg)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.gif)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.php3)
82
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.php)
83
84
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.class)

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

94
95
96
97
98
HYFILES  = $(wildcard $(SRCDIR)/hyperviewer/*.php3)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.html)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.jpg)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.gif)

99
100
101
USRPFILES  = $(wildcard $(SRCDIR)/usrp/*.php)
USRPFILES += $(wildcard $(SRCDIR)/usrp/*.html)

Chad Barb's avatar
Chad Barb committed
102
103
104
# 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
105
DOWNLOADFILES += $(wildcard $(SRCDIR)/downloads/*.zip)
Chad Barb's avatar
   
Chad Barb committed
106
DOWNLOADFILES += $(wildcard $(SRCDIR)/downloads/*.exe)
Chad Barb's avatar
Chad Barb committed
107

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

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

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

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

161
post-install:
162

163

164
$(INSTALL_WWWDIR)/%: %
165
	@echo "Installing $<"
166
	-mkdir -p $(patsubst %/,%,$(dir $@))
167
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 
Timothy Stack's avatar
   
Timothy Stack committed
168
169
170
171
172
173
174
175

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