flush
[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 PHP_PSI_SOURCES := $(addprefix $(PHP_PSI_SRCDIR)/,$(PHP_PSI_SOURCES))
5
6 $(PHP_PSI_BUILDDIR)/%.h: $(PHP_PSI_SRCDIR)/src/%.h
7 @cat >$@ <$<
8
9 all: psi-build-headers
10 clean: psi-clean-headers
11
12 .PHONY: psi-build-headers
13 psi-build-headers: $(PHP_PSI_HEADERS)
14
15 .PHONY: psi-clean-headers
16 psi-clean-headers:
17 -rm -f $(PHP_PSI_HEADERS)
18
19 lempar.c:
20 curl -sSo $@ "http://www.sqlite.org/src/raw/tool/lempar.c?name=3617143ddb9b176c3605defe6a9c798793280120"
21
22 lemon.c:
23 curl -sSo $@ "http://www.sqlite.org/src/raw/tool/lemon.c?name=039f813b520b9395740c52f9cbf36c90b5d8df03"
24
25 ./lemon: lemon.c | lempar.c
26 $(CC) -o $@ $<
27
28 $(PHP_PSI_SRCDIR)/src/context.c: $(PHP_PSI_SRCDIR)/config.m4
29 touch $@
30 $(PHP_PSI_SRCDIR)/src/%.c: $(PHP_PSI_BUILDDIR)/parser.h
31 touch $@
32 $(PHP_PSI_SRCDIR)/src/parser_proc.y: $(PHP_PSI_BUILDDIR)/parser.h
33 touch $@
34 $(PHP_PSI_SRCDIR)/src/parser_proc.c: $(PHP_PSI_SRCDIR)/src/parser_proc.y $(LEMON)
35 $(LEMON) -c $<
36
37 $(PHP_PSI_SRCDIR)/src/parser.re: $(PHP_PSI_BUILDDIR)/parser.h $(PHP_PSI_BUILDDIR)/parser_proc.h
38 touch $@
39 $(PHP_PSI_SRCDIR)/src/parser.c: $(PHP_PSI_SRCDIR)/src/parser.re
40 $(RE2C) -o $@ $<