1: #Makefile for Gforth
2:
3: #Copyright (C) 1995,1996,1997,1998,2000 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., 59 Temple Place, Suite 330, Boston, MA 02111, 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)" -m 1000000 -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 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 unix/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 arch/sharc/CVS arch/ia64/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/input.fs \
158: kernel/license.fs \
159: kernel/nio.fs \
160: kernel/saccept.fs \
161: kernel/doers.fs \
162: kernel/getdoers.fs \
163: kernel/pass.fs
164:
165: EC_SRC = \
166: asm/README \
167: asm/bitmask.fs \
168: asm/numref.fs \
169: asm/basic.fs \
170: asm/generic.fs \
171: asm/target.fs \
172: ec/README \
173: ec/mirror.fs \
174: ec/shex.fs \
175: ec/builttag.fs \
176: ec/dotx.fs \
177: ec/nesting.fs
178:
179: GFORTH_FI_SRC = \
180: assert.fs \
181: backtrac.fs \
182: blocked.fb \
183: blocks.fs \
184: bufio.fs \
185: debug.fs \
186: debugs.fs \
187: ekey.fs \
188: savesys.fs \
189: environ.fs \
190: errors.fs \
191: exboot.fs \
192: except.fs \
193: extend.fs \
194: float.fs \
195: glocals.fs \
196: hash.fs \
197: history.fs \
198: intcomp.fs \
199: locals.fs \
200: look.fs \
201: search.fs \
202: see.fs \
203: see-ext.fs \
204: source.fs \
205: startup.fs \
206: struct.fs \
207: stuff.fs \
208: tasker.fs \
209: termsize.fs \
210: vt100.fs \
211: vt100key.fs \
212: wordinfo.fs \
213: arch/386/asm.fs arch/386/disasm.fs \
214: arch/alpha/asm.fs arch/alpha/disasm.fs \
215: arch/mips/asm.fs arch/mips/disasm.fs arch/mips/insts.fs
216:
217: FORTH_SRC = $(KERN_SRC) $(GFORTH_FI_SRC) $(EC_SRC) \
218: ans-report.fs ansi.fs answords.fs \
219: code.fs colorize.fs comp-i.fs \
220: doskey.fs ds2texi.fs \
221: envos.fs envos.dos envos.os2 etags.fs filedump.fs fi2c.fs \
222: glosgen.fs gray.fs httpd.fs proxy.fs \
223: make-app.fs doc/makedoc.fs \
224: more.fs other.fs prims2x.fs random.fs \
225: table.fs string.fs \
226: tt.fs sokoban.fs \
227: unbuffer.fs wordsets.fs \
228: test/tester.fs test/coretest.fs test/postpone.fs test/dbltest.fs \
229: test/string.fs test/other.fs test/checkans.fs \
230: bubble.fs siev.fs matrix.fs fib.fs \
231: oof.fs oofsampl.fs objects.fs objexamp.fs mini-oof.fs moof-exm.fs \
232: moofglos.fs fixpath.fs \
233: add.fs lib.fs sieve.fs unix/socket.fs
234:
235: COMPAT = compat/README \
236: compat/anslocal.fs \
237: compat/assert.fs \
238: compat/control.fs \
239: compat/defer.fs \
240: compat/exception.fs \
241: compat/loops.fs \
242: compat/required.fs \
243: compat/struct.fs \
244: compat/vocabulary.fs
245:
246: GFORTH_TEXI = doc/gforth.texi doc/version.texi
247:
248: ALLSUBDIRS = engine
249:
250: ARCHS = \
251: arch/generic/machine.h \
252: arch/m68k/machine.h \
253: arch/mips/machine.h \
254: arch/386/machine.h \
255: arch/hppa/machine.h \
256: arch/hppa/cache.c \
257: arch/sparc/machine.h \
258: arch/power/machine.h \
259: arch/power/_sync_cache_range.c \
260: arch/power/elf32ppc.x \
261: arch/alpha/machine.h \
262: arch/ia64/machine.h \
263: arch/4stack/README \
264: arch/4stack/asm.fs \
265: arch/4stack/mach.fs \
266: arch/4stack/prim.fs \
267: arch/4stack/mach.sh \
268: arch/4stack/relocate.fs \
269: arch/misc/README \
270: arch/misc/asm.fs \
271: arch/misc/mach.fs \
272: arch/misc/prim.fs \
273: arch/misc/sim.fs \
274: arch/misc/sokoban.fs \
275: arch/misc/tt.fs \
276: arch/6502/asm.fs \
277: arch/6502/prim.fs \
278: arch/6502/mach.fs \
279: arch/6502/zero.fs \
280: arch/6502/softuart.fs \
281: arch/6502/cold.fs \
282: arch/8086/asm.fs \
283: arch/8086/mach.fs \
284: arch/8086/mach.sh \
285: arch/8086/prim.fs \
286: arch/avr/asm.fs \
287: arch/c165/asm.fs \
288: arch/c165/mach.fs \
289: arch/c165/prim.fs \
290: arch/h8/asm.fs \
291: arch/shboom/asm.fs \
292: arch/shboom/compiler.fs \
293: arch/shboom/dis.fs \
294: arch/shboom/mach.fs \
295: arch/shboom/prim.fs \
296: arch/shboom/dis2.fs \
297: arch/shboom/sh.p \
298: arch/shboom/doers.fs \
299: arch/sharc/mach.fs \
300: arch/sharc/machine.h \
301: arch/sharc/compile.sharc \
302: arch/sharc/unistd.h \
303: arch/sharc/systypes.h \
304: arch/sharc/types.h \
305: arch/sharc/g21k-3.3.4-bp1.diff
306:
307: SOURCES = $(CVSDIRS) compat Makefile.in Makedist.in engine/Makefile.in gforthmi.in \
308: configure.in configure config.sub config.guess elisp-comp missing \
309: acconfig.h acinclude.m4 engine/config.h.in stamp-h.in \
310: iss.sh install-sh INSTALL INSTALL.BINDIST NEWS README ToDo BUGS model \
311: COPYING AUTHORS ChangeLog Benchres aclocal.m4 \
312: doc/gforth.ds doc/texinfo.tex doc/gforth.1 doc/version.texi.in \
313: gforth.el \
314: prim engine/engine.c engine/main.c engine/io.c engine/memcmpc.c \
315: engine/signals.c $(ARCHS) \
316: engine/getopt.c engine/getopt1.c engine/getopt.h engine/select.c \
317: engine/ecvt.c engine/memcmp.c engine/strtol.c engine/strtoul.c \
318: engine/ansidecl.h engine/memmove.c \
319: engine/pow10.c engine/atanh.c engine/cleanalign.c \
320: engine/strerror.c engine/strsignal.c engine/dblsub.c \
321: engine/fnmatch.h engine/fnmatch.c \
322: INSTALL.DOS makefile.dos engine/makefile.dos mkdosmf.sed config.bat \
323: dosconf.h gforthmi.bat mkinstalldirs siteinit.fs \
324: versions.bsh \
325: configure.cmd mkos2mf.sed os2conf.h makefile.os2 engine/makefile.os2 \
326: gforthmi.cmd glosgen.glo doc/glossaries.doc \
327: $(INCLUDES) $(FORTH_SRC) $(COMPAT) \
328: timings.sc \
329: test/coretest.out test/checkans.out
330:
331: RCS_FILES = ToDo model high-level
332:
333: GEN = gforth$(EXE) gforth-ditc$(EXE) gforth-fast$(EXE) gforth-prof$(EXE) kernel/version.fs
334:
335: # things that need a working forth system to be generated
336: FORTH_GEN0 = prim.b engine/prim.i engine/prim_lab.i engine/peephole.i engine/profile.i kernel/aliases.fs kernel/prim.fs
337: FORTH_GEN = $(FORTH_GEN0) @KERNEL@ gforth.fi
338: # this is used for antidependences,
339: FORTH_GEN1 = $(FORTH_GEN0) @kernel_fi@
340:
341: #distributed documentation
342: DOCDIST = doc/gforth.info doc/gforth.info-* doc/gforth.ps
343:
344: KERNLS = kernl16b.fi- kernl16l.fi- \
345: kernl32b.fi- kernl32l.fi- \
346: kernl64b.fi- kernl64l.fi-
347:
348: GEN_PRECIOUS = $(FORTH_GEN) $(KERNLS) doc/gforth.texi doc/gforth.dvi doc/gforth.ps Makefile Makedist engine/Makefile configure
349:
350: #standards.info recommends this:
351: .SUFFIXES:
352: .SUFFIXES: .c .o
353:
354:
355: all: kernel/version.fs more
356:
357: # use this dependency for phony targets just as mostlyclean,...
358: FORCE: ;
359:
360: #this rule avoids remaking everything after minor changes in Makefile.in
361: version: Makefile.in
362: if test -r $@ && test x'$(VERSION)' = x`cat $@` ; then true ; else echo $(VERSION) > $@ ; fi
363:
364: # With dos we use normal dos echo
365: # we cannot pipe the output to engine/version.h directly because
366: # of the "/ and \" problem. Copying works because we use the
367: # shell und file utilities.
368:
369: kernel/version.fs: version
370: $(MAKE) gforth$(EXE)
371: echo ": version-string s\" $(VERSION)\" ;" > kernel/version.fs
372:
373: more: engine $(FORTH_GEN) $(GEN)
374:
375: #from the gcc Makefile:
376: #"Deletion of files made during compilation.
377: # There are four levels of this:
378: # `mostlyclean', `clean', `distclean' and `realclean'.
379: # `mostlyclean' is useful while working on a particular type of machine.
380: # It deletes most, but not all, of the files made by compilation.
381: # It does not delete libgcc.a or its parts, so it won't have to be recompiled.
382: # `clean' deletes everything made by running `make all'.
383: # `distclean' also deletes the files made by config.
384: # `realclean' also deletes everything that could be regenerated automatically."
385:
386: mostlyclean: FORCE
387: -$(RM) -rf engine/*.s gforth.fi *.fi~ *.fi- kernel/version.fs \
388: *TAGS gforth~ \
389: doc/crossdoc.fd doc/doc.fd doc/gforth.texi doc/gforth.fns \
390: doc/gforth.aux doc/gforth.cp doc/gforth.cps \
391: doc/gforth.dvi doc/gforth.fn doc/gforth.ky doc/gforth.log \
392: doc/gforth.pg \
393: doc/gforth.toc doc/gforth.tp doc/gforth.vr html \
394: gforth-$(VERSION).tar.gz
395:
396: # Just the stuff needed to rebuild the documentation nac03feb1999
397: docclean: FORCE
398: -$(RM) -rf doc/crossdoc.fd doc/doc.fd doc/gforth.texi doc/gforth.fns \
399: doc/gforth.aux doc/gforth.cp doc/gforth.cps \
400: doc/gforth.dvi doc/gforth.fn doc/gforth.ky doc/gforth.log \
401: doc/gforth.pg \
402: doc/gforth.toc doc/gforth.tp doc/gforth.vr html
403:
404: clean: mostlyclean
405: -$(RM) -rf $(GEN) engine/gforth$(EXE) \
406: engine/gforth-fast$(EXE) engine/gforth-ditc$(EXE) engine/gforth-prof$(EXE) \
407: *.o engine/*.o arch/*/*.o version
408:
409: distclean: clean
410: -$(RM) config.cache config.log config.status \
411: engine/config.h Makefile Makedist engine/Makefile \
412: stamp-h engine/stamp-h \
413: doc/version.texi gforthmi
414:
415: #realclean is useless, but dangerous, so it's commented out
416: realclean: distclean
417: -$(RM) $(GEN_PRECIOUS)
418:
419: #mostlyclean, but also remove some of the stuff that is distributed
420: virtualclean: mostlyclean
421: -$(RM) -rf gforth.fns gforth.texi gforth.ps gforth.info* \
422: gforth-$(VERSION).tar.gz config.cache *~ */*~
423:
424: #Some makes (Ultrix, SunOS, IRIX) are so broken, they cannot read the
425: #Makefile if it contains our dist rules. Therefore we have put these
426: #rules in Makedist (you can use them with GNU make on these systems).
427: dist: Makedist FORCE
428: $(MAKE) -f Makedist d$@
429:
430: dosdist: Makedist FORCE
431: $(MAKE) -f Makedist d$@
432:
433: srcdist: Makedist FORCE
434: $(MAKE) -f Makedist d$@
435:
436: srconlydist: Makedist FORCE
437: $(MAKE) -f Makedist d$@
438:
439: docdist: Makedist FORCE
440: $(MAKE) -f Makedist d$@
441:
442: htmldist: Makedist FORCE
443: $(MAKE) -f Makedist d$@
444:
445: bindist: Makedist FORCE
446: $(MAKE) -f Makedist d$@
447:
448: binonlydist: Makedist FORCE
449: $(MAKE) -f Makedist d$@
450:
451:
452: #strip gforth, because the debugging stuff is hardly useful once
453: # gforth manages to execute more than a few primitives.
454:
455: #install does not depend on gforth.info, because that would require
456: #supplying a lot of files that can be easily generated (only info is
457: #hard to generate).
458: #we rebuild gforth.fi, because it contains some path names.
459: #we delete $build/gforth.fi and $build/install.TAGS after installation because of ownership.
460: install: gforth$(EXE) $(FORTH_SRC) $(kernel_fi) gforth.fi gforthmi doc/gforth.1 prim install.TAGS installdirs
461: touch $(siteforthdir)/siteinit.fs
462: -$(RM) $(bindir)/gforth$(EXE) $(bindir)/gforth-$(VERSION)$(EXE) $(bindir)/gforthmi
463: -$(RM) $(bindir)/gforth-fast$(EXE) $(bindir)/gforth-fast-$(VERSION)$(EXE)
464: $(INSTALL_PROGRAM) -s gforth$(EXE) $(bindir)/gforth-$(VERSION)$(EXE)
465: (cd $(bindir) && $(LN_S) gforth-$(VERSION)$(EXE) gforth$(EXE))
466: $(INSTALL_PROGRAM) -s gforth-fast$(EXE) $(bindir)/gforth-fast-$(VERSION)$(EXE)
467: (cd $(bindir) && $(LN_S) gforth-fast-$(VERSION)$(EXE) gforth-fast$(EXE))
468: $(INSTALL_PROGRAM) gforthmi $(bindir)/gforthmi-$(VERSION)
469: $(INSTALL_PROGRAM) gforth-ditc $(libdir)/gforth/$(VERSION)
470: (cd $(bindir) && $(LN_S) gforthmi-$(VERSION) gforthmi)
471: -$(INSTALL_DATA) $(srcdir)/doc/gforth.1 $(man1dir)
472: -for i in $(srcdir)/doc/gforth.info*; do $(INSTALL_DATA) $$i $(infodir); done
473: for i in $(FORTH_SRC) $(COMPAT) prim; do \
474: $(INSTALL_DATA) $(srcdir)/$$i $(datadir)/gforth/$(VERSION)/$$i; \
475: done
476: $(INSTALL_DATA) $(kernel_fi) $(datadir)/gforth/$(VERSION)
477: @if test -d "$(emacssitelispdir)"; then \
478: $(INSTALL_DATA) $(srcdir)/gforth.el $(emacssitelispdir); \
479: else \
480: echo ">>>>>Please install $(srcdir)/gforth.el in your .../emacs/site-lisp directory"; \
481: fi
482: -$(RM) gforth.fi
483: 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)
484: $(INSTALL_DATA) gforth.fi $(libdir)/gforth/$(VERSION)
485: $(INSTALL_DATA) install.TAGS $(datadir)/gforth/$(VERSION)/TAGS
486: $(RM) gforth.fi install.TAGS
487: @echo ">>>>> Please make an entry for Gforth in your info dir file; e.g.:"; \
488: echo "* Gforth: (gforth). A fast interpreter for the Forth language."
489:
490: install-strip: install
491:
492: installdirs: mkinstalldirs
493: for i in $(bindir) $(man1dir) $(infodir) $(libdir)/gforth/$(VERSION) $(datadir)/gforth/$(VERSION) $(libdir)/gforth/site-forth $(siteforthdir); do \
494: $(srcdir)/mkinstalldirs $$i; \
495: done
496: for i in $(CVSDIRS); do \
497: $(srcdir)/mkinstalldirs $(datadir)/gforth/$(VERSION)/`dirname $$i`; \
498: done
499: $(RM) -rf $(datadir)/gforth/$(VERSION)/engine
500:
501: #deinstall all files specific to this version of gforth
502: #to uninstall version foo, type `make uninstall VERSION=foo'
503: uninstall: FORCE
504: -$(RM) -rf $(libdir)/gforth/$(VERSION) $(datadir)/gforth/$(VERSION) $(bindir)/gforth-$(VERSION)$(EXE) $(bindir)/gforth-fast-$(VERSION)$(EXE) $(bindir)/gforthmi-$(VERSION)
505: @echo -e "To remove Gforth completely, type\n$(RM) -rf $(bindir)/gforth$(EXE) $(bindir)/gforth-fast$(EXE) $(bindir)/gforthmi $(man1dir)/gforth.1 $(infodir)/gforth.info* $(datadir)/gforth $(libdir)/gforth"
506:
507: check test: gforth$(EXE) gforth.fi
508: $(FORTH) test/tester.fs test/coretest.fs test/postpone.fs test/dbltest.fs test/string.fs -e bye | diff -c - $(srcdir)/test/coretest.out
509: $(FORTH) test/other.fs -e bye
510: $(FORTH) code.fs test/checkans.fs -e bye | diff -c - $(srcdir)/test/checkans.out
511: $(FORTH) -m 100000 prims2x.fs -e \
512: "c-flag on s\" $(srcdir)/prim.b\" ' output-c ' output-c-combined process-file bye"| \
513: diff -c - $(srcdir)/engine/prim.i
514:
515: bench: gforth-fast$(EXE) gforth.fi
516: @echo 'Each benchmark takes about 30s on a 486-66 (gcc-2.6.3 -DFORCE_REG)'
517: time $(FORTH_FAST) siev.fs -e "main bye"
518: time $(FORTH_FAST) bubble.fs -e "main bye"
519: time $(FORTH_FAST) -m 160000 matrix.fs -e "main bye"
520: time $(FORTH_FAST) fib.fs -e "main bye"
521:
522: # ------------- Make forth images
523:
524: # How to make new images:
525: # 1. Produce an image called kernlXYZ.fi-
526: # the original kernel.fi is not touched because it's needed for creation
527: # 2. copy old kernlXYZ.fi to kernlXYZ.fi~
528: # that's a backup copy in case the new kernels don't work
529: # 3. copy new kernels to kernlXYZ.fi
530: # these are the ones we want to use now
531:
532: kernl16l.fi-: $(KERN_SRC) kernel/version.fs mach16l.fs $(FORTH_GEN0)
533: $(FORTHK) -e 's" mach16l.fs"' $(srcdir)/kernel/main.fs -e "save-cross kernl16l.fi- $(bindir)/gforth-$(VERSION) bye"
534:
535: kernl16b.fi-: $(KERN_SRC) kernel/version.fs mach16b.fs $(FORTH_GEN0)
536: $(FORTHK) -e 's" mach16b.fs"' $(srcdir)/kernel/main.fs -e "save-cross kernl16b.fi- $(bindir)/gforth-$(VERSION) bye"
537:
538: kernl32l.fi-: $(KERN_SRC) kernel/version.fs mach32l.fs $(FORTH_GEN0)
539: $(FORTHK) -e 's" mach32l.fs"' $(srcdir)/kernel/main.fs -e "save-cross kernl32l.fi- $(bindir)/gforth-$(VERSION) bye"
540:
541: kernl32b.fi-: $(KERN_SRC) kernel/version.fs mach32b.fs $(FORTH_GEN0)
542: $(FORTHK) -e 's" mach32b.fs"' $(srcdir)/kernel/main.fs -e "save-cross kernl32b.fi- $(bindir)/gforth-$(VERSION) bye"
543:
544: kernl64l.fi-: $(KERN_SRC) kernel/version.fs mach64l.fs $(FORTH_GEN0)
545: $(FORTHK) -e 's" mach64l.fs"' $(srcdir)/kernel/main.fs -e "save-cross kernl64l.fi- $(bindir)/gforth-$(VERSION) bye"
546:
547: kernl64b.fi-: $(KERN_SRC) kernel/version.fs mach64b.fs $(FORTH_GEN0)
548: $(FORTHK) -e 's" mach64b.fs"' $(srcdir)/kernel/main.fs -e "save-cross kernl64b.fi- $(bindir)/gforth-$(VERSION) bye"
549:
550: kernl-%.fi: arch/%/mach.fs $(KERN_SRC) kernel/version.fs $(FORTH_GEN0)
551: $(FORTHK) -e 's" $<"' $(srcdir)/kernel/main.fs -e "save-cross $@- $(bindir)/gforth-$(VERSION) bye"
552: if [ -f `echo $< | sed s/fs/sh/` ]; \
553: then sh `echo $< | sed s/fs/sh/` $@; \
554: else $(CP) $@- $@; \
555: fi
556:
557: #SunOS make does not like that
558: #arch/%/mach.fs: arch/%/prim.fs arch/%/asm.fs
559:
560: kernl16b.fi: $(KERNLS)
561: -$(CP) kernl16b.fi kernl16b.fi~
562: -$(CP) kernl16b.fi- kernl16b.fi
563:
564: kernl16l.fi: $(KERNLS)
565: -$(CP) kernl16l.fi kernl16l.fi~
566: -$(CP) kernl16l.fi- kernl16l.fi
567:
568: kernl32b.fi: $(KERNLS)
569: -$(CP) kernl32b.fi kernl32b.fi~
570: -$(CP) kernl32b.fi- kernl32b.fi
571:
572: kernl32l.fi: $(KERNLS)
573: -$(CP) kernl32l.fi kernl32l.fi~
574: -$(CP) kernl32l.fi- kernl32l.fi
575:
576: kernl64b.fi: $(KERNLS)
577: -$(CP) kernl64b.fi kernl64b.fi~
578: -$(CP) kernl64b.fi- kernl64b.fi
579:
580: kernl64l.fi: $(KERNLS)
581: -$(CP) kernl64l.fi kernl64l.fi~
582: -$(CP) kernl64l.fi- kernl64l.fi
583:
584: #kernl%.fi: kernl%.fi- $(KERNLS)
585: # -$(CP) $@ $@~
586: # -$(CP) $< $@
587:
588: gforth.fi: $(kernel_fi) gforthmi gforth$(EXE) gforth-ditc$(EXE) $(GFORTH_FI_SRC)
589: 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)
590:
591: # ------------- Make c-engine
592:
593: prim.b: prim
594: m4 -s $(srcdir)/prim >$@
595:
596: engine/prim.i: prim.b prims2x.fs
597: $(FORTH) -m 1000000 prims2x.fs -e "c-flag on s\" prim.b\" ' output-c ' output-c-combined process-file bye" >$@-
598: $(CP) $@- $@
599: $(RM) $@-
600:
601: engine/prim_lab.i: prim.b prims2x.fs
602: $(FORTH) -m 1000000 prims2x.fs -e "c-flag on s\" prim.b\" ' output-label dup process-file bye" >$@-
603: $(CP) $@- $@
604: $(RM) $@-
605:
606: engine/peephole.i: prim.b prims2x.fs
607: $(FORTH) -m 1000000 prims2x.fs -e "c-flag on s\" prim.b\" ' noop ' output-peephole process-file bye" >$@-
608: $(CP) $@- $@
609: $(RM) $@-
610:
611: engine/profile.i: prim.b prims2x.fs
612: $(FORTH) -m 1000000 prims2x.fs -e "c-flag on s\" prim.b\" ' output-profile ' output-profile process-file bye" >$@-
613: $(CP) $@- $@
614: $(RM) $@-
615:
616: kernel/aliases.fs: prim.b prims2x.fs kernel/aliases0.fs
617: $(CP) kernel/aliases0.fs $@-
618: $(FORTH) -m 1000000 prims2x.fs -e "forth-flag on s\" prim.b\" ' output-alias dup process-file bye" >>$@-
619: $(CP) $@- $@
620: $(RM) $@-
621:
622: kernel/prim.fs: prim.b prims2x.fs kernel/prim0.fs
623: $(CP) kernel/prim0.fs kernel/prim.fs-
624: $(FORTH) -m 1000000 prims2x.fs -e "forth-flag on s\" prim.b\" ' output-forth ' output-forth-combined process-file bye" >>$@-
625: $(CP) $@- $@
626: $(RM) $@-
627:
628: gforth$(EXE): engines
629: -$(CP) gforth$(EXE) gforth~
630: $(CP) engine/$@ $@
631: @GFORTH_EXE@
632:
633: gforth-fast$(EXE): engines
634: $(CP) engine/$@ $@
635: @GFORTHFAST_EXE@
636:
637: gforth-ditc$(EXE): engines
638: $(CP) engine/$@ $@
639: @GFORTHDITC_EXE@
640:
641: gforth-prof$(EXE): engines
642: $(CP) engine/$@ $@
643:
644: engines: FORCE engine/Makefile engine/prim.i engine/prim_lab.i engine/peephole.i engine/profile.i
645: cd engine && $(MAKE) gforth$(EXE) gforth-fast$(EXE) gforth-ditc$(EXE) gforth-prof$(EXE)
646:
647: # ------------- additional C primitives
648:
649: %.c: %.pri prim2cl.fs
650: $(FORTHK) prim2cl.fs -e "file $< altogether bye" >$@
651:
652: %.so: %.c
653: $(GCC) -shared $(CFLAGS) $< -o $@
654:
655: # ------------- Make Documentation
656:
657: #TAGS is a GNU standard target
658: TAGS: gforth.TAGS
659: $(CP) gforth.TAGS $@
660:
661: install.TAGS: gforth.TAGS
662: sed 's:^\$(srcdir)/:$(datadir)/gforth/$(VERSION)/:' gforth.TAGS >install.TAGS
663:
664: gforth.TAGS: @kernel_fi@ gforth$(EXE) $(GFORTH_FI_SRC) prim.TAGS kernel.TAGS
665: $(FORTHK) etags.fs except.fs startup.fs -e bye
666: cat TAGS prim.TAGS kernel.TAGS >gforth.TAGS
667: rm TAGS
668:
669: prim.TAGS: prim.b prims2x.fs
670: #echo '2c\' >prim.TAGS.sed
671: #echo $(srcdir)/prim >>prim.TAGS.sed
672: #$(FORTH) -m 1000000 prims2x.fs -e "s\" $(srcdir)/prim.b\" ' output-tag dup process-file bye" | sed -f prim.TAGS.sed >$@-
673: $(FORTH) -m 1000000 prims2x.fs -e "s\" $(srcdir)/prim.b\" ' output-tag dup process-file bye" >$@-
674: $(CP) $@- $@
675: $(RM) $@-
676:
677: kernel.TAGS:
678: rm kernl16l.fi-; $(MAKE) @kernel_fi@
679:
680: doc/doc.fd: doc/makedoc.fs $(GFORTH_FI_SRC) code.fs objects.fs oof.fs moofglos.fs
681: $(FORTHK) -e "s\" doc/doc.fd\"" doc/makedoc.fs except.fs startup.fs code.fs objects.fs oof.fs moofglos.fs -e bye
682:
683: doc/crossdoc.fd: $(KERN_SRC) kernel/version.fs $(FORTH_GEN0)
684: $(FORTHK) -e 's" mach32l.fs"' kernel/main.fs -e bye
685:
686: doc/gforth.texi: doc/gforth.ds prim.b ds2texi.fs prims2x.fs \
687: doc/doc.fd doc/crossdoc.fd
688: $(FORTH) -m 100000 ds2texi.fs prims2x.fs -e "s\" $(srcdir)/prim.b\" ' register-doc ' noop process-file" doc/crossdoc.fd doc/doc.fd -e "s\" $(srcdir)/doc/gforth.ds\" r/o open-file throw ds2texi bye" >$@-
689: $(CP) $@- $@
690: $(RM) $@-
691:
692: checkdoc: doc/gforth.ds prim.b ds2texi.fs prims2x.fs doc/doc.fd doc/crossdoc.fd answords.fs doc/gforth.texi
693: $(FORTH) -m 1M ds2texi.fs prims2x.fs -e "s\" $(srcdir)/prim.b\" ' register-doc ' noop process-file" doc/crossdoc.fd doc/doc.fd answords.fs -e bye
694: -grep unknown doc/gforth.texi
695:
696: dvi: doc/gforth.dvi
697:
698: doc/gforth.dvi doc/gforth.fns: $(GFORTH_TEXI)
699: cd doc; $(TEXI2DVI) gforth.texi
700:
701: doc/gforth.ps: doc/gforth.dvi
702: $(DVI2PS) doc/gforth.dvi -o $@
703:
704: info: doc/gforth.info
705:
706: doc/gforth.info doc/gforth.info-*: $(GFORTH_TEXI)
707: -cd doc; $(MAKEINFO) gforth.texi
708:
709: ### need makeinfo 4.0 to generate html. Otherwise, use texi2html..
710: html: $(GFORTH_TEXI)
711: -$(RMTREE) html
712: -mkdir html
713: cd html; $(MAKEINFO) --html -I ../doc ../doc/gforth.texi
714: ### cd html; $(TEXI2HTML) -menu -split_node ../doc/gforth.texi
715:
716: doc/gforth.txt: $(GFORTH_TEXI)
717: -cd doc; $(MAKEINFO) --no-headers --no-split gforth.texi >gforth.txt
718:
719: doc: info html doc/gforth.ps doc/gforth.txt TAGS
720:
721: # For an explanation of the following Makefile rules, see node
722: # `Automatic Remaking' in GNU Autoconf documentation.
723:
724: #Note: no target "$(srcdir)/configure", because that does not trigger
725: #unless $(srcdir)!="."
726: configure: configure.in aclocal.m4
727: cd $(srcdir) && autoconf
728:
729: aclocal.m4: acinclude.m4 configure.in
730: aclocal
731:
732: # autoheader might not change config.h.in, so touch a stamp file.
733: engine/config.h.in: stamp-h.in
734: stamp-h.in: configure.in acconfig.h
735: cd $(srcdir) && autoheader
736: echo timestamp > $(srcdir)/stamp-h.in
737:
738: engine/config.h: stamp-h
739: stamp-h: engine/config.h.in config.status
740: CONFIG_FILES=$@ CONFIG_HEADERS=engine/config.h ./config.status
741: echo timestamp > stamp-h
742:
743: Makefile Makedist engine/Makefile gforthmi: Makefile.in Makedist.in engine/Makefile.in gforthmi.in config.status
744: CONFIG_FILES="$@" CONFIG_HEADERS=engine/config.h ./config.status
745:
746: config.status: configure
747: ./config.status --recheck
748:
749:
750: #create files for DOS, because DOS cannot do it itself
751: makefile.dos: mkdosmf.sed Makefile.in engine/Makefile.in
752: sed -f mkdosmf.sed <Makefile.in >makefile.dos
753: sed -f mkdosmf.sed <engine/Makefile.in >engine/makefile.dos
754:
755: makefile.os2: mkos2mf.sed Makefile.in engine/Makefile.in
756: sed -f mkos2mf.sed <Makefile.in >makefile.os2
757: sed -f mkos2mf.sed <engine/Makefile.in >engine/makefile.os2
758: echo '%.o: %.c' >>makefile.os2
759: echo ' $$(GCC) $$(CFLAGS) -c $$<' >>makefile.os2
760: echo '%.o: %.c' >>engine/makefile.os2
761: echo ' $$(GCC) $$(CFLAGS) -c $$<' >>engine/makefile.os2
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>