summaryrefslogtreecommitdiff
path: root/support/tiny_c2l/lx2l-src/makefile.lxx
blob: b3ea644faa1a75ed9732c34eeb96fcc34161980c (plain)
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
{@lxx_output_extension <.lx>}
{@lxx_mode <k>}
{@default_thread <v>}
{@@@du}{@output_name <makefile>}
{@@@v}{@output_name <descrip.mms>}

{@@@adu}
{@convert_initial_blanks}
{@map}& {@end@}
{@map}!

{@@v}
{@map}& {@end@}
{@@v1}{@map}&,
{@@@v}
{@map}!;*
{@map}: :
{@unmap}:

{@set <dante1>} 1-7
{@set <dante2>} 8-100

@#::dante_files1 multiple.tex multiple.dvi position.dtx position.ins position.sty {@@##}
   cvt_rm.c tiny_c2l.l tiny_t2l.l testfile.l testfile.dvi asm_uebung.s asm_uebung.dvi
@#::makefiles makefile.dos makefile.unix makefile.vms
@#::dante_files2 config.lx makefile.lxx position.lx tiny_cvt2ltx.lx

@# dante_dir1
{@@@d}dante-neu\
{@@@u}dante-neu/
{@@@v}[.dante-neu]

@# dante_dir2
{@@@d}dante-neu\lx2l-src\
{@@@u}dante-neu/lx2l-src/
{@@@v}[.dante-neu.lx2l-src]

