GNUmakefile.in 3.52 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
DOCFILES += $(wildcard $(SRCDIR)/doc/*.ps)
DOCFILES += $(wildcard $(SRCDIR)/doc/*.pdf)
50
51
52
53

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

59
60
61
62
63
64
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
65
66
WEBDBFILES = $(wildcard $(SRCDIR)/webdb/*.php3)

67
68
69
70
71
72
73
74
75
76
77
78
#
# 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

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

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

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