File: Makefile.in

package info (click to toggle)
clif 0.93-9.1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 4,228 kB
  • sloc: ansic: 31,464; yacc: 5,067; lex: 819; makefile: 383; sh: 48
file content (494 lines) | stat: -rw-r--r-- 12,742 bytes parent folder | download | duplicates (4)
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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
#    Clif - A C-like Interpreter Framework
#    Copyright (C) 1997 T. Hruz, L. Koren
#    1998 L. Koren

#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.

#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.

#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

srcdir = @srcdir@

prefix = $(srcdir)
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
libdir =

VPATH = @srcdir@

CC = @CC@
ADD_IDIR = @ADD_IDIR@
YACC = @YACC@
YACCFLAGS = -dv
LEX = @LEX@
CFLAGS = @CFLAGS@ -Wall
INCLUDES = -I. -I$(srcdir) -I$(srcdir)/example
X_CFLAGS = @X_CFLAGS@
X_LIBS = @X_LIBS@ -lX11
X_EXTRA_LIBS = @X_EXTRA_LIBS@
ADD_OBJS = @ADD_OBJS@
ADD_FORK = @ADD_FORK@
LIBS = @LIBS@ -lm 
DEFS = @DEFS@ -DXWIN
INSTALL = 
INSTALL_PROGRAM = 
INSTALL_DATA =

ALL_CFLAGS = $(ADD_IDIR) $(CFLAGS) $(X_CFLAGS)

SHELL = /bin/sh

SH_OBJS = @SH_OBJS@

OBJS = c-parser.o c-lex.o keyword.o rs-parser.o rs-lex.o tables.o \
       help.o global.o store_cont.o virtual_machine.o clif.o getc_unix.o \
       comp_maint.o allocx.o printf_unix.o input.o memmove.o symbols.o \
       remote_call.o ch-parser.o ch-lex.o channel_maint.o s-conv.o \
       dbg-out.o pso.o \
       $(ADD_OBJS) $(SH_OBJS)

ALL = all.config all.progs

