16233
|
1 |
# isaweb makefile
|
|
2 |
# $Id$
|
|
3 |
|
|
4 |
# force shell
|
|
5 |
SHELL=bash
|
|
6 |
|
|
7 |
# some global variables
|
|
8 |
CONF=conf/localconf.mak
|
|
9 |
|
|
10 |
# configuration switch
|
|
11 |
ifeq ($(phase), init)
|
|
12 |
|
|
13 |
# allocate configuration
|
|
14 |
init:
|
|
15 |
mkdir -p conf
|
|
16 |
case $$HOSTNAME in sunbroy*) ARCH=sun;; *) ARCH=at;; esac; \
|
|
17 |
sed 's/# $$Id.*//g' build/localconf.$$ARCH.template.mak > $(CONF)
|
|
18 |
$$EDITOR $(CONF)
|
|
19 |
@false
|
|
20 |
.PHONY: init
|
|
21 |
|
|
22 |
else
|
|
23 |
|
|
24 |
# default target
|
|
25 |
default: site
|
|
26 |
|
|
27 |
# check configuration
|
|
28 |
include $(CONF)
|
|
29 |
$(CONF):
|
|
30 |
@if [ ! -e $(CONF) ]; \
|
|
31 |
then \
|
|
32 |
echo 'Framework not configured yet; set EDITOR environment variable'; \
|
|
33 |
echo 'to your favorite editor and type'; \
|
|
34 |
echo; \
|
|
35 |
echo ' make phase=init'; \
|
|
36 |
echo; \
|
|
37 |
echo 'to configure it'; \
|
|
38 |
false; \
|
|
39 |
else \
|
|
40 |
:; \
|
|
41 |
fi
|
|
42 |
|
|
43 |
# tidy handling
|
|
44 |
ifeq ($(DISABLE_TIDY),)
|
|
45 |
TIDYCMD=$(TIDY) -q -i -asxhtml --output-xhtml true \
|
|
46 |
--doctype auto \
|
|
47 |
--literal-attributes true \
|
|
48 |
--wrap 0 \
|
|
49 |
--indent auto --indent-spaces 2 \
|
|
50 |
--input-encoding utf8 --output-encoding latin1 \
|
|
51 |
--logical-emphasis yes --gnu-emacs yes --write-back yes
|
|
52 |
else
|
|
53 |
TIDYCMD=:
|
|
54 |
endif
|
|
55 |
|
|
56 |
# dependencies
|
|
57 |
DEP_FILE=conf/depends.mak
|
|
58 |
site: $(DEP_FILE) allsite
|
|
59 |
.PHONY: site
|
|
60 |
|
|
61 |
# import dependencies
|
|
62 |
include $(DEP_FILE)
|
|
63 |
endif
|
|
64 |
|
|
65 |
# pypager iso-8859-1 hack
|
|
66 |
ifneq ($(FORCE_ISO_8859_1),)
|
|
67 |
FORCE_ENC_CMD=--encodinghtml "iso-8859-1"
|
|
68 |
else
|
|
69 |
FORCE_ENC_CMD=
|
|
70 |
endif
|
|
71 |
|
|
72 |
# import project-specific dependencies
|
|
73 |
include build/project.mak
|
|
74 |
|
|
75 |
# build dependencies
|
|
76 |
$(DEP_FILE): $(CONF)
|
|
77 |
rm -f $(DEP_FILE); \
|
|
78 |
touch $(DEP_FILE); \
|
|
79 |
echo '# This is a generated file; do not edit' >> $(DEP_FILE); \
|
|
80 |
echo >> $(DEP_FILE); \
|
|
81 |
allstatic=''; \
|
|
82 |
for dir in $(STATICDIRS); \
|
|
83 |
do \
|
16276
|
84 |
for file in `$(FIND) $$dir -follow -type f -a ! -path "*/CVS/*"`; \
|
16233
|
85 |
do \
|
|
86 |
outputfile=$(OUTPUTROOT)/$$file; \
|
|
87 |
outputdir=`dirname $$outputfile`; \
|
|
88 |
echo "$$outputfile: $$file" >> $(DEP_FILE); \
|
|
89 |
echo " mkdir -p $$outputdir" >> $(DEP_FILE); \
|
16323
|
90 |
echo " -chmod $(TARGET_UMASK_DIR) $$outputdir" >> $(DEP_FILE); \
|
16233
|
91 |
echo ' cp $$< $$@' >> $(DEP_FILE); \
|
16323
|
92 |
echo ' chmod $(TARGET_UMASK_FILE) $$@' >> $(DEP_FILE); \
|
16233
|
93 |
allstatic="$$allstatic$$outputfile "; \
|
|
94 |
echo >> $(DEP_FILE); \
|
|
95 |
done; \
|
|
96 |
done; \
|
|
97 |
echo "DEP_ALLSTATIC=$$allstatic" >> $(DEP_FILE); \
|
|
98 |
echo >> $(DEP_FILE); \
|
|
99 |
echo 'DEP_HTML=$$(DEP_ALLSTATIC) $$(DEP_SYMLINKS) include/documentationdist.include.html $(DEP_FILE) $(CONF)' >> $(DEP_FILE); \
|
|
100 |
echo >> $(DEP_FILE); \
|
|
101 |
allhtml=''; \
|
16276
|
102 |
for html in `$(FIND) . -name "*.html" -a ! -name "*.include.html"`; \
|
16233
|
103 |
do \
|
|
104 |
outputfile=$(OUTPUTROOT)/$$html; \
|
|
105 |
outputdir=`dirname $$outputfile`; \
|
|
106 |
echo "$$outputfile: $$html"' $$(DEP_HTML)' >> $(DEP_FILE); \
|
|
107 |
echo " mkdir -p $$outputdir" >> $(DEP_FILE); \
|
16323
|
108 |
echo " -chmod $(TARGET_UMASK_DIR) $$outputdir" >> $(DEP_FILE); \
|
16233
|
109 |
echo ' $(PYTHON) build/pypager.py --dtd="dtd/" $(FORCE_ENC_CMD) --srcroot="." --dstroot="$(OUTPUTROOT)" distname="$(DISTNAME)" $$< $$@' >> $(DEP_FILE); \
|
|
110 |
echo ' -$(TIDYCMD) $$@' >> $(DEP_FILE); \
|
16323
|
111 |
echo ' chmod $(TARGET_UMASK_FILE) $$@' >> $(DEP_FILE); \
|
16233
|
112 |
allhtml="$$allhtml$$outputfile "; \
|
|
113 |
echo >> $(DEP_FILE); \
|
|
114 |
done; \
|
|
115 |
echo "DEP_ALLHTML=$$allhtml" >> $(DEP_FILE); \
|
|
116 |
echo >> $(DEP_FILE); \
|
|
117 |
echo 'allsite: $$(DEP_ALLHTML) $$(DEP_ALLSTATIC)' >> $(DEP_FILE); \
|
|
118 |
echo ".PHONY: allsite" >> $(DEP_FILE)
|
|
119 |
|
|
120 |
# build dependencies explicitly
|
|
121 |
depends:
|
|
122 |
rm -f $(DEP_FILE)
|
|
123 |
$(MAKE) $(DEP_FILE)
|
|
124 |
.PHONY: depends
|
|
125 |
|
|
126 |
# clean build files
|
|
127 |
clean:
|
|
128 |
rm -f $(DEP_FILE)
|
|
129 |
.PHONY: clean
|