-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile.common
106 lines (89 loc) · 2.6 KB
/
Makefile.common
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#-----------------------------------------------------------------------------#
# Copyright (C) 1998 University of Melbourne.
# This file may only be copied under the terms of the GNU General
# Public License - see the file COPYING in the Mercury distribution.
#-----------------------------------------------------------------------------#
# NOTE: Even though it says PHP3 all over the place we are actually now using
# php version 5. (The original version of this website used 3 and it's
# currently hardcoded all over the place.)
ifndef PHP3
PHP3=/usr/bin/php -q
endif
ifndef WWW_DOMAIN
WWW_DOMAIN="www.mercurylang.org"
endif
BETA_WEBDIR="$(INSTALL_WEBDIR)/download/files/beta-releases/rotd"
ifndef BETA_FTPDIR
BETA_FTPDIR="/local/ftp/pub/mercury/beta-releases/rotd"
endif
CP=cp -fdR --preserve=ownership,timestamps
#-----------------------------------------------------------------------------#
vpath %.inc ./include
vpath %.inc $(ROOT)/include
vpath %.inc $(ROOT)/news
$(HTML): %.html: %.php %.inc globals.inc menubar.inc template.inc functions.inc
$(XML): %.xml: %.php functions.inc newsdb.inc
#-----------------------------------------------------------------------------#
#-----------------------------------------------------------------------------#
.PHONY: html
html: $(HTML) $(XML)
ifdef DIRS
for dir in $(DIRS); \
do \
if [ -d $$dir ]; then \
(cd $$dir && $(MAKE) html); \
fi \
done
endif
.PHONY: all
all: $(HTML)
ifdef DIRS
for dir in $(DIRS); \
do \
if [ -d $$dir ]; then \
(cd $$dir && $(MAKE) all); \
fi \
done
endif
.PHONY: install
install: html
[ -d $(INSTALL_WEBDIR) ] || mkdir -p $(INSTALL_WEBDIR)
ifdef HTML
$(CP) $(HTML) $(INSTALL_WEBDIR)/
endif
ifdef XML
$(CP) $(XML) $(INSTALL_WEBDIR)/
endif
ifdef DIRS
for dir in $(DIRS); \
do \
[ -d $(INSTALL_WEBDIR)/$$dir ] || \
mkdir -p $(INSTALL_WEBDIR)/$$dir; \
chmod a+rx $(INSTALL_WEBDIR)/$$dir; \
(export INSTALL_WEBDIR=$(INSTALL_WEBDIR)/$$dir && \
cd $$dir && $(MAKE) install); \
done
endif
-chmod a+r,g+w $(INSTALL_WEBDIR)/*
-chgrp mercury $(INSTALL_WEBDIR)/*
.PHONY: clean
clean:
-rm -f $(HTML)
ifdef DIRS
for dir in $(DIRS); \
do \
if [ -d $$dir ]; then \
(cd $$dir && $(MAKE) clean); \
fi \
done
endif
.PHONY: touch
touch:
touch *.php
#-----------------------------------------------------------------------------#
%.html: %.php
$(PHP3) $< > $@
%.xml: %.php
$(PHP3) $< > $@
#-----------------------------------------------------------------------------#
#-----------------------------------------------------------------------------#