~ubuntu-branches/ubuntu/oneiric/clif/oneiric

« back to all changes in this revision

Viewing changes to Makefile.in

  • Committer: Bazaar Package Importer
  • Author(s): Adrian Bunk
  • Date: 2002-01-25 14:05:49 UTC
  • Revision ID: james.westby@ubuntu.com-20020125140549-v5mmddxqlcrgzhd2
Tags: upstream-0.93
ImportĀ upstreamĀ versionĀ 0.93

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#    Clif - A C-like Interpreter Framework
 
2
#    Copyright (C) 1997 T. Hruz, L. Koren
 
3
#    1998 L. Koren
 
4
 
 
5
#    This program is free software; you can redistribute it and/or modify
 
6
#    it under the terms of the GNU General Public License as published by
 
7
#    the Free Software Foundation; either version 2 of the License, or
 
8
#    (at your option) any later version.
 
9
 
 
10
#    This program is distributed in the hope that it will be useful,
 
11
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
#    GNU General Public License for more details.
 
14
 
 
15
#    You should have received a copy of the GNU General Public License
 
16
#    along with this program; if not, write to the Free Software
 
17
#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
18
 
 
19
srcdir = @srcdir@
 
20
 
 
21
prefix = $(srcdir)
 
22
exec_prefix = $(prefix)
 
23
bindir = $(exec_prefix)/bin
 
24
libdir =
 
25
 
 
26
VPATH = @srcdir@
 
27
 
 
28
CC = @CC@
 
29
ADD_IDIR = @ADD_IDIR@
 
30
YACC = @YACC@
 
31
YACCFLAGS = -dv
 
32
LEX = @LEX@
 
33
CFLAGS = @CFLAGS@
 
34
INCLUDES = -I. -I$(srcdir) -I$(srcdir)/example
 
35
X_CFLAGS = @X_CFLAGS@
 
36
X_LIBS = @X_LIBS@ -lX11
 
37
X_EXTRA_LIBS = @X_EXTRA_LIBS@
 
38
ADD_OBJS = @ADD_OBJS@
 
39
ADD_FORK = @ADD_FORK@
 
40
LIBS = @LIBS@ -lm 
 
41
DEFS = @DEFS@ -DXWIN
 
42
INSTALL = 
 
43
INSTALL_PROGRAM = 
 
44
INSTALL_DATA =
 
45
 
 
46
ALL_CFLAGS = $(ADD_IDIR) $(CFLAGS) $(X_CFLAGS)
 
47
 
 
48
SHELL = /bin/sh
 
49
 
 
50
SH_OBJS = @SH_OBJS@
 
51
 
 
52
OBJS = c-parser.o c-lex.o keyword.o rs-parser.o rs-lex.o tables.o \
 
53
       help.o global.o store_cont.o virtual_machine.o clif.o getc_unix.o \
 
54
       comp_maint.o allocx.o printf_unix.o input.o memmove.o symbols.o \
 
55
       remote_call.o ch-parser.o ch-lex.o channel_maint.o s-conv.o \
 
56
       dbg-out.o pso.o \
 
57
       $(ADD_OBJS) $(SH_OBJS)
 
58
 
 
59
ALL = all.config all.progs
 
