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