source: trunk/devel/prepare.mak @ 1321

Last change on this file since 1321 was 1321, checked in by moo, 18 months ago

add back PHP_4 code for disassembler

File size: 4.1 KB
Line 
1CTAGS=$(shell which ctags 2>/dev/null || which exuberant-ctags 2>/dev/null)
2AWK=$(shell which gawk 2>/dev/null || which awk 2>/dev/null)
3
4include devel/prepare.cfg
5
6.PHONY: dummy
7.PHONY: all
8all: xcache/xc_opcode_spec_def.h xc_const_string tags po
9
10.PHONY: clean
11clean: clean_xc_const_string clean_po
12    rm -f tags xcache/xc_opcode_spec_def.h
13
14.PHONY: clean_xc_const_string
15clean_xc_const_string:
16    rm -f xcache/xc_const_string_opcodes_php*.h
17
18.PHONY: xc_const_string
19xc_const_string: \
20    xcache/xc_const_string_opcodes_php4.x.h \
21    xcache/xc_const_string_opcodes_php5.0.h \
22    xcache/xc_const_string_opcodes_php5.1.h \
23    xcache/xc_const_string_opcodes_php5.3.h \
24    xcache/xc_const_string_opcodes_php5.4.h \
25    xcache/xc_const_string_opcodes_php5.5.h \
26    xcache/xc_const_string_opcodes_php6.x.h
27
28ifeq (${EA_DIR},)
29xcache/xc_opcode_spec_def.h: dummy
30    @echo "Skipped $@: EA_DIR not set"
31else
32xcache/xc_opcode_spec_def.h: ${EA_DIR}/opcodes.c
33    $(AWK) -f ./devel/gen_xc_opcode_spec.awk < "$<" > "$@".tmp
34    mv "$@".tmp "$@"
35endif
36
37ifeq (${PHP4_x_DIR},)
38xcache/xc_const_string_opcodes_php4.x.h: dummy
39    @echo "Skipped $@: PHP_4_x_DIR not set"
40else
41xcache/xc_const_string_opcodes_php4.x.h: ${PHP4_x_DIR}/Zend/zend_compile.h
42    $(AWK) -f ./devel/gen_const_string_opcodes.awk < "$<" > "$@.tmp"
43    mv "$@.tmp" "$@"
44endif
45
46ifeq (${PHP5_0_DIR},)
47xcache/xc_const_string_opcodes_php5.0.h: dummy
48    @echo "Skipped $@: PHP_5_0_DIR not set"
49else
50xcache/xc_const_string_opcodes_php5.0.h: ${PHP5_0_DIR}/Zend/zend_compile.h
51    $(AWK) -f ./devel/gen_const_string_opcodes.awk < "$<" > "$@.tmp"
52    mv "$@.tmp" "$@"
53endif
54
55ifeq (${PHP5_1_DIR},)
56xcache/xc_const_string_opcodes_php5.1.h: dummy
57    @echo "Skipped $@: PHP_5_1_DIR not set"
58else
59xcache/xc_const_string_opcodes_php5.1.h: ${PHP5_1_DIR}/Zend/zend_vm_def.h
60    $(AWK) -f ./devel/gen_const_string_opcodes.awk < "$<" > "$@.tmp"
61    mv "$@.tmp" "$@"
62endif
63
64ifeq (${PHP5_3_DIR},)
65xcache/xc_const_string_opcodes_php5.3.h: dummy
66    @echo "Skipped $@: PHP_5_3_DIR not set"
67else
68xcache/xc_const_string_opcodes_php5.3.h: ${PHP5_3_DIR}/Zend/zend_vm_def.h
69    $(AWK) -f ./devel/gen_const_string_opcodes.awk < "$<" > "$@.tmp"
70    mv "$@.tmp" "$@"
71endif
72
73ifeq (${PHP5_4_DIR},)
74xcache/xc_const_string_opcodes_php5.4.h: dummy
75    @echo "Skipped $@: PHP_5_4_DIR not set"
76else
77xcache/xc_const_string_opcodes_php5.4.h: ${PHP5_4_DIR}/Zend/zend_vm_def.h
78    $(AWK) -f ./devel/gen_const_string_opcodes.awk < "$<" > "$@.tmp"
79    mv "$@.tmp" "$@"
80endif
81
82ifeq (${PHP5_5_DIR},)
83xcache/xc_const_string_opcodes_php5.5.h: dummy
84    @echo "Skipped $@: PHP_5_5_DIR not set"
85else
86xcache/xc_const_string_opcodes_php5.5.h: ${PHP5_5_DIR}/Zend/zend_vm_def.h
87    $(AWK) -f ./devel/gen_const_string_opcodes.awk < "$<" > "$@.tmp"
88    mv "$@.tmp" "$@"
89endif
90
91ifeq (${PHP6_x_DIR},)
92xcache/xc_const_string_opcodes_php6.x.h: dummy
93    @echo "Skipped $@: PHP_6_x_DIR not set"
94else
95xcache/xc_const_string_opcodes_php6.x.h: ${PHP6_x_DIR}/Zend/zend_vm_def.h
96    $(AWK) -f ./devel/gen_const_string_opcodes.awk < "$<" > "$@.tmp"
97    mv "$@.tmp" "$@"
98endif
99
100ifeq (${PHP_DEVEL_DIR},)
101tags:
102    @echo "* Making tags without php source files"
103    "$(CTAGS)" -R .
104else
105tags:
106    @echo "* Making tags with ${PHP_DEVEL_DIR}"
107    "$(CTAGS)" -R . "${PHP_DEVEL_DIR}/main" "${PHP_DEVEL_DIR}/Zend" "${PHP_DEVEL_DIR}/TSRM" "${PHP_DEVEL_DIR}/ext/standard"
108endif
109
110.PHONY: po
111define htdocspo
112  po: \
113    htdocs/$(1)/lang/en.po \
114    htdocs/$(1)/lang/en.po-merged \
115    htdocs/$(1)/lang/zh-simplified.po-merged \
116    htdocs/$(1)/lang/zh-simplified.po \
117    htdocs/$(1)/lang/zh-traditional.po \
118    htdocs/$(1)/lang/zh-traditional.po-merged
119
120  htdocs/$(1)/lang/%.po-merged: htdocs/$(1)/lang/%.po htdocs/$(1)/lang/$(1).pot
121    msgmerge -o "$$@".tmp $$^
122    mv "$$@".tmp "$$@"
123
124  htdocs/$(1)/lang/%.po:
125    touch "$$@"
126
127  htdocs/$(1)/lang/$(1).pot:
128    xgettext --keyword=_T --keyword=N_ --from-code=UTF-8 -F -D htdocs/$(1)/ $$(subst htdocs/$(1)/,,$$^) -o "$$@".tmp
129    mv "$$@".tmp "$$@"
130
131  htdocs/$(1)/lang/$(1).pot: $(shell find htdocs/$(1) -type f | grep php | grep -v lang | grep -v config | grep -vF .swp)
132
133endef
134
135$(eval $(call htdocspo,cacher))
136$(eval $(call htdocspo,common))
137$(eval $(call htdocspo,coverager))
138$(eval $(call htdocspo,diagnosis))
139
140.PHONY: clean_po
141clean_po: clean_pot
142    rm -f htdocs/*/lang/*.po-merged
143
144.PHONY: clean_pot
145clean_pot:
146    rm -f htdocs/*/lang/*.pot
Note: See TracBrowser for help on using the repository browser.