@# dante_zipfiles
{@@@d}tiny_c2l\*.*
{@@@u}tiny_c2l/*
{@@@v}[.tiny_c2l]*.*


@# tiny_c2l
{@@@v}mc sys$disk:[]tiny_c2l$(EXE)
{@@@u}./tiny_c2l
{@@@d}tiny_c2l

@# xdvi
{@@@d}yap
{@@@uv}xdvi

@# run cmd
{@@@v}mc sys$disk:[]{@#.cmd}$(EXE)
{@@@u}./\cmd
{@@@d}\cmd

@# copy
{@@@dv}copy
{@@@u}cp

@# rename
{@@@dv}rename
{@@@u}mv

@# lx2lxh
{@@@v}mc sys$disk:[]lx2lxh$(EXE)
{@@@u}./lx2lxh
{@@@d}lx2lxh

@# obj
{@@@v}$(OBJ)
{@@@^v}.o

@# exe
{@@@d}.exe
{@@@u}{@end@}
{@@@v}$(EXE)

@# cvt_rm_dep
{@calc "%s" "\delete"=="cvt_rm" ? " cvt_rm\exe" : "";}

@# delete
{@@@}cvt_rm
{@@d1v1}cvt_rm
{@@u1}- rm

@# latex
latex

@# latex_b
latex{@@v}/batch

@#- ltx_delete base TEX
{@@@}\delete \base.aux!&\base.dvi!&\base.lis!&\base.log!{@@#.TEX+}&\base.tex!{@@#.TEX#}&\base.toc!
{@@d1v1}\delete \base.aux!&\base.dvi!&\base.lis!&\base.log!{@@#.TEX+}&\base.tex!{@@#.TEX#}&\base.toc!
{@@u1}\delete \base.aux!&\base.dvi!&\base.log!{@@#.TEX+}&\base.tex!{@@#.TEX#}&\base.toc!

@#- make_ltx short base full src gen opt{@@+}
{@#.short}v: \base.dvi
   \xdvi \base.dvi
{@#.short}t2: \base.dvi position.sty
   - \latex_b \full
\base.dvi: \full position.sty
   - \latex_b \full
{@if "\src" ne ""}{@#.short}t: \full
\full: \src \gen\exe
   \run(\gen) \opt \src \full
{@endif}

{@@#}

@#- mf target thread
makefile.\target: makefile.lx{@@+}
   lx2l {@#.thread}1 makefile.lx makefile.\target

@#- dante_copy1 file
\dante_dir1\file: \file{@@+}
   \copy \file \dante_dir1

@#- dante_copy2 file
\dante_dir2\file: \file{@@+}
   \copy \file \dante_dir2

{@@@@}{@remap}:

{@@-}
{@@@v}
{@unmap}:
.ifdef __AXP__
OBJ = .obj_x
EXE = .exe_x
LIBS  = ,sys$share:vaxcrtl/lib/exec=$(MMS$TARGET)
.else
OBJ = .obj
EXE = .exe
LIBS  = ,c.opt/opt/exec=$(MMS$TARGET)
.endif
LEX   = flex
{@remap}:

.SUFFIXES: .l $(OBJ) $(EXE)
.c$(EXE):
   $(CC) $</object=$(MMS$TARGET_NAME)$(OBJ)
   link $(MMS$TARGET_NAME)$(OBJ)$(LIBS)
   \delete $(MMS$TARGET_NAME)$(OBJ)!
.l$(EXE):
   $(LEX) $<
   $(CC) $(MMS$TARGET_NAME).c/object=$(MMS$TARGET_NAME)$(OBJ)
   link $(MMS$TARGET_NAME)$(OBJ)$(LIBS)
   \delete $(MMS$TARGET_NAME).c!&$(MMS$TARGET_NAME)$(OBJ)!
{@@@^v}
CFLAGS   = -O2 -fomit-frame-pointer -Wchar-subscripts -Wformat
LEX      = flex
LFLAGS   =
LDFLAGS  =
LIBS     =
CC       = gcc

.PHONY: demo tf

{@@@d}
.SUFFIXES: .l .exe
.c.exe:
   $(CC) $< -o$*
   djp $*
   \delete $*.o $*
.l.exe:
   $(LEX) $<
   $(CC) $*.c -o$*
   djp $*
   \delete $*.c $*.o $*
{@@@@}

all: tc pt2 demo
demo: tiny_c2l.dvi testfile.dvi asm_uebung.dvi multiple.dvi

\make_ltx#p#position#position.dtx####
py: position.sty
position.sty: position.dtx position.ins
   \latex position.ins

\make_ltx#tc#tiny_c2l#tiny_c2l.tex#tiny_c2l.l#tiny_c2l#-l#
\make_ltx#tf#testfile#testfile.tex#testfile.l#tiny_c2l#-+ -l1#
\make_ltx#a#asm_uebung#asm_uebung.tex#asm_uebung.s#tiny_t2l#-t8#
md: multiple.dvi
multiple.dvi: testfile.tex tiny_c2l.tex position.sty
   - \latex_b multiple

tc: tiny_c2l\exe
{@@@}
tiny_c2l.l: tiny_cvt2ltx.lx config.lx
   lx2l c tiny_cvt2ltx.lx
{@@@dv}
tiny_c2l\exe: tiny_c2l.l
cvt_rm\exe: cvt_rm.c
{@@@@}

tt: tiny_t2l\exe
{@@@v}
tiny_t2l\exe:  tiny_t2l.l
{@@@}
\make_ltx#tf1#testfile1#testfile1.tex#testfile1.l#tiny_c2l#-+ -l1#
tiny_t2l.l:  tiny_cvt2ltx.lx config.lx
   lx2l t tiny_cvt2ltx.lx

mf{@@v}: descrip.mms
descrip.mms{@@@}: makefile.lx
   lx2l {@@d}d{@@u}u{@@v}v{@@@} makefile.lx
makefile.lx: makefile.lxx
   lx2l -x makefile.lxx
\mf(dos)(d)
\mf(unix)(u)
\mf(vms)(v)
mfs: makefile.lx {@forall}\makefiles {@repeat}
   lx2l d1 makefile.lx makefile1.dos
   lx2l u1 makefile.lx makefile1.unix
   lx2l v1 makefile.lx makefile1.vms

position.dtx: position.lx config.lx
   lx2l p position.lx

position.ins: position.lx
   lx2l i position.lx

html: position.html position.idx
pxh: position.html

position.lxh: position.lx lx2lxh\exe
   \lx2lxh position.lx position.lxh
position.html: position.lxh config.lx
   lx2l h position.lxh
position.idx: position.lxh config.lx
   lx2l i1 position.lxh
{@@v}
lx2lxh\exe: lx2lxh.l
{@@@}

dante: dante_zip clean
dante_zip: tiny_c2l.zip
tiny_c2l.zip: dante_files
   \rename dante-neu{@@v}.dir{@@@} tiny_c2l
   zip -9ur tiny_c2l \dante_zipfiles
   \rename tiny_c2l{@@v}.dir{@@@} dante-neu
dante_files:{@forall} {@#dante_dir1}\dante_files1{@repeat}\
   {@forall} {@#dante_dir1}\makefiles{@repeat}\
   {@forall} {@#dante_dir2}\dante_files2{@repeat}

{@forall}\dante_copy1(\dante_files1)
{@repeat}
{@forall}\dante_copy1(\makefiles)
{@repeat}
{@forall}\dante_copy2(\dante_files2)
{@repeat}

{@@@@}
clean:\cvt_rm_dep
   \ltx_delete(tiny_c2l)(1)
   \ltx_delete(testfile)(1)
   \ltx_delete(asm_uebung)(1)
   \ltx_delete(multiple)(0)
   \delete tiny_c2l.dbg!&tiny_t2l.dbg!{@@@}&lx2l.dbg!&position.html!&position.lxh!{@@@@}
   \ltx_delete(position)(0){@@@}&position.dtx!{@@@@}
{@@@}
   \delete makefile.lx!&makefile.dos!&makefile.unix!&makefile.vms!&makefile1.dos!&makefile1.unix!&makefile1.vms!
   \ltx_delete(testfile1)(1)
   \ltx_delete(tiny_t2l)(1)
   \ltx_delete(linediagram)(1)
   \ltx_delete(tf)(1)
{@@@@}
distclean: clean
   \delete {@@@}tiny_c2l.l!&{@@@@}tiny_c2l.c!&tiny_c2l\obj!&tiny_c2l\exe!
   \delete {@@@}tiny_t2l.l!&{@@@@}tiny_t2l.c!&tiny_t2l\obj!&tiny_t2l\exe!
   \delete cvt_rm\obj!&cvt_rm\exe!&position.sty
{@@@}
   \delete makefile!&descrip.mms!&position.sty!&position.ins!
   \delete{@for [dante1]} {@#dante_dir1}\dante_files1!{@repeat}
   \delete{@for [dante2]} {@#dante_dir1}\dante_files1!{@repeat}
   \delete{@forall} {@#dante_dir1}\makefiles!{@repeat}
   \delete{@forall} {@#dante_dir2}\dante_files2!{@repeat}