GNUmakefile.in 3.43 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
#
Chad Barb's avatar
   
Chad Barb committed
29
FILES	= $(wildcard *.css *.jpg *.gif *.png *.html *.php3)
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  += $(SRCDIR)/.htaccess $(SRCDIR)/error.shtml
37

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

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

Leigh B. Stoller's avatar
Leigh B. Stoller committed
44
DOCFILES  = $(wildcard $(SRCDIR)/doc/*.html)
45
46
DOCFILES += $(wildcard $(SRCDIR)/doc/*.jpg)
DOCFILES += $(wildcard $(SRCDIR)/doc/*.gif)
47
DOCFILES += $(wildcard $(SRCDIR)/doc/*.php3)
48
49
50
51

TUTFILES  = $(wildcard $(SRCDIR)/tutorial/*.html)
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.jpg)
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.gif)
52
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.png)
53
54
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.php3)
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.ns)
55
TUTFILES += $(SRCDIR)/tutorial/tb_compat.tcl
Leigh B. Stoller's avatar
Leigh B. Stoller committed
56

57
58
59
60
61
62
BUIFILES  = $(wildcard $(SRCDIR)/buildui/*.html)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.jpg)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.gif)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.php3)
BUIFILES += $(wildcard $(SRCDIR)/buildui/*.class)

Leigh B. Stoller's avatar
Leigh B. Stoller committed
63
64
WEBDBFILES = $(wildcard $(SRCDIR)/webdb/*.php3)

65
66
67
68
69
70
71
72
73
74
75
76
#
# This stuff only gets installed on the main site
#
ifeq ($(OURDOMAIN),$(MAINSITE)) 
	CVSWEBFILES  = $(wildcard $(SRCDIR)/cvsweb/*.php3)
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.conf)
	CVSWEBFILES += $(wildcard $(SRCDIR)/cvsweb/*.gif)
	CVSWEBCGI    = $(wildcard $(SRCDIR)/cvsweb/*.cgi)

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

77
78
79
#
# Kill the directory part of the names. The vpath rule will do the rest.
#
80
81
82
83
84
85
86
87
ALLFILES  = $(notdir $(FILES))
ALLPIXES  = $(notdir $(PIXFILES))
ALLDOCS   = $(notdir $(DOCFILES))
ALLTUTS   = $(notdir $(TUTFILES))
ALLICONS  = $(notdir $(AUTOICONS))
ALLWEBDB  = $(notdir $(WEBDBFILES))
ALLCVSWEB = $(notdir $(CVSWEBFILES))
ALLBUI    = $(notdir $(BUIFILES))
88
89

install: $(addprefix $(INSTALL_WWWDIR)/, $(ALLFILES)) \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
90
	$(addprefix $(INSTALL_WWWDIR)/pix/, $(ALLPIXES)) \
91
	$(addprefix $(INSTALL_WWWDIR)/tutorial/, $(ALLTUTS)) \
92
	$(addprefix $(INSTALL_WWWDIR)/doc/, $(ALLDOCS)) \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
93
	$(addprefix $(INSTALL_WWWDIR)/webdb/, $(ALLWEBDB)) \
94
	$(addprefix $(INSTALL_WWWDIR)/buildui/, $(ALLBUI)) \
95
96
	$(addprefix $(INSTALL_WWWDIR)/autostatus-icons/, $(ALLICONS)) \
	$(addprefix $(INSTALL_WWWDIR)/cvsweb/, $(ALLCVSWEB))
97
	cd $(INSTALL_WWWDIR) && \
98
99
100
101
102
103
		if test -d ../webglimpse; \
		then \
			rm -f webglimpse; \
			ln -s ../webglimpse webglimpse; \
			(cd webglimpse && wgreindex -q); \
		fi; \
104
		rm -f tbdb.html; \
105
106
107
		ln -s index.html tbdb.html; \
		rm -f icons; \
		ln -s /usr/local/www/icons icons;
108
		$(INSTALL_CVSWEBCGI)
109

110
$(INSTALL_WWWDIR)/%: %
111
	@echo "Installing $<"
112
	-mkdir -p $(patsubst %/,%,$(dir $@))
113
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@)