GNUmakefile.in 5.42 KB
Newer Older
1
#
2
# EMULAB-COPYRIGHT
3
# Copyright (c) 2000-2004 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

19
20
21
22
#
# Force dependencies to make sure configure regenerates if the .in file
# is changed.
# 
23
all: defs.php3 dbdefs.php3 swish.conf websearch
24

25
include $(TESTBED_SRCDIR)/GNUmakerules
26

27
28
29
#
# Generate a list of all the files we want to install from the current
# directory and the source directory. 
30
#
31
FILES	= $(wildcard *.css *.jpg *.gif *.png *.html *.php3 *.php *.ico)
32
33
FILES  += $(wildcard $(SRCDIR)/*.css)
FILES  += $(wildcard $(SRCDIR)/*.jpg)
Chad Barb's avatar
   
Chad Barb committed
34
FILES  += $(wildcard $(SRCDIR)/*.png)
35
36
37
FILES  += $(wildcard $(SRCDIR)/*.gif)
FILES  += $(wildcard $(SRCDIR)/*.html)
FILES  += $(wildcard $(SRCDIR)/*.php3)
38
FILES  += $(wildcard $(SRCDIR)/*.php)
39
FILES  += $(wildcard $(SRCDIR)/*.ico)
Timothy Stack's avatar
   
Timothy Stack committed
40
FILES  += $(wildcard $(SRCDIR)/*.class)
41
FILES  += $(SRCDIR)/.htaccess $(SRCDIR)/error.shtml $(SRCDIR)/ssh-mime.pl \
42
	  $(SRCDIR)/ssh-mime-windows.pl $(SRCDIR)/rdp-mime.pl
43

44
45
46
AUTOICONS  = $(wildcard $(SRCDIR)/autostatus-icons/*.gif)
AUTOICONS += $(wildcard $(SRCDIR)/autostatus-icons/*.png)

47
FLOORMAPFILES  = $(wildcard $(SRCDIR)/floormap/*.jpg)
48
FLOORMAPFILES += $(wildcard $(SRCDIR)/floormap/*.gif)
49

50
51
52
PIXFILES  = $(wildcard $(SRCDIR)/pix/*.jpg)
PIXFILES += $(wildcard $(SRCDIR)/pix/*.gif)

Leigh B. Stoller's avatar
Leigh B. Stoller committed
53
DOCFILES  = $(wildcard $(SRCDIR)/doc/*.html)
54
55
DOCFILES += $(wildcard $(SRCDIR)/doc/*.jpg)
DOCFILES += $(wildcard $(SRCDIR)/doc/*.gif)
56
DOCFILES += $(wildcard $(SRCDIR)/doc/*.php3)
57
DOCFILES += $(wildcard $(SRCDIR)/doc/*.php)
58
59
DOCFILES += $(wildcard $(SRCDIR)/doc/*.ps)
DOCFILES += $(wildcard $(SRCDIR)/doc/*.pdf)
60
61
62
63

TUTFILES  = $(wildcard $(SRCDIR)/tutorial/*.html)
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.jpg)
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.gif)
64
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.png)
65
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.php3)
66
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.php)
67
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.ns)
Leigh B. Stoller's avatar
Leigh B. Stoller committed
68
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.txt)
69
TUTFILES += $(SRCDIR)/tutorial/tb_compat.tcl
Leigh B. Stoller's avatar
Leigh B. Stoller committed
70

71
72
73
74
BUIFILES  = $(wildcard $(SRCDIR)/buildui/*.html)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.jpg)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.gif)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.php3)
75
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.php)
76
77
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.class)

78
79
80
81
82
83
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
84
WEBDBFILES = $(wildcard $(SRCDIR)/webdb/*.php3)
85
WEBDBFILES += $(wildcard $(SRCDIR)/webdb/*.php)
Leigh B. Stoller's avatar
Leigh B. Stoller committed
86

87
88
89
90
91
HYFILES  = $(wildcard $(SRCDIR)/hyperviewer/*.php3)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.html)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.jpg)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.gif)

92
93
94
USRPFILES  = $(wildcard $(SRCDIR)/usrp/*.php)
USRPFILES += $(wildcard $(SRCDIR)/usrp/*.html)

Chad Barb's avatar
Chad Barb committed
95
96
97
# 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
98
DOWNLOADFILES += $(wildcard $(SRCDIR)/downloads/*.zip)
Chad Barb's avatar
   
Chad Barb committed
99
DOWNLOADFILES += $(wildcard $(SRCDIR)/downloads/*.exe)
Chad Barb's avatar
Chad Barb committed
100

101
102
103
104
105
#
# 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
106
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.php)
107
108
109
110
111
112
113
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.conf)
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.gif)
	CVSWEBCGI    = $(wildcard $(SRCDIR)/cvsweb/*.cgi)

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

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

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

154
post-install:
155

156

157
$(INSTALL_WWWDIR)/%: %
158
	@echo "Installing $<"
159
	-mkdir -p $(patsubst %/,%,$(dir $@))
160
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@)