GNUmakefile.in 4.46 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 *.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
FILES  += $(SRCDIR)/.htaccess $(SRCDIR)/error.shtml $(SRCDIR)/ssh-mime.pl
41

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

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

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

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

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

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

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

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

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

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

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

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

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