GNUmakefile.in 3.74 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
#
29
FILES	= $(wildcard *.css *.jpg *.gif *.png *.html *.php3)
30 31
FILES  += $(wildcard $(SRCDIR)/*.css)
FILES  += $(wildcard $(SRCDIR)/*.jpg)
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)

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
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)

65 66
WEBDBFILES = $(wildcard $(SRCDIR)/webdb/*.php3)

Chad Barb's avatar
Chad Barb committed
67 68 69 70
# need to make it *.gz; with simply "*", 
# we end up sucking over "CVS"
DOWNLOADFILES = $(wildcard $(SRCDIR)/downloads/*.gz)

71 72 73 74 75 76 77 78 79 80 81 82
#
# 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

83 84 85
#
# Kill the directory part of the names. The vpath rule will do the rest.
#
86 87 88 89 90 91
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
92
ALLDOWNLOADS = $(notdir $(DOWNLOADFILES))
93 94
ALLCVSWEB = $(notdir $(CVSWEBFILES))
ALLBUI    = $(notdir $(BUIFILES))
95 96

install: $(addprefix $(INSTALL_WWWDIR)/, $(ALLFILES)) \
97
	$(addprefix $(INSTALL_WWWDIR)/pix/, $(ALLPIXES)) \
98
	$(addprefix $(INSTALL_WWWDIR)/tutorial/, $(ALLTUTS)) \
99
	$(addprefix $(INSTALL_WWWDIR)/doc/, $(ALLDOCS)) \
100
	$(addprefix $(INSTALL_WWWDIR)/webdb/, $(ALLWEBDB)) \
Chad Barb's avatar
Chad Barb committed
101
	$(addprefix $(INSTALL_WWWDIR)/downloads/, $(ALLDOWNLOADS)) \
102
	$(addprefix $(INSTALL_WWWDIR)/buildui/, $(ALLBUI)) \
103 104
	$(addprefix $(INSTALL_WWWDIR)/autostatus-icons/, $(ALLICONS)) \
	$(addprefix $(INSTALL_WWWDIR)/cvsweb/, $(ALLCVSWEB))
105
	cd $(INSTALL_WWWDIR) && \
106 107 108 109 110 111
		if test -d ../webglimpse; \
		then \
			rm -f webglimpse; \
			ln -s ../webglimpse webglimpse; \
			(cd webglimpse && wgreindex -q); \
		fi; \
112
		rm -f tbdb.html; \
113 114 115
		ln -s index.html tbdb.html; \
		rm -f icons; \
		ln -s /usr/local/www/icons icons;
116
		$(INSTALL_CVSWEBCGI)
117

118
$(INSTALL_WWWDIR)/%: %
119
	@echo "Installing $<"
120
	-mkdir -p $(patsubst %/,%,$(dir $@))
121
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@)