GNUmakefile.in 4.07 KB
Newer Older
1
2
3
#
# For installation.
#
4
5
6
7
8
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ..
SUBDIR		= www

9
10
11
12
13
14
#
# A hack for only installing some things if installing on the main site
#
MAINSITE        = emulab.net
OURDOMAIN       = @OURDOMAIN@

15
include $(OBJDIR)/Makeconf
16

17
18
19
20
21
#
# Force dependencies to make sure configure regenerates if the .in file
# is changed.
# 
all: defs.php3 dbdefs.php3
22

23
include $(TESTBED_SRCDIR)/GNUmakerules
24

25
26
27
#
# Generate a list of all the files we want to install from the current
# directory and the source directory. 
28
#
29
FILES	= $(wildcard *.css *.jpg *.gif *.png *.html *.php3 *.php)
30
31
FILES  += $(wildcard $(SRCDIR)/*.css)
FILES  += $(wildcard $(SRCDIR)/*.jpg)
Chad Barb's avatar
   
Chad Barb committed
32
FILES  += $(wildcard $(SRCDIR)/*.png)
33
34
35
FILES  += $(wildcard $(SRCDIR)/*.gif)
FILES  += $(wildcard $(SRCDIR)/*.html)
FILES  += $(wildcard $(SRCDIR)/*.php3)
36
FILES  += $(wildcard $(SRCDIR)/*.php)
37
FILES  += $(SRCDIR)/.htaccess $(SRCDIR)/error.shtml
38

39
40
41
AUTOICONS  = $(wildcard $(SRCDIR)/autostatus-icons/*.gif)
AUTOICONS += $(wildcard $(SRCDIR)/autostatus-icons/*.png)

42
43
44
PIXFILES  = $(wildcard $(SRCDIR)/pix/*.jpg)
PIXFILES += $(wildcard $(SRCDIR)/pix/*.gif)

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

TUTFILES  = $(wildcard $(SRCDIR)/tutorial/*.html)
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.jpg)
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.gif)
56
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.png)
57
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.php3)
58
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.php)
59
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.ns)
60
TUTFILES += $(SRCDIR)/tutorial/tb_compat.tcl
Leigh B. Stoller's avatar
Leigh B. Stoller committed
61

62
63
64
65
BUIFILES  = $(wildcard $(SRCDIR)/buildui/*.html)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.jpg)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.gif)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.php3)
66
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.php)
67
68
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.class)

Leigh B. Stoller's avatar
Leigh B. Stoller committed
69
WEBDBFILES = $(wildcard $(SRCDIR)/webdb/*.php3)
70
WEBDBFILES = $(wildcard $(SRCDIR)/webdb/*.php)
Leigh B. Stoller's avatar
Leigh B. Stoller committed
71

Chad Barb's avatar
Chad Barb committed
72
73
74
# 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
75
DOWNLOADFILES += $(wildcard $(SRCDIR)/downloads/*.zip)
Chad Barb's avatar
Chad Barb committed
76

77
78
79
80
81
#
# This stuff only gets installed on the main site
#
ifeq ($(OURDOMAIN),$(MAINSITE)) 
	CVSWEBFILES  = $(wildcard $(SRCDIR)/cvsweb/*.php3)
82
	CVSWEBFILES  = $(wildcard $(SRCDIR)/cvsweb/*.php)
83
84
85
86
87
88
89
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.conf)
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.gif)
	CVSWEBCGI    = $(wildcard $(SRCDIR)/cvsweb/*.cgi)

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

90
91
92
#
# Kill the directory part of the names. The vpath rule will do the rest.
#
93
94
95
96
97
98
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
99
ALLDOWNLOADS = $(notdir $(DOWNLOADFILES))
100
101
ALLCVSWEB = $(notdir $(CVSWEBFILES))
ALLBUI    = $(notdir $(BUIFILES))
102
103

install: $(addprefix $(INSTALL_WWWDIR)/, $(ALLFILES)) \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
104
	$(addprefix $(INSTALL_WWWDIR)/pix/, $(ALLPIXES)) \
105
	$(addprefix $(INSTALL_WWWDIR)/tutorial/, $(ALLTUTS)) \
106
	$(addprefix $(INSTALL_WWWDIR)/doc/, $(ALLDOCS)) \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
107
	$(addprefix $(INSTALL_WWWDIR)/webdb/, $(ALLWEBDB)) \
Chad Barb's avatar
Chad Barb committed
108
	$(addprefix $(INSTALL_WWWDIR)/downloads/, $(ALLDOWNLOADS)) \
109
	$(addprefix $(INSTALL_WWWDIR)/buildui/, $(ALLBUI)) \
110
111
	$(addprefix $(INSTALL_WWWDIR)/autostatus-icons/, $(ALLICONS)) \
	$(addprefix $(INSTALL_WWWDIR)/cvsweb/, $(ALLCVSWEB))
112
	cd $(INSTALL_WWWDIR) && \
113
114
115
116
117
118
		if test -d ../webglimpse; \
		then \
			rm -f webglimpse; \
			ln -s ../webglimpse webglimpse; \
			(cd webglimpse && wgreindex -q); \
		fi; \
119
		rm -f tbdb.html; \
120
121
122
		ln -s index.html tbdb.html; \
		rm -f icons; \
		ln -s /usr/local/www/icons icons;
123
		$(INSTALL_CVSWEBCGI)
124

125
$(INSTALL_WWWDIR)/%: %
126
	@echo "Installing $<"
127
	-mkdir -p $(patsubst %/,%,$(dir $@))
128
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@)