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)
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 41
FILES  += $(SRCDIR)/.htaccess $(SRCDIR)/error.shtml $(SRCDIR)/ssh-mime.pl \
	  $(SRCDIR)/ssh-mime-windows.pl
42

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

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

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

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

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

74
WEBDBFILES = $(wildcard $(SRCDIR)/webdb/*.php3)
75
WEBDBFILES += $(wildcard $(SRCDIR)/webdb/*.php)
76

Chad Barb's avatar
Chad Barb committed
77 78 79
# need to make it *.gz; with simply "*", 
# we end up sucking over "CVS"
DOWNLOADFILES = $(wildcard $(SRCDIR)/downloads/*.gz)
80
DOWNLOADFILES += $(wildcard $(SRCDIR)/downloads/*.zip)
81
DOWNLOADFILES += $(wildcard $(SRCDIR)/downloads/*.exe)
Chad Barb's avatar
Chad Barb committed
82

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

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

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

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

133
post-install:
134

135

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