60
 
 
61
version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.h`
 
62
 
 
63
.c.o:
 
64
        $(CC) -c $(DEFS) $(ALL_CFLAGS) $(INCLUDES) $<
 
65
 
 
66
all: $(ALL)
 
67
 
 
68
all.progs: @PROGS@
 
69
 
 
70
all.config: config.status auto-config.h
 
71
 
 
72
install:
 
73
 
 
74
uninstall:
 
75
 
 
76
check: all
 
77
        @cwd=`pwd`; \
 
78
        cd $(srcdir)/tests; ./check-them $$cwd
 
79
 
 
80
clif: $(OBJS)
 
81
        $(CC) $(OBJS) $(LIBS) $(X_LIBS) $(X_EXTRA_LIBS) -o clif
 
82
 
 
83
dvi: doc/guide_users.dvi doc/guide_programmers.dvi
 
84
 
 
85
 
 
86
# Avoid a lot of time thinking about remaking Makefile.in.
 
87
.SUFFIXES: .in
 
88
 
 
89
Makefile: $(srcdir)/Makefile.in config.status $(srcdir)/version.h
 
90
        cp config.status config.run
 
91
        $(SHELL) config.run
 
92
        rm -f config.run
 
93
 
 
94
$(srcdir)/configure: $(srcdir)/configure.in
 
95
        cd $(srcdir); autoconf
 
96
 
 
97
# autoheader might not change config.h.in, so touch a stamp file.
 
98
$(srcdir)/config.in: $(srcdir)/stamp-h.in
 
99
$(srcdir)/stamp-h.in: $(srcdir)/configure.in $(srcdir)/acconfig.h
 
100
        cd $(srcdir) && autoheader
 
101
        echo timestamp > $(srcdir)/stamp-h.in
 
102
 
 
103
auto-config.h: stamp-h 
 
104
stamp-h: config.in config.status
 
105
        CONFIG_HEADERS=auto-config.h:config.in $(SHELL) config.status
 
106
        echo > stamp-h
 
107
 
 
108
config.status: configure
 
109
        @if [ ! -f config.status ]; then \
 
110
                echo You must configure clif. ; \
 
111
                false; \
 
112
        else \
 
113
                $(SHELL) config.status --recheck; \
 
114
        fi
 
115
 
 
116
 
 
117
 
 
118
# object of the main parser function
 
119
 
 
120
c-parser.o: c-parser.c global.h instr.h geninstr.h \
 
121
  control.h type.h mystdio.h struct.h ys.h parser.h \
 
122
  allocx.h load.h virtual_machine.h ls.h memmove.h \
 
123
  tables.h remote_call.h printfx.h s-conv.h flags.h \
 
124
  config.h pso.h
 
125
 
 
126
c-lex.o: c-lex.c config.h global.h mystdio.h token.h \
 
127
  input.h buf.h allocx.h dbg-out.h tables.h 
 
128
 
 
129
keyword.o: keyword.c token.h config.h
 
130
 
 
131
# interaface to remote procedure call
 
132
 
 
133
remote_call.o: remote_call.c global.h intrinsic.h myintrinsic.c \
 
134
  type.h struct.h define.h load.c load.h mystdio.h allocx.h \
 
135
  remote_call.h config.h
 
136
 
 
137
 
 
138
# object of the run string compiler
 
139
 
 
140
rs-parser.o: rs-parser.c flags.h
 
141
 
 
142
 
 
143
rs-lex.o: rs-lex.c init_rs.c allocx.h rs-parser.h
 
144
 
 
145
# object of the virtual machine 
 
146
 
 
147
virtual_machine.o: virtual_machine.c global.h cast.h instr.h \
 
148
  input.h virtual_machine.h printfx.h tables.h config.h lex_t.h
 
149
 
 
150
 
 
151
# global variables and parameters
 
152
 
 
153
global.o: global.c type.h
 
154
 
 
155
 
 
156
# inerrupt handler maintenance 
 
157
 
 
158
inter_handl_svr3.o: inter_handl_svr3.c global.h config.h
 
159
 
 
160
inter_handl_bsd.o: inter_handl_bsd.c global.h config.h
 
161
 
 
162
inter_handl_svr4.o: inter_handl_svr4.c global.h config.h
 
163
 
 
164
inter_handl_lin.o: inter_handl_lin.c global.h config.h
 
165
 
 
166
inter_handl_posix.o: inter_handl_posix.c global.h config.h
 
167
 
 
168
# procedures for switching context of the virtual
 
169
# machine in interrupt handling
 
170
 
 
171
store_cont.o: store_cont.c global.h mystdio.h input.h \
 
172
  allocx.h lex_t.h
 
173
 
 
174
# machine dependent main function
 
175
 
 
176
clif.o: clif.c global.h config.h
 
177
 
 
178
 
 
179
# machine dependent getc function
 
180
 
 
181
getc_unix.o: getc_unix.c
 
182
 
 
183
 
 
184
# main compiler maintenance
 
185
 
 
186
comp_maint.o: comp_maint.c global.h define.h control.h \
 
187
  struct.h type.h mystdio.h instr.h token.h geninstr.h \
 
188
  comp_maint.h version.h allocx.h ys.h run_str.h ls.h \
 
189
  tables.h input.h printfx.h s-conv.h config.h flags.h \
 
190
  virtual_machine.h
 
191
 
 
192
# symbol table maintenance
 
193
 
 
194
tables.o: tables.c global.h cast.h struct.h define.h mystdio.h \
 
195
  type.h token.h instr.h allocx.h comp_maint.h tables.h printfx.h \
 
196
  flags.h config.h
 
197
 
 
198
# machine dependent alloc function
 
199
 
 
200
allocx.o: allocx.c config.h allocx.h global.h
 
201
 
 
202
# machine dependent "print" function
 
203
 
 
204
printf_unix.o: printf_unix.c printfx.h
 
205
 
 
206
# machine dependent "memmove" function
 
207
 
 
208
memmove.o: memmove.c global.h cast.h memmove.h
 
209
 
 
210
# redefined input of the main compiler
 
211
 
 
212
input.o: input.c global.h input.h lex_t.h
 
213
 
 
214
# function printing command line options
 
215
 
 
216
help.o: help.c 
 
217
 
 
218
# saving a copy of each string
 
219
 
 
220
symbols.o: symbols.c allocx.h
 
221
 
 
222
# conversion strings
 
223
 
 
224
s-conv.o: s-conv.c global.h allocx.h type.h struct.h comp_maint.h \
 
225
  s-conv.h flags.h
 
226
 
 
227
# debugging support
 
228
 
 
229
dbg-out.o: dbg-out.c global.h allocx.h printfx.h dbg-out.h
 
230
 
 
231
# parser support functions
 
232
 
 
233
pso.o: pso.c global.h geninstr.h flags.h comp_maint.h pso.h \
 
234
  struct.h tables.h type.h instr.h allocx.h
 
235
 
 
236
 
 
237
 
 
238
# non compulsive parts begin here
 
239
#
 
240
# graphics interface - dynamic library
 
241
 
 
242
libclif_x.so: ch-parser.o ch-lex.o remote_call.o channel_maint.o \
 
243
  example/lin_clnt.o example/lin_xdr.o 
 
244
        ld $(ALL_LDFLAGS) ch-parser.o ch-lex.o remote_call.o \
 
245
        channel_maint.o example/lin_clnt.o example/lin_xdr.o -o libclif_x.so
 
246
        cp libclif_x.so $(HOME)/lib/libclif_x.so
 
247
 
 
248
ch-parser.o: ch-parser.c global.h mystdio.h channel_maint.h \
 
249
              allocx.h printfx.h
 
250
 
 
251
ch-lex.o: ch-lex.c buf.h init_ch.c mystdio.h
 
252
 
 
253
channel_maint.o: channel_maint.c channel_maint.h mystdio.h \
 
254
  xwin.c graph.c wind.c wind_w.c
 
255
 
 
256
$(srcdir)/ch-parser.c: $(srcdir)/channel.y
 
257
        cd $(srcdir); $(YACC) $(YACCFLAGS) channel.y
 
258
        @$(srcdir)/utils/yy _channel $(srcdir)/y.tab.c > $(srcdir)/ch-parser.c
 
259
        @$(srcdir)/utils/yy _channel $(srcdir)/y.tab.h > $(srcdir)/ch-parser.h
 
260
        @rm $(srcdir)/y.tab.c $(srcdir)/y.tab.h
 
261
 
 
262
$(srcdir)/ch-lex.c: $(srcdir)/channel.l
 
263
        cd $(srcdir); $(LEX) channel.l
 
264
        @$(srcdir)/utils/yy _channel $(srcdir)/lex.yy.c > $(srcdir)/ch-lex.c
 
265
        @rm $(srcdir)/lex.yy.c
 
266
 
 
267
rw: $(srcdir)/rw.c $(srcdir)/sigig.c $(srcdir)/sigig_bsd.c \
 
268
  $(srcdir)/sigig_lin.c $(srcdir)/sigig_posix.c
 
269
        $(CC) $(DEFS) $(ALL_CFLAGS) $(INCLUDES) $(srcdir)/rw.c \
 
270
        $(ADD_FORK) $(LDFLAGS) $(LIBS) $(X_LIBS) $(X_EXTRA_LIBS) -o rw
 
271
 
 
272
 
 
273
 
 
274
# grammar of the clif
 
275
 
 
276
$(srcdir)/c-parser.c: $(srcdir)/ys.y 
 
277
        cd $(srcdir); $(YACC) $(YACCFLAGS) ys.y
 
278
        @mv $(srcdir)/y.tab.c $(srcdir)/c-parser.c
 
279
        @mv $(srcdir)/y.tab.h $(srcdir)/token.h
 
280
 
 
281
# lexical analysis of the clif
 
282
 
 
283
$(srcdir)/c-lex.c: $(srcdir)/ls.l
 
284
        cd $(srcdir); $(LEX) ls.l
 
285
        @mv $(srcdir)/lex.yy.c $(srcdir)/c-lex.c
 
286
        @if test $(LEX) = flex; then \
 
287
                echo "#define FLEX_SCANNER" > lex_t.h; \
 
288
        else \
 
289
                echo "#undef FLEX_SCANNER" > lex_t.h; \
 
290
        fi
 
291
 
 
292
# grammar of the run string parsing
 
293
 
 
294
$(srcdir)/rs-parser.c: $(srcdir)/run_str.y
 
295
        cd $(srcdir); $(YACC) $(YACCFLAGS) run_str.y
 
296
        @$(srcdir)/utils/yy _rs_ $(srcdir)/y.tab.c > $(srcdir)/rs-parser.c
 
297
        @$(srcdir)/utils/yy _rs_ $(srcdir)/y.tab.h > $(srcdir)/rs-parser.h
 
298
        @rm $(srcdir)/y.tab.c $(srcdir)/y.tab.h
 
299
 
 
300
# lexical analysis of a run string
 
301
 
 
302
$(srcdir)/rs-lex.c: $(srcdir)/run_str.l
 
303
        cd $(srcdir); $(LEX) run_str.l
 
304
        @$(srcdir)/utils/yy _rs_ $(srcdir)/lex.yy.c > $(srcdir)/rs-lex.c
 
305
        @rm $(srcdir)/lex.yy.c
 
306
 
 
307
$(srcdir)/keyword.c: $(srcdir)/keyword.gperf
 
308
        gperf -t -p -k 2,3 $(srcdir)/keyword.gperf > $(srcdir)/keyword.c
 
309
 
 
310
 
 
311
 
 
312
# Optional parts
 
313
 
 
314
lin_clnt.o: example/lin_clnt.c example/lin.h
 
315
        $(CC) -c $(DEFS) $(ALL_CFLAGS) $(INCLUDES) $<
 
316
 
 
317
lin_xdr.o: example/lin_xdr.c example/lin.h
 
318
        $(CC) -c $(DEFS) $(ALL_CFLAGS) $(INCLUDES) $<
 
319
 
 
320
 
 
321
 
 
322
$(srcdir)/utils/yy: $(srcdir)/utils/yy.c
 
323
        cd $(srcdir)/utils; $(CC) yy.c -o yy
 
324
 
 
325
 
 
326
#############################################################
 
327
 
 
328
# Update the tags table
 
329
TAGS: force
 
330
        cd $(srcdir);              \
 
331
        mkdir temp;                \
 
332
        mv -f *-parser.[ch] temp;  \
 
333
        etags *.y *.h *.c;         \
 
334
        mv temp/* .;               \
 
335
        rm -rf temp
 
336
 
 
337
#############################################################
 
338
 
 
339
 
 
340
 
 
341
sharedclean:
 
342
        rm -f *.so
 
343
        rm -f $(HOME)/libclif_x.so
 
344
 
 
345
extraclean: distclean
 
346
        -rm -f *.tar *.xtar *diff *.diff.* *.tar.* *.xtar.* *diffs
 
347
        -rm -f *.gz
 
348
        -rm -f y.*
 
349
        -rm -f utils/yy
 
350
        -rm -rf clif-$(version) tmp
 
351
 
 
352
maintainer-clean: distclean
 
353
        -rm -f c-lex.c *-parser.* ch-lex.* rs-lex.* y.*
 
354
        -rm TAGS
 
355
 
 
356
distclean: clean
 
357
        -rm -f Makefile 
 
358
        -rm -f config.status config.cache auto-config.h
 
359
        -rm -f doc/*.aux doc/*.idx doc/*.ilg doc/*.ind \
 
360
        doc/*.log doc/*.lof doc/*.toc
 
361
        -rm -f *dumb.*
 
362
        -rm -f stamp-h
 
363
 
 
364
clean: mostlyclean
 
365
        -rm -f @PROGS@
 
366
 
 
367
mostlyclean:
 
368
        -rm -f *.o *~ "#"*"#" *.dvi *.log *core code *.flc
 
369
 
 
370
 
 
371
 
 
372
# Create the distribution tar.gz file
 
373
dist: clif.xtar
 
374
        gzip --best < clif.xtar > tmp-clif.xtar.gz
 
375
        mv tmp-clif.xtar.gz clif-$(version).tar.gz
 
376
 
 
377
 
 
378
clif.xtar: distdir
 
379
        tar -chf clif.xtar clif-$(version)
 
380
 
 
381
distdir: distdir-start distdir-finish
 
382
 
 
383
distdir-start: 
 
384
        @if grep -s "\myver}{$(version)" doc/guide_programmers.tex > /dev/null; \
 
385
        then true; \
 
386
        else echo "You must update version number in \`doc/guide_programmers.tex'"; sleep 10; \
 
387
        fi
 
388
# Update version number in README
 
389
        awk '$$1 == "Version" \
 
390
             { $$2 = version; print "\t\t\t",$$0 } \
 
391
             $$1 != "Version"' \
 
392
            version=$(version) README > tmp.README
 
393
        mv tmp.README README
 
394
        -rm -rf clif-$(version) tmp
 
395
# Put all the files in a temporary subdirectory
 
396
# which has the name that we want to have in the tar file.
 
397
        mkdir tmp
 
398
        mkdir tmp/example
 
399
        mkdir tmp/tests
 
400
        mkdir tmp/doc
 
401
        mkdir tmp/utils
 
402
        for file in *[0-9a-zA-Z+]; do \
 
403
          ln $$file tmp > /dev/null 2>&1 || cp $$file tmp; \
 
404
        done
 
405
        cd example; \
 
406
        for file in *[0-9a-zA-Z+]; do \
 
407
          if test -d $$file && test "$$file" != RCS; then \
 
408
            mkdir ../tmp/example/$$file; \
 
409
            cd $$file; \
 
410
            for subfile in *[0-9a-zA-Z+]; do \
 
411
              ln $$subfile ../../tmp/example/$$file > /dev/null 2>&1 \
 
412
              || cp $$subfile ../../tmp/example/$$file; \
 
413
            done; \
 
414
            cd ..; \
 
415
          else \
 
416
            ln $$file ../tmp/example > /dev/null 2>&1 \
 
417
            || cp $$file ../tmp/example; \
 
418
          fi; \
 
419
        done
 
420
        cd tests; \
 
421
        for file in *[0-9a-zA-Z+]; do \
 
422
          if test -d $$file && test "$$file" != RCS; then \
 
423
            mkdir ../tmp/tests/$$file; \
 
424
            cd $$file; \
 
425
            for subfile in *[0-9a-zA-Z+]; do \
 
426
              ln $$subfile ../../tmp/tests/$$file > /dev/null 2>&1 \
 
427
              || cp $$subfile ../../tmp/tests/$$file; \
 
428
            done; \
 
429
            cd ..; \
 
430
          else \
 
431
            ln $$file ../tmp/tests > /dev/null 2>&1 \
 
432
            || cp $$file ../tmp/tests; \
 
433
          fi; \
 
434
        done
 
435
        cd doc; \
 
436
        for file in *[0-9a-zA-Z+]; do \
 
437
          if test -d $$file && test "$$file" != RCS; then \
 
438
            mkdir ../tmp/doc/$$file; \
 
439
            cd $$file; \
 
440
            for subfile in *[0-9a-zA-Z+]; do \
 
441
              ln $$subfile ../../tmp/doc/$$file > /dev/null 2>&1 \
 
442
              || cp $$subfile ../../tmp/doc/$$file; \
 
443
            done; \
 
444
            cd ..; \
 
445
          else \
 
446
            ln $$file ../tmp/doc > /dev/null 2>&1 \
 
447
            || cp $$file ../tmp/doc; \
 
448
          fi; \
 
449
        done
 
450
        cd utils; \
 
451
        for file in *[0-9a-zA-Z+]; do \
 
452
          if test -d $$file && test "$$file" != RCS; then \
 
453
            mkdir ../tmp/utils/$$file; \
 
454
            cd $$file; \
 
455
            for subfile in *[0-9a-zA-Z+]; do \
 
456
              ln $$subfile ../../tmp/utils/$$file > /dev/null 2>&1 \
 
457
              || cp $$subfile ../../tmp/utils/$$file; \
 
458
            done; \
 
459
            cd ..; \
 
460
          else \
 
461
            ln $$file ../tmp/utils > /dev/null 2>&1 \
 
462
            || cp $$file ../tmp/utils; \
 
463
          fi; \
 
464
        done
 
465
 
 
466
distdir-finish:
 
467
        mv tmp clif-$(version)
 
468
        cd clif-$(version); make extraclean
 
469
 
 
470
# make diff oldversion=M.N 
 
471
# creates a diff file between an older distribution and this one.
 
472
# The -P option assumes this is GNU diff.
 
473
diff:
 
474
        diff -rc2P -x "*.dvi" \
 
475
        -x TAGS -x INSTALL -x configure \
 
476
        clif-$(oldversion) clif-$(version) > clif-$(oldversion)-$(version).diff
 
477
 
 
478
 
 
479
 
 
480
doc/guide_programmers.dvi: doc/guide_programmers.tex
 
481
        cd doc; latex guide_programmers.tex
 
482
        cd doc; latex guide_programmers.tex
 
483
        cd doc; makeindex guide_programmers.idx
 
484
        cd doc; latex guide_programmers.tex
 
485
 
 
486
doc/guide_users.dvi: doc/guide_users.tex
 
487
        cd doc; latex guide_users.tex
 
488
        cd doc; latex guide_users.tex
 
489
        cd doc; makeindex guide_users.idx
 
490
        cd doc; latex guide_users.tex
 
491
 
 
492
 
 
493
 
 
494
force: