0f572d1d8b4a64fa88fb80e52ec7058afdd30aab
[m6w6/ext-psi] / Makefile.frag
1 # provide headers in builddir, so they do not end up in /usr/include/ext/psi/src
2
3 PHP_PSI_HEADERS := $(addprefix $(PHP_PSI_BUILDDIR)/,$(PHP_PSI_HEADERS))
4
5 $(PHP_PSI_BUILDDIR)/%.h: $(PHP_PSI_SRCDIR)/src/%.h
6 @cat >$@ <$<
7
8 all: psi-build-headers
9 clean: psi-clean-headers
10
11 .PHONY: psi-build-headers
12 psi-build-headers: $(PHP_PSI_HEADERS)
13
14 .PHONY: psi-clean-headers
15 psi-clean-headers:
16 -rm -f $(PHP_PSI_HEADERS)
17
18 lempar.c:
19 curl -sSo $@ "http://www.sqlite.org/src/raw/tool/lempar.c?name=3617143ddb9b176c3605defe6a9c798793280120"
20
21 lemon.c:
22 curl -sSo $@ "http://www.sqlite.org/src/raw/tool/lemon.c?name=039f813b520b9395740c52f9cbf36c90b5d8df03"
23
24 ./lemon: lemon.c | lempar.c
25 $(CC) -o $@ $<
26
27 $(PHP_PSI_SRCDIR)/src/parser_proc.y: $(PHP_PSI_BUILDDIR)/parser.h
28 touch $@
29 $(PHP_PSI_SRCDIR)/src/parser_proc.c: $(PHP_PSI_SRCDIR)/src/parser_proc.y $(LEMON)
30 $(LEMON) -c $<
31
32 $(PHP_PSI_SRCDIR)/src/parser.re: $(PHP_PSI_BUILDDIR)/parser.h $(PHP_PSI_BUILDDIR)/parser_proc.h
33 touch $@
34 $(PHP_PSI_SRCDIR)/src/parser.c: $(PHP_PSI_SRCDIR)/src/parser.re
35 $(RE2C) -o $@ $<