about summary refs log tree commit diff
path: root/Src/Zle/zle.mdd
blob: a5307084a95725d306f76d920db4ec06a1b07e75 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
autobins="bindkey vared zle"

objects="zle_bindings.o zle_hist.o zle_keymap.o zle_main.o \
zle_misc.o zle_move.o zle_params.o zle_refresh.o \
zle_thingy.o zle_tricky.o zle_utils.o zle_vi.o zle_word.o"

headers="zle.h zle_things.h"

:<<\Make
zle_things.h: thingies.list zle_things.sed
	( \
	    echo '/** zle_things.h                              **/'; \
	    echo '/** indices of and pointers to known thingies **/'; \
	    echo; \
	    echo 'enum {'; \
	    sed -n -f $(sdir)/zle_things.sed < thingies.list; \
	    echo '    ZLE_BUILTIN_THINGY_COUNT'; \
	    echo '};'; \
	) > $@

zle_widget.h: widgets.list zle_widget.sed
	( \
	    echo '/** zle_widget.h                                **/'; \
	    echo '/** indices of and pointers to internal widgets **/'; \
	    echo; \
	    echo 'enum {'; \
	    sed -n -f $(sdir)/zle_widget.sed < widgets.list; \
	    echo '    ZLE_BUILTIN_WIDGET_COUNT'; \
	    echo '};'; \
	) > $@

thingies.list: iwidgets.list
	( \
	    echo '/** thingies.list                            **/'; \
	    echo '/** thingy structures for the known thingies **/'; \
	    echo; \
	    echo '/* format: T("name", TH_FLAGS, w_widget, t_nextthingy) */'; \
	    echo; \
	    sed -e 's/#.*//; /^$$/d; s/" *,.*/"/' \
		-e 's/^"/T("/; s/$$/, 0,/; h' \
		-e 's/-//g; s/^.*"\(.*\)".*/w_\1, t_D\1)/' \
		-e 'H; g; s/\n/ /' \
		< $(sdir)/iwidgets.list; \
	    sed -e 's/#.*//; /^$$/d; s/" *,.*/"/' \
		-e 's/^"/T("./; s/$$/, TH_IMMORTAL,/; h' \
		-e 's/-//g; s/^.*"\.\(.*\)".*/w_\1, t_\1)/' \
		-e 'H; g; s/\n/ /' \
		< $(sdir)/iwidgets.list; \
	) > $@

widgets.list: iwidgets.list
	( \
	    echo '/** widgets.list                               **/'; \
	    echo '/** widget structures for the internal widgets **/'; \
	    echo; \
	    echo '/* format: W(ZLE_FLAGS, t_firstname, functionname) */'; \
	    echo; \
	    sed -e 's/#.*//; /^$$/d; s/-//g' \
		-e 's/^"\(.*\)" *, *\([^ ]*\) *, *\(.*\)/W(\3, t_\1, \2)/' \
		< $(sdir)/iwidgets.list; \
	) > $@

zle_bindings.o zle_bindings..o: zle_widget.h widgets.list thingies.list

clean-here: clean.zle
clean.zle:
	rm -f zle_things.h zle_widget.h widgets.list thingies.list
Make