about summary refs log tree commit diff
path: root/Src/Zle/zle.mdd
blob: 95702e9482dcc03be20276ae5750fb23ffa74e8e (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
hasexport=1

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 comp.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
hasexport=1

moddeps="comp1"

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