GNUmakefile.in 4.93 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)
40
41
FILES  += $(SRCDIR)/.htaccess $(SRCDIR)/error.shtml $(SRCDIR)/ssh-mime.pl \
	  $(SRCDIR)/ssh-mime-windows.pl
42

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

46
47
48
PIXFILES  = $(wildcard $(SRCDIR)/pix/*.jpg)
PIXFILES += $(wildcard $(SRCDIR)/pix/*.gif)

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

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

67
68
69
70
BUIFILES  = $(wildcard $(SRCDIR)/buildui/*.html)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.jpg)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.gif)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.php3)
71
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.php)
72
73
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.class)

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

83
84
85
86
87
HYFILES  = $(wildcard $(SRCDIR)/hyperviewer/*.php3)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.html)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.jpg)
HYFILES += $(wildcard $(SRCDIR)/hyperviewer/*.gif)

Chad Barb's avatar
Chad Barb committed
88
89
90
# 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
91
DOWNLOADFILES += $(wildcard $(SRCDIR)/downloads/*.zip)
Chad Barb's avatar
   
Chad Barb committed
92
DOWNLOADFILES += $(wildcard $(SRCDIR)/downloads/*.exe)
Chad Barb's avatar
Chad Barb committed
93

94
95
96
97
98
#
# This stuff only gets installed on the main site
#
ifeq ($(OURDOMAIN),$(MAINSITE)) 
	CVSWEBFILES  = $(wildcard $(SRCDIR)/cvsweb/*.php3)
99
	CVSWEBFILES  = $(wildcard $(SRCDIR)/cvsweb/*.php)
100
101
102
103
104
105
106
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.conf)
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.gif)
	CVSWEBCGI    = $(wildcard $(SRCDIR)/cvsweb/*.cgi)

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

107
108
109
#
# Kill the directory part of the names. The vpath rule will do the rest.
#
110
111
112
113
114
115
ALLFILES  = $(notdir $(FILES))
ALLPIXES  = $(notdir $(PIXFILES))
ALLDOCS   = $(notdir $(DOCFILES))
ALLTUTS   = $(notdir $(TUTFILES))
ALLICONS  = $(notdir $(AUTOICONS))
ALLWEBDB  = $(notdir $(WEBDBFILES))
Chad Barb's avatar
Chad Barb committed
116
ALLDOWNLOADS = $(notdir $(DOWNLOADFILES))
117
118
ALLCVSWEB = $(notdir $(CVSWEBFILES))
ALLBUI    = $(notdir $(BUIFILES))
119
ALLNL     = $(notdir $(NLFILES))
120
ALLHY     = $(notdir $(HYFILES))
121
122

install: $(addprefix $(INSTALL_WWWDIR)/, $(ALLFILES)) \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
123
	$(addprefix $(INSTALL_WWWDIR)/pix/, $(ALLPIXES)) \
124
	$(addprefix $(INSTALL_WWWDIR)/tutorial/, $(ALLTUTS)) \
125
	$(addprefix $(INSTALL_WWWDIR)/doc/, $(ALLDOCS)) \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
126
	$(addprefix $(INSTALL_WWWDIR)/webdb/, $(ALLWEBDB)) \
Chad Barb's avatar
Chad Barb committed
127
	$(addprefix $(INSTALL_WWWDIR)/downloads/, $(ALLDOWNLOADS)) \
128
	$(addprefix $(INSTALL_WWWDIR)/buildui/, $(ALLBUI)) \
129
	$(addprefix $(INSTALL_WWWDIR)/netlab/, $(ALLNL)) \
130
	$(addprefix $(INSTALL_WWWDIR)/hyperviewer/, $(ALLHY)) \
131
	$(addprefix $(INSTALL_WWWDIR)/autostatus-icons/, $(ALLICONS)) \
132
	$(addprefix $(INSTALL_LIBEXECDIR)/, websearch) \
133
	$(addprefix $(INSTALL_WWWDIR)/cvsweb/, $(ALLCVSWEB))
134
	(swish-e -c ./swish.conf)
135
136
	cd $(INSTALL_WWWDIR) && \
		rm -f tbdb.html; \
137
138
139
		ln -s index.html tbdb.html; \
		rm -f icons; \
		ln -s /usr/local/www/icons icons;
140
		$(INSTALL_CVSWEBCGI)
141

142
post-install:
143

144

145
$(INSTALL_WWWDIR)/%: %
146
	@echo "Installing $<"
147
	-mkdir -p $(patsubst %/,%,$(dir $@))
148
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@)