GNUmakefile.in 4.39 KB
Newer Older
1
#
2
3
4
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# 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
23
#
# Force dependencies to make sure configure regenerates if the .in file
# is changed.
# 
all: defs.php3 dbdefs.php3
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)
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  += $(SRCDIR)/.htaccess $(SRCDIR)/error.shtml
40

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

44
45
46
PIXFILES  = $(wildcard $(SRCDIR)/pix/*.jpg)
PIXFILES += $(wildcard $(SRCDIR)/pix/*.gif)

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

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

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

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

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

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

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

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

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

131
132
133
post-install:
	chgrp tbvis $(INSTALL_WWWDIR)/thumbs

134
$(INSTALL_WWWDIR)/%: %
135
	@echo "Installing $<"
136
	-mkdir -p $(patsubst %/,%,$(dir $@))
137
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@)