aboutsummaryrefslogtreecommitdiff
path: root/gnunet-error-codes/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'gnunet-error-codes/Makefile')
-rw-r--r--gnunet-error-codes/Makefile71
1 files changed, 71 insertions, 0 deletions
diff --git a/gnunet-error-codes/Makefile b/gnunet-error-codes/Makefile
new file mode 100644
index 0000000..14fd480
--- /dev/null
+++ b/gnunet-error-codes/Makefile
@@ -0,0 +1,71 @@
1FILES=gnunet_error_codes.h \
2 gnunet_error_codes.c \
3 gnunet_error_codes.ts \
4 gnunet_error_codes.go \
5 gnunet_error_codes.rst
6
7all: check $(FILES)
8
9check: registry.rec
10 recfix --check registry.rec
11
12distclean:
13 rm -f *.tmp
14
15clean:
16 rm -f $(FILES) *.tmp
17
18prep:
19 cd ../http-status-codes; make ; cd -
20
21# Because prep is phony, this rule always triggers. To avoid
22# combined.tmp cascading into triggering the other rules even
23# if nothing changed, we use 'diff' to make sure that 'recsel'
24# actually changed the result.
25combined.tmp: registry.rec prep
26 recsel -t GnunetErrorCode -j HttpStatus -p Description,Name,Value,HttpStatus,HttpStatus.Value,HttpStatus.Identifier ../http-status-codes/registry.rec registry.rec > combined.xtmp
27 if ! diff $@ combined.xtmp > /dev/null; then mv combined.xtmp $@; else rm combined.xtmp; fi
28
29combined-escaped.tmp: combined.tmp
30 sed 's/"/\\"/g' combined.tmp > $@
31
32length.tmp: combined.tmp
33 recsel -p "Count(Description):ECS_LENGTH" combined.tmp > $@
34
35gnunet_error_codes.h.tmp: combined.tmp h.template
36 ../format.sh h.template < combined.tmp > $@
37
38gnunet_error_codes.h: h.header gnunet_error_codes.h.tmp h.footer
39 cat h.header gnunet_error_codes.h.tmp h.footer > $@
40
41gnunet_error_codes.c.tmp: combined-escaped.tmp c.template
42 ../format.sh c.template < combined-escaped.tmp > $@
43
44gnunet_error_codes-length.c.tmp: length.tmp c-length.template
45 ../format.sh c-length.template < length.tmp > $@
46
47gnunet_error_codes.c: c.header gnunet_error_codes.c.tmp gnunet_error_codes-length.c.tmp c.footer
48 cat c.header gnunet_error_codes.c.tmp gnunet_error_codes-length.c.tmp c.footer > $@
49
50gnunet_error_codes.ts.tmp: combined.tmp ts.template
51 ../format.sh ts.template < combined.tmp > $@
52
53gnunet_error_codes.ts: ts.header gnunet_error_codes.ts.tmp ts.footer
54 cat ts.header gnunet_error_codes.ts.tmp ts.footer > $@
55
56gnunet_error_codes.go.tmp: combined.tmp go.template
57 ../format.sh go.template < combined.tmp > $@
58
59gnunet_error_codes.go: go.header gnunet_error_codes.go.tmp go.footer
60 cat go.header gnunet_error_codes.go.tmp go.footer > $@
61
62gnunet_error_codes.rst.tmp: combined.tmp rst.template
63 ../format.sh rst.template < combined.tmp > $@
64
65rst.header.tmp:
66 cat README POLICY rst.header.template > $@
67
68gnunet_error_codes.rst: rst.header.tmp gnunet_error_codes.rst.tmp rst.footer
69 cat rst.header.tmp gnunet_error_codes.rst.tmp rst.footer > $@
70
71.PHONY: check clean distclean prep