version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.h`

.c.o:
	$(CC) -c $(DEFS) $(ALL_CFLAGS) $(INCLUDES) $<

all: $(ALL)

all.progs: @PROGS@

all.config: config.status auto-config.h

install:

uninstall:

check: all
	@cwd=`pwd`; \
	cd $(srcdir)/tests; ./check-them $$cwd

clif: $(OBJS)
	$(CC) $(OBJS) $(LIBS) $(X_LIBS) $(X_EXTRA_LIBS) -o clif

dvi: doc/guide_users.dvi doc/guide_programmers.dvi


# Avoid a lot of time thinking about remaking Makefile.in.
.SUFFIXES: .in

Makefile: $(srcdir)/Makefile.in config.status $(srcdir)/version.h
	cp config.status config.run
	$(SHELL) config.run
	rm -f config.run

$(srcdir)/configure: $(srcdir)/configure.in
	cd $(srcdir); autoconf

# autoheader might not change config.h.in, so touch a stamp file.
$(srcdir)/config.in: $(srcdir)/stamp-h.in
$(srcdir)/stamp-h.in: $(srcdir)/configure.in $(srcdir)/acconfig.h
	cd $(srcdir) && autoheader
	echo timestamp > $(srcdir)/stamp-h.in

auto-config.h: stamp-h 
stamp-h: config.in config.status
	CONFIG_HEADERS=auto-config.h:config.in $(SHELL) config.status
	echo > stamp-h

config.status: configure
	@if [ ! -f config.status ]; then \
		echo You must configure clif. ; \
		false; \
	else \
		$(SHELL) config.status --recheck; \
	fi



# object of the main parser function

c-parser.o: c-parser.c global.h instr.h geninstr.h \
  control.h type.h mystdio.h struct.h ys.h parser.h \
  allocx.h load.h virtual_machine.h ls.h memmove.h \
  tables.h remote_call.h printfx.h s-conv.h flags.h \
  config.h pso.h

c-lex.o: c-lex.c config.h global.h mystdio.h token.h \
  input.h buf.h allocx.h dbg-out.h tables.h 

keyword.o: keyword.c token.h config.h

# interaface to remote procedure call

remote_call.o: remote_call.c global.h intrinsic.h myintrinsic.c \
  type.h struct.h define.h load.c load.h mystdio.h allocx.h \
  remote_call.h config.h


# object of the run string compiler

rs-parser.o: rs-parser.c flags.h


rs-lex.o: rs-lex.c init_rs.c allocx.h rs-parser.h

# object of the virtual machine 

virtual_machine.o: virtual_machine.c global.h cast.h instr.h \
  input.h virtual_machine.h printfx.h tables.h config.h lex_t.h


# global variables and parameters

global.o: global.c type.h


# inerrupt handler maintenance 

inter_handl_svr3.o: inter_handl_svr3.c global.h config.h

inter_handl_bsd.o: inter_handl_bsd.c global.h config.h

inter_handl_svr4.o: inter_handl_svr4.c global.h config.h

inter_handl_lin.o: inter_handl_lin.c global.h config.h

inter_handl_posix.o: inter_handl_posix.c global.h config.h

# procedures for switching context of the virtual
# machine in interrupt handling

store_cont.o: store_cont.c global.h mystdio.h input.h \
  allocx.h lex_t.h

# machine dependent main function

clif.o: clif.c global.h config.h


# machine dependent getc function

getc_unix.o: getc_unix.c


# main compiler maintenance

comp_maint.o: comp_maint.c global.h define.h control.h \
  struct.h type.h mystdio.h instr.h token.h geninstr.h \
  comp_maint.h version.h allocx.h ys.h run_str.h ls.h \
  tables.h input.h printfx.h s-conv.h config.h flags.h \
  virtual_machine.h

# symbol table maintenance

tables.o: tables.c global.h cast.h struct.h define.h mystdio.h \
  type.h token.h instr.h allocx.h comp_maint.h tables.h printfx.h \
  flags.h config.h

# machine dependent alloc function

allocx.o: allocx.c config.h allocx.h global.h

# machine dependent "print" function

printf_unix.o: printf_unix.c printfx.h

# machine dependent "memmove" function

memmove.o: memmove.c global.h cast.h memmove.h

# redefined input of the main compiler

input.o: input.c global.h input.h lex_t.h

# function printing command line options

help.o: help.c 

# saving a copy of each string

symbols.o: symbols.c allocx.h

# conversion strings

s-conv.o: s-conv.c global.h allocx.h type.h struct.h comp_maint.h \
  s-conv.h flags.h

# debugging support

dbg-out.o: dbg-out.c global.h allocx.h printfx.h dbg-out.h

# parser support functions

pso.o: pso.c global.h geninstr.h flags.h comp_maint.h pso.h \
  struct.h tables.h type.h instr.h allocx.h



# non compulsive parts begin here
#
# graphics interface - dynamic library
 
libclif_x.so: ch-parser.o ch-lex.o remote_call.o channel_maint.o \
  example/lin_clnt.o example/lin_xdr.o 
	ld $(ALL_LDFLAGS) ch-parser.o ch-lex.o remote_call.o \
	channel_maint.o example/lin_clnt.o example/lin_xdr.o -o libclif_x.so
	cp libclif_x.so $(HOME)/lib/libclif_x.so

ch-parser.o: ch-parser.c global.h mystdio.h channel_maint.h \
	      allocx.h printfx.h

ch-lex.o: ch-lex.c buf.h init_ch.c mystdio.h

channel_maint.o: channel_maint.c channel_maint.h mystdio.h \
  xwin.c graph.c wind.c wind_w.c

$(srcdir)/ch-parser.c: $(srcdir)/channel.y
	cd $(srcdir); $(YACC) $(YACCFLAGS) channel.y
	@$(srcdir)/utils/yy _channel $(srcdir)/y.tab.c > $(srcdir)/ch-parser.c
	@$(srcdir)/utils/yy _channel $(srcdir)/y.tab.h > $(srcdir)/ch-parser.h
	@rm $(srcdir)/y.tab.c $(srcdir)/y.tab.h

$(srcdir)/ch-lex.c: $(srcdir)/channel.l
	cd $(srcdir); $(LEX) channel.l
	@$(srcdir)/utils/yy _channel $(srcdir)/lex.yy.c > $(srcdir)/ch-lex.c
	@rm $(srcdir)/lex.yy.c

rw: $(srcdir)/rw.c $(srcdir)/sigig.c $(srcdir)/sigig_bsd.c \
  $(srcdir)/sigig_lin.c $(srcdir)/sigig_posix.c
	$(CC) $(DEFS) $(ALL_CFLAGS) $(INCLUDES) $(srcdir)/rw.c \
	$(ADD_FORK) $(LDFLAGS) $(LIBS) $(X_LIBS) $(X_EXTRA_LIBS) -o rw



# grammar of the clif

$(srcdir)/c-parser.c: $(srcdir)/ys.y 
	cd $(srcdir); $(YACC) $(YACCFLAGS) ys.y
	@mv $(srcdir)/y.tab.c $(srcdir)/c-parser.c
	@mv $(srcdir)/y.tab.h $(srcdir)/token.h

# lexical analysis of the clif

$(srcdir)/c-lex.c: $(srcdir)/ls.l
	cd $(srcdir); $(LEX) ls.l
	@mv $(srcdir)/lex.yy.c $(srcdir)/c-lex.c
	@if test $(LEX) = flex; then \
		echo "#define FLEX_SCANNER" > lex_t.h; \
	else \
		echo "#undef FLEX_SCANNER" > lex_t.h; \
	fi

# grammar of the run string parsing

$(srcdir)/rs-parser.c: $(srcdir)/run_str.y
	cd $(srcdir); $(YACC) $(YACCFLAGS) run_str.y
	@$(srcdir)/utils/yy _rs_ $(srcdir)/y.tab.c > $(srcdir)/rs-parser.c
	@$(srcdir)/utils/yy _rs_ $(srcdir)/y.tab.h > $(srcdir)/rs-parser.h
	@rm $(srcdir)/y.tab.c $(srcdir)/y.tab.h

# lexical analysis of a run string

$(srcdir)/rs-lex.c: $(srcdir)/run_str.l
	cd $(srcdir); $(LEX) run_str.l
	@$(srcdir)/utils/yy _rs_ $(srcdir)/lex.yy.c > $(srcdir)/rs-lex.c
	@rm $(srcdir)/lex.yy.c

$(srcdir)/keyword.c: $(srcdir)/keyword.gperf
	gperf -t -p -k 2,3 $(srcdir)/keyword.gperf > $(srcdir)/keyword.c



# Optional parts

lin_clnt.o: example/lin_clnt.c example/lin.h
	$(CC) -c $(DEFS) $(ALL_CFLAGS) $(INCLUDES) $<

lin_xdr.o: example/lin_xdr.c example/lin.h
	$(CC) -c $(DEFS) $(ALL_CFLAGS) $(INCLUDES) $<



$(srcdir)/utils/yy: $(srcdir)/utils/yy.c
	cd $(srcdir)/utils; $(CC) yy.c -o yy


#############################################################

# Update the tags table
TAGS: force
	cd $(srcdir);              \
	mkdir temp;                \
	mv -f *-parser.[ch] temp;  \
	etags *.y *.h *.c;	   \
	mv temp/* .;		   \
	rm -rf temp

#############################################################



sharedclean:
	rm -f *.so
	rm -f $(HOME)/libclif_x.so

extraclean: distclean
	-rm -f *.tar *.xtar *diff *.diff.* *.tar.* *.xtar.* *diffs
	-rm -f *.gz
	-rm -f y.*
	-rm -f utils/yy
	-rm -rf clif-$(version) tmp

maintainer-clean: distclean
	-rm -f c-lex.c *-parser.* ch-lex.* rs-lex.* y.*
	-rm TAGS

distclean: clean
	-rm -f Makefile 
	-rm -f config.status config.cache auto-config.h
	-rm -f doc/*.aux doc/*.idx doc/*.ilg doc/*.ind \
	doc/*.log doc/*.lof doc/*.toc
	-rm -f *dumb.*
	-rm -f stamp-h

clean: mostlyclean
	-rm -f @PROGS@

mostlyclean:
	-rm -f *.o *~ "#"*"#" *.dvi *.log *core code *.flc



# Create the distribution tar.gz file
dist: clif.xtar
	gzip --best < clif.xtar > tmp-clif.xtar.gz
	mv tmp-clif.xtar.gz clif-$(version).tar.gz


clif.xtar: distdir
	tar -chf clif.xtar clif-$(version)

distdir: distdir-start distdir-finish

distdir-start: 
	@if grep -s "\myver}{$(version)" doc/guide_programmers.tex > /dev/null; \
	then true; \
	else echo "You must update version number in \`doc/guide_programmers.tex'"; sleep 10; \
	fi
# Update version number in README
	awk '$$1 == "Version" \
	     { $$2 = version; print "\t\t\t",$$0 } \
	     $$1 != "Version"' \
	    version=$(version) README > tmp.README
	mv tmp.README README
	-rm -rf clif-$(version) tmp
# Put all the files in a temporary subdirectory
# which has the name that we want to have in the tar file.
	mkdir tmp
	mkdir tmp/example
	mkdir tmp/tests
	mkdir tmp/doc
	mkdir tmp/utils
	for file in *[0-9a-zA-Z+]; do \
	  ln $$file tmp > /dev/null 2>&1 || cp $$file tmp; \
	done
	cd example; \
	for file in *[0-9a-zA-Z+]; do \
	  if test -d $$file && test "$$file" != RCS; then \
	    mkdir ../tmp/example/$$file; \
	    cd $$file; \
	    for subfile in *[0-9a-zA-Z+]; do \
	      ln $$subfile ../../tmp/example/$$file > /dev/null 2>&1 \
	      || cp $$subfile ../../tmp/example/$$file; \
	    done; \
	    cd ..; \
	  else \
	    ln $$file ../tmp/example > /dev/null 2>&1 \
	    || cp $$file ../tmp/example; \
	  fi; \
	done
	cd tests; \
	for file in *[0-9a-zA-Z+]; do \
	  if test -d $$file && test "$$file" != RCS; then \
	    mkdir ../tmp/tests/$$file; \
	    cd $$file; \
	    for subfile in *[0-9a-zA-Z+]; do \
	      ln $$subfile ../../tmp/tests/$$file > /dev/null 2>&1 \
	      || cp $$subfile ../../tmp/tests/$$file; \
	    done; \
	    cd ..; \
	  else \
	    ln $$file ../tmp/tests > /dev/null 2>&1 \
	    || cp $$file ../tmp/tests; \
	  fi; \
	done
	cd doc; \
	for file in *[0-9a-zA-Z+]; do \
	  if test -d $$file && test "$$file" != RCS; then \
	    mkdir ../tmp/doc/$$file; \
	    cd $$file; \
	    for subfile in *[0-9a-zA-Z+]; do \
	      ln $$subfile ../../tmp/doc/$$file > /dev/null 2>&1 \
	      || cp $$subfile ../../tmp/doc/$$file; \
	    done; \
	    cd ..; \
	  else \
	    ln $$file ../tmp/doc > /dev/null 2>&1 \
	    || cp $$file ../tmp/doc; \
	  fi; \
	done
	cd utils; \
	for file in *[0-9a-zA-Z+]; do \
	  if test -d $$file && test "$$file" != RCS; then \
	    mkdir ../tmp/utils/$$file; \
	    cd $$file; \
	    for subfile in *[0-9a-zA-Z+]; do \
	      ln $$subfile ../../tmp/utils/$$file > /dev/null 2>&1 \
	      || cp $$subfile ../../tmp/utils/$$file; \
	    done; \
	    cd ..; \
	  else \
	    ln $$file ../tmp/utils > /dev/null 2>&1 \
	    || cp $$file ../tmp/utils; \
	  fi; \
	done

distdir-finish:
	mv tmp clif-$(version)
	cd clif-$(version); make extraclean

# make diff oldversion=M.N 
# creates a diff file between an older distribution and this one.
# The -P option assumes this is GNU diff.
diff:
	diff -rc2P -x "*.dvi" \
	-x TAGS -x INSTALL -x configure \
	clif-$(oldversion) clif-$(version) > clif-$(oldversion)-$(version).diff



doc/guide_programmers.dvi: doc/guide_programmers.tex
	cd doc; latex guide_programmers.tex
	cd doc; latex guide_programmers.tex
	cd doc; makeindex guide_programmers.idx
	cd doc; latex guide_programmers.tex

doc/guide_users.dvi: doc/guide_users.tex
	cd doc; latex guide_users.tex
	cd doc; latex guide_users.tex
	cd doc; makeindex guide_users.idx
	cd doc; latex guide_users.tex



force: