1: #Makefile for Gforth
2:
3: #Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc.
4:
5: #This file is part of Gforth.
6:
7: #Gforth is free software; you can redistribute it and/or
8: #modify it under the terms of the GNU General Public License
9: #as published by the Free Software Foundation; either version 2
10: #of the License, or (at your option) any later version.
11:
12: #This program is distributed in the hope that it will be useful,
13: #but WITHOUT ANY WARRANTY; without even the implied warranty of
14: #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.#See the
15: #GNU General Public License for more details.
16:
17: #You should have received a copy of the GNU General Public License
18: #along with this program; if not, write to the Free Software
19: #Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20:
21: # To change the values of `make' variables: instead of editing Makefiles,
22: # (1) if the variable is set in `config.status', edit `config.status'
23: # (which will cause the Makefiles to be regenerated when you run `make');
24: # (2) otherwise, pass the desired values on the `make' command line.
25:
26: # Warning:
27: # For some stupid reason setting SHELL to bash does not work properly with
28: # DOS. If you want to use shell-specific things that must run with DOS make
29: # an external batch file and call it with bash (see versions.bsh).
30:
31: # ------------- gforth version
32:
33: VERSION = @VERSION@
34: DOSVERSION=`echo $(VERSION)|sed 's/\.//g'|sed 's/-.*//g'`
35:
36: # ------------- System specific variables
37:
38: machine=@machine@
39: kernel_fi=@kernel_fi@
40: EXE=@EXE@
41:
42: # this is the type of machine
43: # used to extend the include path with ./arch/$machine
44: # so we can include a machine specific
45: # machine.h file
46:
47: PATHSEP = @PATHSEP@
48:
49: osclass = @OSCLASS@
50:
51: # ------------- Utility programs
52:
53: SHELL = /bin/sh
54: RM = rm
55: RMTREE = rm -rf
56: CP = cp -p
57: MV = mv
58: TAR = tar cf -
59: INSTALL = @INSTALL@
60: INSTALL_PROGRAM = @INSTALL_PROGRAM@
61: INSTALL_DATA = @INSTALL_DATA@
62: LN_S = @LN_S@
63: GCC = @CC@
64: CC = $(GCC)
65: FORTHPATH = .$(PATHSEP)$(libdir)/gforth/site-forth$(PATHSEP)$(siteforthdir)$(PATHSEP)$(libdir)/gforth/$(VERSION)$(PATHSEP)$(datadir)/gforth/$(VERSION)
66: FORTHSIZES = @FORTHSIZES@
67: FORTH_ARGS = --die-on-signal -p $(FORTHPATH)$(PATHSEP)$(srcdir)
68: ENGINE = ./gforth
69: FORTH = $(ENGINE) $(FORTH_ARGS)
70: ENGINE_FAST = $(ENGINE)-fast
71: FORTH_FAST = $(ENGINE_FAST) $(FORTH_ARGS)
72: FORTHKFLAGS= --die-on-signal -p ".$(PATHSEP)~+$(PATHSEP)$(srcdir)" -i $(kernel_fi)
73: FORTHK = $(ENGINE) $(FORTHKFLAGS)
74: FORTHP = $(ENGINE) --die-on-signal -i ./$(kernel_fi)
75: #the "-2 image-included-files +!" undoes the change to image-included-files
76: # in exboot.fs
77: STARTUP = -e 3 exboot.fs -e -2 -e image-included-files -e +! startup.fs @asm_fs@ @disasm_fs@
78: STRIP = strip
79: TEXI2DVI = texi2dvi -e
80: DVI2PS = dvips -Z
81: #you can get texi2html from http://wwwcn.cern.ch/dci/texi2html/
82: MAKEINFO = makeinfo
83: TEXI2HTML = texi2html
84:
85: # ------------- Compiler Flags
86:
87: XCFLAGS = @CFLAGS@
88: XDEFINES = @DEFS@
89: SWITCHES = $(XCFLAGS) $(XDEFINES) #-DNDEBUG #turn off assertions
90: ENGINE_FLAGS = @ENGINE_FLAGS@ -fno-defer-pop -fcaller-saves
91: DEBUGFLAG = @DEBUGFLAG@
92: CFLAGS = $(DEBUGFLAG) -I$(srcdir)/engine -I$(srcdir)/arch/$(machine) -O3 -Wall $(SWITCHES) -DDEFAULTPATH=\"$(FORTHPATH)\"
93:
94: #John Wavrik should use -Xlinker -N to get a writable text (executable)
95: XLDFLAGS = @LDFLAGS@
96: LDFLAGS = $(DEBUGFLAG) $(XLDFLAGS)
97: LDLIBS = @LIBS@
98:
99: # ------------ Install Directorys
100:
101: VPATH = @srcdir@
102: prefix = @prefix@
103: exec_prefix = @exec_prefix@
104: srcdir = @srcdir@
105: bindir = $(exec_prefix)/bin
106: #read-only architecture-independent files
107: datadir = $(prefix)/share
108: #read-only architecture-dependent non-ascii files
109: libdir = $(prefix)/lib
110: infodir = $(prefix)/info
111: mandir = $(prefix)/man
112: man1dir= $(mandir)/man1
113: man1ext= .1
114: #older emacses have their site-lisp in $(libdir)/emacs/
115: emacssitelispdir=@lispdir@
116: siteforthdir=$(datadir)/gforth/site-forth
117:
118: CVSDIRS = CVS engine/CVS kernel/CVS doc/CVS asm/CVS ec/CVS test/CVS \
119: compat/CVS \
120: arch/CVS arch/generic/CVS arch/m68k/CVS arch/mips/CVS \
121: arch/386/CVS arch/hppa/CVS arch/sparc/CVS arch/power/CVS \
122: arch/alpha/CVS arch/4stack/CVS arch/misc/CVS arch/6502/CVS \
123: arch/8086/CVS arch/avr/CVS arch/c165/CVS arch/h8/CVS \
124: arch/shboom/CVS
125:
126: INCLUDES = engine/forth.h engine/threaded.h engine/io.h
127:
128: KERN_SRC = \
129: mach16b.fs mach16l.fs mach32b.fs mach32l.fs mach64b.fs mach64l.fs \
130: machpc.fs \
131: kernel/aliases0.fs \
132: kernel/aliases.fs \
133: kernel/args.fs \
134: chains.fs \
135: kernel/cbr.fs \
136: kernel/cloop.fs \
137: kernel/cond.fs \
138: kernel/cond-old.fs \
139: cross.fs \
140: kernel/errore.fs \
141: kernel/files.fs \
142: kernel/require.fs \
143: kernel/paths.fs \
144: kernel/kernel.fs \
145: kernel/main.fs \
146: kernel/prim0.fs \
147: search.fs \
148: kernel/quotes.fs \
149: kernel/tools.fs \
150: kernel/toolsext.fs \
151: kernel/vars.fs \
152: kernel/accept.fs \
153: kernel/basics.fs \
154: kernel/int.fs \
155: kernel/comp.fs \
156: kernel/io.fs \
157: kernel/license.fs \
158: kernel/nio.fs \
159: kernel/saccept.fs \
160: kernel/doers.fs \
161: kernel/getdoers.fs \
162: kernel/pass.fs
163:
164: EC_SRC = \
165: asm/README \
166: asm/bitmask.fs \
167: asm/numref.fs \
168: asm/basic.fs \
169: asm/generic.fs \
170: asm/target.fs \
171: ec/README \
172: ec/mirror.fs \
173: ec/shex.fs \
174: ec/builttag.fs \
175: ec/dotx.fs \
176: ec/nesting.fs
177:
178: GFORTH_FI_SRC = \
179: assert.fs \
180: backtrac.fs \
181: blocked.fb \
182: blocks.fs \
183: bufio.fs \
184: debug.fs \
185: debugs.fs \
186: ekey.fs \
187: savesys.fs \
188: environ.fs \
189: errors.fs \
190: exboot.fs \
191: except.fs \
192: extend.fs \
193: float.fs \
194: glocals.fs \
195: hash.fs \
196: history.fs \
197: intcomp.fs \
198: locals.fs \
199: look.fs \
200: search.fs \
201: see.fs \
202: see-ext.fs \
203: source.fs \
204: startup.fs \
205: struct.fs \
206: stuff.fs \
207: tasker.fs \
208: termsize.fs \
209: vt100.fs \
210: vt100key.fs \
211: wordinfo.fs \
212: arch/386/asm.fs arch/386/disasm.fs \
213: arch/alpha/asm.fs arch/alpha/disasm.fs \
214: arch/mips/asm.fs arch/mips/disasm.fs arch/mips/insts.fs
215:
216: FORTH_SRC = $(KERN_SRC) $(GFORTH_FI_SRC) $(EC_SRC) \
217: ans-report.fs ansi.fs answords.fs \
218: code.fs colorize.fs comp-i.fs \
219: doskey.fs ds2texi.fs \
220: envos.fs envos.dos envos.os2 etags.fs filedump.fs fi2c.fs \
221: glosgen.fs gray.fs httpd.fs \
222: make-app.fs doc/makedoc.fs \
223: more.fs other.fs prims2x.fs random.fs \
224: table.fs string.fs \
225: tt.fs sokoban.fs \
226: unbuffer.fs wordsets.fs \
227: test/tester.fs test/coretest.fs test/postpone.fs test/dbltest.fs \
228: test/other.fs test/checkans.fs \
229: bubble.fs siev.fs matrix.fs fib.fs \
230: oof.fs oofsampl.fs objects.fs objexamp.fs mini-oof.fs moof-exm.fs \
231: moofglos.fs \
232: add.fs lib.fs sieve.fs
233:
234: COMPAT = compat/README \
235: compat/anslocal.fs \
236: compat/assert.fs \
237: compat/control.fs \
238: compat/defer.fs \
239: compat/exception.fs \
240: compat/loops.fs \
241: compat/required.fs \
242: compat/struct.fs \
243: compat/vocabulary.fs
244:
245: GFORTH_TEXI = doc/gforth.texi doc/version.texi
246:
247: ALLSUBDIRS = engine
248:
249: ARCHS = \
250: arch/generic/machine.h \
251: arch/m68k/machine.h \
252: arch/mips/machine.h \
253: arch/386/machine.h \
254: arch/hppa/machine.h \
255: arch/hppa/cache.c \
256: arch/sparc/machine.h \
257: arch/power/machine.h \
258: arch/power/_sync_cache_range.c \
259: arch/power/elf32ppc.x \
260: arch/alpha/machine.h \
261: arch/4stack/README \
262: arch/4stack/asm.fs \
263: arch/4stack/mach.fs \
264: arch/4stack/prim.fs \
265: arch/4stack/mach.sh \
266: arch/4stack/relocate.fs \
267: arch/misc/README \
268: arch/misc/asm.fs \
269: arch/misc/mach.fs \
270: arch/misc/prim.fs \
271: arch/misc/sim.fs \
272: arch/misc/sokoban.fs \
273: arch/misc/tt.fs \
274: arch/6502/asm.fs \
275: arch/6502/prim.fs \
276: arch/6502/mach.fs \
277: arch/6502/zero.fs \
278: arch/6502/softuart.fs \
279: arch/6502/cold.fs \
280: arch/8086/asm.fs \
281: arch/8086/mach.fs \
282: arch/8086/mach.sh \
283: arch/8086/prim.fs \
284: arch/avr/asm.fs \
285: arch/c165/asm.fs \
286: arch/c165/mach.fs \
287: arch/c165/prim.fs \
288: arch/h8/asm.fs \
289: arch/shboom/asm.fs \
290: arch/shboom/compiler.fs \
291: arch/shboom/dis.fs \
292: arch/shboom/mach.fs \
293: arch/shboom/prim.fs \
294: arch/shboom/dis2.fs \
295: arch/shboom/sh.p \
296: arch/shboom/doers.fs
297:
298: # arch/sharc/mach.fs \
299: # arch/sharc/machine.h \
300: # arch/sharc/compile.sharc \
301: # arch/sharc/unistd.h \
302: # arch/sharc/systypes.h \
303: # arch/sharc/types.h \
304: # arch/sharc/g21k-3.3.4-bp1.diff
305:
306: SOURCES = $(CVSDIRS) compat Makefile.in Makedist.in engine/Makefile.in gforthmi.in \
307: configure.in configure config.sub config.guess elisp-comp missing \
308: acconfig.h acinclude.m4 engine/config.h.in stamp-h.in \
309: install-sh INSTALL INSTALL.BINDIST NEWS README ToDo BUGS model \
310: COPYING AUTHORS ChangeLog Benchres aclocal.m4 \
311: doc/gforth.ds doc/texinfo.tex doc/gforth.1 doc/version.texi.in \
312: gforth.el \
313: prim engine/engine.c engine/main.c engine/io.c engine/memcmpc.c \
314: engine/signals.c $(ARCHS) \
315: engine/getopt.c engine/getopt1.c engine/getopt.h engine/select.c \
316: engine/ecvt.c engine/memcmp.c engine/strtol.c engine/strtoul.c \
317: engine/ansidecl.h engine/memmove.c \
318: engine/pow10.c engine/atanh.c engine/cleanalign.c \
319: engine/strerror.c engine/strsignal.c engine/dblsub.c \
320: engine/fnmatch.h engine/fnmatch.c \
321: INSTALL.DOS makefile.dos engine/makefile.dos mkdosmf.sed config.bat \
322: dosconf.h gforthmi.bat mkinstalldirs siteinit.fs \
323: versions.bsh \
324: configure.cmd mkos2mf.sed os2conf.h makefile.os2 engine/makefile.os2 \
325: gforthmi.cmd glosgen.glo doc/glossaries.doc \
326: $(INCLUDES) $(FORTH_SRC) $(COMPAT) \
327: timings.sc \
328: test/coretest.out test/checkans.out
329:
330: RCS_FILES = ToDo model high-level
331:
332: GEN = gforth$(EXE) gforth-ditc$(EXE) gforth-fast$(EXE) kernel/version.fs
333:
334: # things that need a working forth system to be generated
335: FORTH_GEN0 = prim.b engine/prim.i engine/prim_lab.i kernel/aliases.fs kernel/prim.fs
336: FORTH_GEN = $(FORTH_GEN0) @KERNEL@ gforth.fi
337: # this is used for antidependences,
338: FORTH_GEN1 = $(FORTH_GEN0) @kernel_fi@
339:
340: #distributed documentation
341: DOCDIST = doc/gforth.info doc/gforth.info-* doc/gforth.ps
342:
343: KERNLS = kernl16b.fi- kernl16l.fi- \
344: kernl32b.fi- kernl32l.fi- \
345: kernl64b.fi- kernl64l.fi-
346:
347: GEN_PRECIOUS = $(FORTH_GEN) $(KERNLS) doc/gforth.texi doc/gforth.dvi doc/gforth.ps Makefile Makedist engine/Makefile configure
348:
349: #standards.info recommends this:
350: .SUFFIXES:
351: .SUFFIXES: .c .o
352:
353:
354: all: kernel/version.fs more
355:
356: # use this dependency for phony targets just as mostlyclean,...
357: FORCE: ;
358:
359: #this rule avoids remaking everything after minor changes in Makefile.in
360: version: Makefile.in
361: if test -r $@ && test x'$(VERSION)' = x`cat $@` ; then true ; else echo $(VERSION) > $@ ; fi
362:
363: # With dos we use normal dos echo
364: # we cannot pipe the output to engine/version.h directly because
365: # of the "/ and \" problem. Copying works because we use the
366: # shell und file utilities.
367:
368: kernel/version.fs: version
369: $(MAKE) gforth$(EXE)
370: echo ": version-string s\" $(VERSION)\" ;" > kernel/version.fs
371:
372: more: engine $(FORTH_GEN) $(GEN)
373:
374: #from the gcc Makefile:
375: #"Deletion of files made during compilation.
376: # There are four levels of this:
377: # `mostlyclean', `clean', `distclean' and `realclean'.
378: # `mostlyclean' is useful while working on a particular type of machine.
379: # It deletes most, but not all, of the files made by compilation.
380: # It does not delete libgcc.a or its parts, so it won't have to be recompiled.
381: # `clean' deletes everything made by running `make all'.
382: # `distclean' also deletes the files made by config.
383: # `realclean' also deletes everything that could be regenerated automatically."
384:
385: mostlyclean: FORCE
386: -$(RM) -rf engine/*.s gforth.fi *.fi~ *.fi- kernel/version.fs \
387: *TAGS gforth~ \
388: doc/crossdoc.fd doc/doc.fd doc/gforth.texi doc/gforth.fns \
389: doc/gforth.aux doc/gforth.cp doc/gforth.cps \
390: doc/gforth.dvi doc/gforth.fn doc/gforth.ky doc/gforth.log \
391: doc/gforth.pg \
392: doc/gforth.toc doc/gforth.tp doc/gforth.vr html \
393: gforth-$(VERSION).tar.gz
394:
395: # Just the stuff needed to rebuild the documentation nac03feb1999
396: docclean: FORCE
397: -$(RM) -rf doc/crossdoc.fd doc/doc.fd doc/gforth.texi doc/gforth.fns \
398: doc/gforth.aux doc/gforth.cp doc/gforth.cps \
399: doc/gforth.dvi doc/gforth.fn doc/gforth.ky doc/gforth.log \
400: doc/gforth.pg \
401: doc/gforth.toc doc/gforth.tp doc/gforth.vr html
402:
403: clean: mostlyclean
404: -$(RM) -rf $(GEN) engine/gforth$(EXE) \
405: engine/gforth-fast$(EXE) engine/gforth-ditc$(EXE) \
406: *.o engine/*.o arch/*/*.o version
407:
408: distclean: clean
409: -$(RM) config.cache config.log config.status \
410: engine/config.h Makefile Makedist engine/Makefile \
411: stamp-h engine/stamp-h \
412: doc/version.texi gforthmi
413:
414: #realclean is useless, but dangerous, so it's commented out
415: realclean: distclean
416: -$(RM) $(GEN_PRECIOUS)
417:
418: #mostlyclean, but also remove some of the stuff that is distributed
419: virtualclean: mostlyclean
420: -$(RM) -rf gforth.fns gforth.texi gforth.ps gforth.info* \
421: gforth-$(VERSION).tar.gz config.cache *~ */*~
422:
423: #Some makes (Ultrix, SunOS, IRIX) are so broken, they cannot read the
424: #Makefile if it contains our dist rules. Therefore we have put these
425: #rules in Makedist (you can use them with GNU make on these systems).
426: dist: Makedist FORCE
427: $(MAKE) -f Makedist d$@
428:
429: dosdist: Makedist FORCE
430: $(MAKE) -f Makedist d$@
431:
432: srcdist: Makedist FORCE
433: $(MAKE) -f Makedist d$@
434:
435: srconlydist: Makedist FORCE
436: $(MAKE) -f Makedist d$@
437:
438: docdist: Makedist FORCE
439: $(MAKE) -f Makedist d$@
440:
441: htmldist: Makedist FORCE
442: $(MAKE) -f Makedist d$@
443:
444: bindist: Makedist FORCE
445: $(MAKE) -f Makedist d$@
446:
447: binonlydist: Makedist FORCE
448: $(MAKE) -f Makedist d$@
449:
450:
451: #strip gforth, because the debugging stuff is hardly useful once
452: # gforth manages to execute more than a few primitives
453:
454: #install does not depend on gforth.info, because that would require
455: #supplying a lot of files that can be easily generated (only info is
456: #hard to generate)
457: #gforth.fi and install.TAGS is rm'ed after installing because of ownership
458: install: gforth$(EXE) $(FORTH_SRC) $(kernel_fi) gforth.fi gforthmi doc/gforth.1 prim install.TAGS installdirs
459: touch $(siteforthdir)/siteinit.fs
460: -$(RM) $(bindir)/gforth$(EXE) $(bindir)/gforth-$(VERSION)$(EXE) $(bindir)/gforthmi
461: -$(RM) $(bindir)/gforth-fast$(EXE) $(bindir)/gforth-fast-$(VERSION)$(EXE)
462: $(INSTALL_PROGRAM) -s gforth$(EXE) $(bindir)/gforth-$(VERSION)$(EXE)
463: (cd $(bindir) && $(LN_S) gforth-$(VERSION)$(EXE) gforth$(EXE))
464: $(INSTALL_PROGRAM) -s gforth-fast$(EXE) $(bindir)/gforth-fast-$(VERSION)$(EXE)
465: (cd $(bindir) && $(LN_S) gforth-fast-$(VERSION)$(EXE) gforth-fast$(EXE))
466: $(INSTALL_PROGRAM) gforthmi $(bindir)/gforthmi-$(VERSION)
467: $(INSTALL_PROGRAM) gforth-ditc $(libdir)/gforth/$(VERSION)
468: (cd $(bindir) && $(LN_S) gforthmi-$(VERSION) gforthmi)
469: -$(INSTALL_DATA) $(srcdir)/doc/gforth.1 $(man1dir)
470: -for i in $(srcdir)/doc/gforth.info*; do $(INSTALL_DATA) $$i $(infodir); done
471: for i in $(FORTH_SRC) $(COMPAT) prim; do \
472: $(INSTALL_DATA) $(srcdir)/$$i $(datadir)/gforth/$(VERSION)/$$i; \
473: done
474: $(INSTALL_DATA) $(kernel_fi) $(datadir)/gforth/$(VERSION)
475: $(RM) gforth.fi
476: GFORTHD="./gforth-ditc -p$(libdir)/gforth/site-forth$(PATHSEP)$(siteforthdir)$(PATHSEP)$(datadir)/gforth/$(VERSION) -i $(kernel_fi)" GFORTH="./gforth-ditc --die-on-signal -i $(kernel_fi) $(STARTUP)" ./gforthmi gforth.fi $(FORTHSIZES) $(STARTUP) #gforth.fi contains some path names
477: $(INSTALL_DATA) gforth.fi $(libdir)/gforth/$(VERSION)
478: $(INSTALL_DATA) install.TAGS $(datadir)/gforth/$(VERSION)/TAGS
479: $(RM) gforth.fi install.TAGS
480: @if test -d "$(emacssitelispdir)"; then \
481: $(INSTALL_DATA) $(srcdir)/gforth.el $(emacssitelispdir); \
482: else \
483: echo ">>>>>Please install $(srcdir)/gforth.el in your .../emacs/site-lisp directory"; \
484: fi
485: @echo ">>>>> Please make an entry for Gforth in your info dir file; e.g.:"; \
486: echo "* Gforth: (gforth). A fast interpreter for the Forth language."
487:
488: install-strip: install
489:
490: installdirs: mkinstalldirs
491: for i in $(bindir) $(man1dir) $(infodir) $(libdir)/gforth/$(VERSION) $(datadir)/gforth/$(VERSION) $(libdir)/gforth/site-forth $(siteforthdir); do \
492: $(srcdir)/mkinstalldirs $$i; \
493: done
494: for i in $(CVSDIRS); do \
495: $(srcdir)/mkinstalldirs $(datadir)/gforth/$(VERSION)/`dirname $$i`; \
496: done
497: $(RM) -rf $(datadir)/gforth/$(VERSION)/engine
498:
499: #deinstall all files specific to this version of gforth
500: #to uninstall version foo, type `make uninstall VERSION=foo'
501: uninstall: FORCE
502: -$(RM) -rf $(libdir)/gforth/$(VERSION) $(datadir)/gforth/$(VERSION) $(bindir)/gforth-$(VERSION)$(EXE) $(bindir)/gforthmi-$(VERSION)
503: @echo -e "To remove Gforth completely, type\n$(RM) -rf $(bindir)/gforth$(EXE) $(bindir)/gforthmi $(man1dir)/gforth.1 $(infodir)/gforth.info* $(datadir)/gforth $(libdir)/gforth"
504:
505: check test: gforth$(EXE) gforth.fi
506: $(FORTH) test/tester.fs test/coretest.fs test/postpone.fs test/dbltest.fs -e bye | diff -c - $(srcdir)/test/coretest.out
507: $(FORTH) test/other.fs -e bye
508: $(FORTH) code.fs test/checkans.fs -e bye | diff -c - $(srcdir)/test/checkans.out
509: $(FORTHK) -m 100000 prims2x.fs -e \
510: "c-flag on s\" $(srcdir)/prim.b\" ' output-c process-file bye"| \
511: diff -c - $(srcdir)/engine/prim.i
512:
513: bench: gforth-fast$(EXE) gforth.fi
514: @echo 'Each benchmark takes about 30s on a 486-66 (gcc-2.6.3 -DFORCE_REG)'
515: time $(FORTH_FAST) siev.fs -e "main bye"
516: time $(FORTH_FAST) bubble.fs -e "main bye"
517: time $(FORTH_FAST) -m 160000 matrix.fs -e "main bye"
518: time $(FORTH_FAST) fib.fs -e "main bye"
519:
520: # ------------- Make forth images
521:
522: # How to make new images:
523: # 1. Produce an image called kernlXYZ.fi-
524: # the original kernel.fi is not touched because it's needed for creation
525: # 2. copy old kernlXYZ.fi to kernlXYZ.fi~
526: # that's a backup copy in case the new kernels don't work
527: # 3. copy new kernels to kernlXYZ.fi
528: # these are the ones we want to use now
529:
530: kernl16l.fi-: $(KERN_SRC) kernel/version.fs mach16l.fs $(FORTH_GEN0)
531: $(FORTHK) -e 's" mach16l.fs"' $(srcdir)/kernel/main.fs -e "save-cross kernl16l.fi- $(bindir)/gforth-$(VERSION) bye"
532:
533: kernl16b.fi-: $(KERN_SRC) kernel/version.fs mach16b.fs $(FORTH_GEN0)
534: $(FORTHK) -e 's" mach16b.fs"' $(srcdir)/kernel/main.fs -e "save-cross kernl16b.fi- $(bindir)/gforth-$(VERSION) bye"
535:
536: kernl32l.fi-: $(KERN_SRC) kernel/version.fs mach32l.fs $(FORTH_GEN0)
537: $(FORTHK) -e 's" mach32l.fs"' $(srcdir)/kernel/main.fs -e "save-cross kernl32l.fi- $(bindir)/gforth-$(VERSION) bye"
538:
539: kernl32b.fi-: $(KERN_SRC) kernel/version.fs mach32b.fs $(FORTH_GEN0)
540: $(FORTHK) -e 's" mach32b.fs"' $(srcdir)/kernel/main.fs -e "save-cross kernl32b.fi- $(bindir)/gforth-$(VERSION) bye"
541:
542: kernl64l.fi-: $(KERN_SRC) kernel/version.fs mach64l.fs $(FORTH_GEN0)
543: $(FORTHK) -e 's" mach64l.fs"' $(srcdir)/kernel/main.fs -e "save-cross kernl64l.fi- $(bindir)/gforth-$(VERSION) bye"
544:
545: kernl64b.fi-: $(KERN_SRC) kernel/version.fs mach64b.fs $(FORTH_GEN0)
546: $(FORTHK) -e 's" mach64b.fs"' $(srcdir)/kernel/main.fs -e "save-cross kernl64b.fi- $(bindir)/gforth-$(VERSION) bye"
547:
548: kernl-%.fi: arch/%/mach.fs $(KERN_SRC) kernel/version.fs $(FORTH_GEN0)
549: $(FORTHK) -e 's" $<"' $(srcdir)/kernel/main.fs -e "save-cross $@- $(bindir)/gforth-$(VERSION) bye"
550: if [ -f `echo $< | sed s/fs/sh/` ]; \
551: then sh `echo $< | sed s/fs/sh/` $@; \
552: else $(CP) $@- $@; \
553: fi
554:
555: #SunOS make does not like that
556: #arch/%/mach.fs: arch/%/prim.fs arch/%/asm.fs
557:
558: kernl16b.fi: $(KERNLS)
559: -$(CP) kernl16b.fi kernl16b.fi~
560: -$(CP) kernl16b.fi- kernl16b.fi
561:
562: kernl16l.fi: $(KERNLS)
563: -$(CP) kernl16l.fi kernl16l.fi~
564: -$(CP) kernl16l.fi- kernl16l.fi
565:
566: kernl32b.fi: $(KERNLS)
567: -$(CP) kernl32b.fi kernl32b.fi~
568: -$(CP) kernl32b.fi- kernl32b.fi
569:
570: kernl32l.fi: $(KERNLS)
571: -$(CP) kernl32l.fi kernl32l.fi~
572: -$(CP) kernl32l.fi- kernl32l.fi
573:
574: kernl64b.fi: $(KERNLS)
575: -$(CP) kernl64b.fi kernl64b.fi~
576: -$(CP) kernl64b.fi- kernl64b.fi
577:
578: kernl64l.fi: $(KERNLS)
579: -$(CP) kernl64l.fi kernl64l.fi~
580: -$(CP) kernl64l.fi- kernl64l.fi
581:
582: #kernl%.fi: kernl%.fi- $(KERNLS)
583: # -$(CP) $@ $@~
584: # -$(CP) $< $@
585:
586: gforth.fi: $(kernel_fi) gforthmi gforth$(EXE) gforth-ditc$(EXE) $(GFORTH_FI_SRC)
587: GFORTHD="./gforth-ditc -p .$(PATHSEP)$(srcdir)" GFORTH="./gforth-ditc --die-on-signal -p .$(PATHSEP)$(srcdir) -i $(kernel_fi) $(STARTUP)" ./gforthmi gforth.fi $(FORTHSIZES) $(FORTHKFLAGS) $(STARTUP)
588:
589: # ------------- Make c-engine
590:
591: prim.b: prim
592: m4 -s $(srcdir)/prim >$@
593:
594: engine/prim.i: prim.b prims2x.fs
595: $(FORTHK) prims2x.fs -e "c-flag on s\" prim.b\" ' output-c process-file bye" >$@-
596: $(CP) $@- $@
597: $(RM) $@-
598:
599: engine/prim_lab.i: prim.b prims2x.fs
600: $(FORTHK) prims2x.fs -e "c-flag on s\" prim.b\" ' output-label process-file bye" >$@-
601: $(CP) $@- $@
602: $(RM) $@-
603:
604: kernel/aliases.fs: prim.b prims2x.fs kernel/aliases0.fs
605: $(CP) kernel/aliases0.fs $@-
606: $(FORTHK) prims2x.fs -e "forth-flag on s\" prim.b\" ' output-alias process-file bye" >>$@-
607: $(CP) $@- $@
608: $(RM) $@-
609:
610: kernel/prim.fs: prim.b prims2x.fs kernel/prim0.fs
611: $(CP) kernel/prim0.fs kernel/prim.fs-
612: $(FORTHK) prims2x.fs -e "forth-flag on s\" prim.b\" ' output-forth process-file bye" >>$@-
613: $(CP) $@- $@
614: $(RM) $@-
615:
616: gforth$(EXE): engines
617: -$(CP) gforth$(EXE) gforth~
618: $(CP) engine/$@ $@
619: @GFORTH_EXE@
620:
621: gforth-fast$(EXE): engines
622: $(CP) engine/$@ $@
623: @GFORTHFAST_EXE@
624:
625: gforth-ditc$(EXE): engines
626: $(CP) engine/$@ $@
627: @GFORTHDITC_EXE@
628:
629: engines: FORCE engine/Makefile engine/prim.i engine/prim_lab.i
630: cd engine && $(MAKE) gforth$(EXE) gforth-fast$(EXE) gforth-ditc$(EXE)
631:
632: # ------------- additional C primitives
633:
634: %.c: %.pri prim2cl.fs
635: $(FORTHK) prim2cl.fs -e "file $< altogether bye" >$@
636:
637: %.so: %.c
638: $(GCC) -shared $(CFLAGS) $< -o $@
639:
640: # ------------- Make Documentation
641:
642: #TAGS is a GNU standard target
643: TAGS: gforth.TAGS
644: $(CP) gforth.TAGS $@
645:
646: install.TAGS: gforth.TAGS
647: sed 's:^\$(srcdir)/:$(datadir)/gforth/$(VERSION)/:' gforth.TAGS >install.TAGS
648:
649: gforth.TAGS: @kernel_fi@ gforth$(EXE) $(GFORTH_FI_SRC) prim.TAGS
650: $(FORTHK) etags.fs except.fs startup.fs -e bye
651: cat TAGS prim.TAGS kernel.TAGS >gforth.TAGS
652: rm TAGS
653:
654: prim.TAGS: prim.b prims2x.fs
655: $(FORTHK) prims2x.fs -e "s\" $(srcdir)/prim.b\" ' output-tag process-file bye" >$@-
656: $(CP) $@- $@
657: $(RM) $@-
658:
659: doc/doc.fd: doc/makedoc.fs $(GFORTH_FI_SRC) code.fs objects.fs oof.fs moofglos.fs
660: $(FORTHK) -e "s\" doc/doc.fd\"" doc/makedoc.fs except.fs startup.fs code.fs objects.fs oof.fs moofglos.fs -e bye
661:
662: doc/crossdoc.fd: $(KERN_SRC) kernel/version.fs $(FORTH_GEN0)
663: $(FORTHK) -e 's" mach32l.fs"' kernel/main.fs -e bye
664:
665: doc/gforth.texi: doc/gforth.ds prim.b ds2texi.fs prims2x.fs \
666: doc/doc.fd doc/crossdoc.fd
667: $(FORTHK) -m 100000 ds2texi.fs prims2x.fs -e "s\" $(srcdir)/prim.b\" ' register-doc process-file" doc/crossdoc.fd doc/doc.fd -e "s\" $(srcdir)/doc/gforth.ds\" r/o open-file throw ds2texi bye" >$@-
668: $(CP) $@- $@
669: $(RM) $@-
670:
671: checkdoc: doc/gforth.ds prim.b ds2texi.fs prims2x.fs doc/doc.fd doc/crossdoc.fd answords.fs doc/gforth.texi
672: $(FORTHK) -m 1M ds2texi.fs prims2x.fs -e "s\" $(srcdir)/prim.b\" ' register-doc process-file" doc/crossdoc.fd doc/doc.fd answords.fs -e bye
673: -grep unknown doc/gforth.texi
674:
675: dvi: doc/gforth.dvi
676:
677: doc/gforth.dvi doc/gforth.fns: $(GFORTH_TEXI)
678: cd doc; $(TEXI2DVI) gforth.texi
679:
680: doc/gforth.ps: doc/gforth.dvi
681: $(DVI2PS) doc/gforth.dvi -o $@
682:
683: info: doc/gforth.info
684:
685: doc/gforth.info doc/gforth.info-*: $(GFORTH_TEXI)
686: -cd doc; $(MAKEINFO) gforth.texi
687:
688: html: $(GFORTH_TEXI)
689: -$(RMTREE) html
690: -mkdir html
691: ### need makeinfo 4.0 to generate html. Otherwise, use texi2html..
692: cd html; $(MAKEINFO) --html -I ../doc ../doc/gforth.texi
693: ### cd html; $(TEXI2HTML) -menu -split_node ../doc/gforth.texi
694:
695: doc/gforth.txt: $(GFORTH_TEXI)
696: -cd doc; $(MAKEINFO) --no-headers --no-split gforth.texi >gforth.txt
697:
698: doc: info html doc/gforth.ps doc/gforth.txt TAGS
699:
700: # For an explanation of the following Makefile rules, see node
701: # `Automatic Remaking' in GNU Autoconf documentation.
702:
703: #Note: no target "$(srcdir)/configure", because that does not trigger
704: #unless $(srcdir)!="."
705: configure: configure.in aclocal.m4
706: cd $(srcdir) && autoconf
707:
708: aclocal.m4: acinclude.m4 configure.in
709: aclocal
710:
711: # autoheader might not change config.h.in, so touch a stamp file.
712: engine/config.h.in: stamp-h.in
713: stamp-h.in: configure.in acconfig.h
714: cd $(srcdir) && autoheader
715: echo timestamp > $(srcdir)/stamp-h.in
716:
717: engine/config.h: stamp-h
718: stamp-h: engine/config.h.in config.status
719: CONFIG_FILES=$@ CONFIG_HEADERS=engine/config.h ./config.status
720: echo timestamp > stamp-h
721:
722: Makefile Makedist engine/Makefile gforthmi: Makefile.in Makedist.in engine/Makefile.in gforthmi.in config.status
723: CONFIG_FILES="$@" CONFIG_HEADERS=engine/config.h ./config.status
724:
725: config.status: configure
726: ./config.status --recheck
727:
728:
729: #create files for DOS, because DOS cannot do it itself
730: makefile.dos: mkdosmf.sed Makefile.in engine/Makefile.in
731: sed -f mkdosmf.sed <Makefile.in >makefile.dos
732: sed -f mkdosmf.sed <engine/Makefile.in >engine/makefile.dos
733:
734: makefile.os2: mkos2mf.sed Makefile.in engine/Makefile.in
735: sed -f mkos2mf.sed <Makefile.in >makefile.os2
736: sed -f mkos2mf.sed <engine/Makefile.in >engine/makefile.os2
737: echo '%.o: %.c' >>makefile.os2
738: echo ' $$(GCC) $$(CFLAGS) -c $$<' >>makefile.os2
739: echo '%.o: %.c' >>engine/makefile.os2
740: echo ' $$(GCC) $$(CFLAGS) -c $$<' >>engine/makefile.os2
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>