| 1 : |
pazsan
|
1.1
|
#Copyright 1992 by the ANSI figForth Development Group |
| 2 : |
anton
|
1.9
|
# To change the values of `make' variables: instead of editing Makefiles, |
| 3 : |
|
|
# (1) if the variable is set in `config.status', edit `config.status' |
| 4 : |
|
|
# (which will cause the Makefiles to be regenerated when you run `make'); |
| 5 : |
|
|
# (2) otherwise, pass the desired values on the `make' command line. |
| 6 : |
pazsan
|
1.1
|
|
| 7 : |
anton
|
1.9
|
#To do: |
| 8 : |
|
|
#use $(srcdir) to make compilation in a non-srcdir possible |
| 9 : |
|
|
|
| 10 : |
|
|
VERSION =0.1alpha#gforth version |
| 11 : |
|
|
SHELL = /bin/sh |
| 12 : |
pazsan
|
1.4
|
RM = rm |
| 13 : |
|
|
CP = cp |
| 14 : |
anton
|
1.9
|
INSTALL = @INSTALL@ |
| 15 : |
|
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
| 16 : |
|
|
INSTALL_DATA = @INSTALL_DATA@ |
| 17 : |
|
|
LN_S = @LN_S@ |
| 18 : |
pazsan
|
1.1
|
GCC = gcc |
| 19 : |
anton
|
1.9
|
FORTH = ./gforth |
| 20 : |
pazsan
|
1.1
|
CC = gcc |
| 21 : |
anton
|
1.9
|
TEXI2DVI = tex |
| 22 : |
|
|
DVI2PS = dvips |
| 23 : |
anton
|
1.15
|
#you can get texi2html from http://asis01.cern.ch/infohtml/texi2html.html |
| 24 : |
|
|
TEXI2HTML = texi2html |
| 25 : |
anton
|
1.11
|
MAKEINFO = makeinfo |
| 26 : |
anton
|
1.9
|
XCFLAGS = @CFLAGS@ |
| 27 : |
|
|
XDEFINES = @DEFS@ |
| 28 : |
anton
|
1.12
|
SWITCHES = $(XCFLAGS) $(XDEFINES) #-DNDEBUG #turn off assertions |
| 29 : |
pazsan
|
1.17
|
ENGINE_FLAGS = -fno-defer-pop -fcaller-saves |
| 30 : |
|
|
CFLAGS = @DEBUGFLAG@ -O4 -Wall $(SWITCHES) |
| 31 : |
pazsan
|
1.1
|
|
| 32 : |
|
|
#John Wavrik should use -Xlinker -N to get a writable text (executable) |
| 33 : |
pazsan
|
1.17
|
LDFLAGS = @DEBUGFLAG@ @LDFLAGS@ @GCCLDFLAGS@ |
| 34 : |
anton
|
1.9
|
LDLIBS = @LIBS@ |
| 35 : |
|
|
|
| 36 : |
|
|
prefix = @prefix@ |
| 37 : |
|
|
exec_prefix = @exec_prefix@ |
| 38 : |
|
|
srcdir = @srcdir@ |
| 39 : |
|
|
bindir = $(exec_prefix)/bin |
| 40 : |
|
|
#read-only architecture-independent files |
| 41 : |
|
|
datadir = $(prefix)/share |
| 42 : |
|
|
#read-only architecture-dependent non-ascii files |
| 43 : |
|
|
libdir = $(prefix)/lib |
| 44 : |
|
|
infodir = $(prefix)/info |
| 45 : |
|
|
mandir = $(prefix)/man/man1 |
| 46 : |
pazsan
|
1.1
|
|
| 47 : |
|
|
|
| 48 : |
|
|
INCLUDES = forth.h io.h |
| 49 : |
|
|
|
| 50 : |
anton
|
1.21
|
FORTH_SRC = anslocal.fs add.fs assert.fs ansi.fs blocks.fs bufio.fs checkans.fs \ |
| 51 : |
pazsan
|
1.6
|
colorize.fs cross.fs debug.fs debugging.fs doskey.fs ds2texi.fs \ |
| 52 : |
|
|
dumpimage.fs environ.fs errore.fs etags.fs extend.fs filedump.fs \ |
| 53 : |
|
|
float.fs glocals.fs glosgen.fs gray.fs hash.fs history.fs \ |
| 54 : |
anton
|
1.21
|
kernal.fs locals-test.fs look.fs main.fs makedoc.fs \ |
| 55 : |
pazsan
|
1.13
|
mach16b.fs mach16l.fs mach32b.fs mach32l.fs mach64b.fs mach64l.fs \ |
| 56 : |
pazsan
|
1.6
|
other.fs prims2x.fs random.fs search-order.fs see.fs sieve.fs \ |
| 57 : |
|
|
startup.fs struct.fs tools.fs toolsext.fs tt.fs vars.fs vt100.fs \ |
| 58 : |
anton
|
1.21
|
vt100key.fs wordinfo.fs wordsets.fs \ |
| 59 : |
|
|
tester.fs coretest.fs |
| 60 : |
pazsan
|
1.1
|
|
| 61 : |
pazsan
|
1.17
|
SOURCES = Makefile.in configure.in configure config.sub config.guess \ |
| 62 : |
anton
|
1.19
|
install-sh INSTALL README ToDo BUGS model COPYING \ |
| 63 : |
|
|
gforth.ds texinfo.tex gforth.1 \ |
| 64 : |
pazsan
|
1.6
|
primitives engine.c main.c io.c \ |
| 65 : |
pazsan
|
1.17
|
m68k.h mips.h 386.h hppa.h cache.c sparc.h power.h alpha.h 32bit.h \ |
| 66 : |
anton
|
1.14
|
getopt.c getopt1.c getopt.h select.c \ |
| 67 : |
anton
|
1.18
|
ecvt.c memcmp.c strtol.c strtoul.c ansidecl.h memmove.c \ |
| 68 : |
pazsan
|
1.17
|
makefile.dos configure.bat startup.dos \ |
| 69 : |
pazsan
|
1.6
|
glosgen.glo glossaries.doc \ |
| 70 : |
pazsan
|
1.1
|
$(INCLUDES) $(FORTH_SRC) |
| 71 : |
|
|
|
| 72 : |
anton
|
1.5
|
RCS_FILES = ToDo model high-level |
| 73 : |
pazsan
|
1.1
|
|
| 74 : |
|
|
GEN = gforth |
| 75 : |
|
|
|
| 76 : |
anton
|
1.9
|
OBJECTS = engine.o io.o main.o @LIBOBJS@ @getopt_long@ |
| 77 : |
pazsan
|
1.1
|
|
| 78 : |
|
|
# things that need a working forth system to be generated |
| 79 : |
anton
|
1.15
|
FORTH_GEN0 = primitives.b primitives.i prim_labels.i aliases.fs |
| 80 : |
|
|
FORTH_GEN = $(FORTH_GEN0) @KERNAL@ |
| 81 : |
pazsan
|
1.1
|
# this is used for antidependences, |
| 82 : |
anton
|
1.15
|
FORTH_GEN1 = $(FORTH_GEN0) @gforth_fi@ |
| 83 : |
anton
|
1.5
|
|
| 84 : |
|
|
|
| 85 : |
anton
|
1.9
|
GEN_PRECIOUS = $(FORTH_GEN) gforth.texi gforth.dvi gforth.ps Makefile configure |
| 86 : |
pazsan
|
1.1
|
|
| 87 : |
anton
|
1.9
|
#standards.info recommends this: |
| 88 : |
|
|
.SUFFIXES: |
| 89 : |
|
|
.SUFFIXES: .c .o |
| 90 : |
|
|
|
| 91 : |
pazsan
|
1.2
|
all: |
| 92 : |
pazsan
|
1.7
|
if [ ! -f gforth ]; then $(MAKE) first; fi |
| 93 : |
pazsan
|
1.2
|
$(MAKE) more |
| 94 : |
pazsan
|
1.1
|
|
| 95 : |
pazsan
|
1.2
|
first: gforth |
| 96 : |
|
|
|
| 97 : |
pazsan
|
1.3
|
more: $(FORTH_GEN) gforth |
| 98 : |
pazsan
|
1.2
|
|
| 99 : |
pazsan
|
1.1
|
#from the gcc Makefile: |
| 100 : |
|
|
#"Deletion of files made during compilation. |
| 101 : |
|
|
# There are four levels of this: |
| 102 : |
|
|
# `mostlyclean', `clean', `distclean' and `realclean'. |
| 103 : |
|
|
# `mostlyclean' is useful while working on a particular type of machine. |
| 104 : |
|
|
# It deletes most, but not all, of the files made by compilation. |
| 105 : |
|
|
# It does not delete libgcc.a or its parts, so it won't have to be recompiled. |
| 106 : |
|
|
# `clean' deletes everything made by running `make all'. |
| 107 : |
|
|
# `distclean' also deletes the files made by config. |
| 108 : |
|
|
# `realclean' also deletes everything that could be regenerated automatically." |
| 109 : |
|
|
|
| 110 : |
|
|
clean: |
| 111 : |
pazsan
|
1.4
|
-$(RM) $(GEN) *.o *.s |
| 112 : |
pazsan
|
1.1
|
|
| 113 : |
|
|
distclean: clean |
| 114 : |
anton
|
1.9
|
-$(RM) machine.h gforth.fi config.cache config.log |
| 115 : |
pazsan
|
1.1
|
|
| 116 : |
|
|
realclean: distclean |
| 117 : |
pazsan
|
1.4
|
-$(RM) $(GEN_PRECIOUS) |
| 118 : |
pazsan
|
1.1
|
|
| 119 : |
anton
|
1.9
|
dist: $(SOURCES) $(FORTH_GEN) |
| 120 : |
anton
|
1.21
|
-rm -rf gforth-$(VERSION) |
| 121 : |
|
|
mkdir gforth-$(VERSION) |
| 122 : |
|
|
cp $(SOURCES) $(FORTH_GEN) gforth-$(VERSION) |
| 123 : |
|
|
tar cvf - gforth-$(VERSION)|gzip -9 >gforth-$(VERSION).tar.gz |
| 124 : |
pazsan
|
1.1
|
|
| 125 : |
anton
|
1.15
|
#strip gforth, because the debugging stuff is hardly useful once |
| 126 : |
|
|
# gforth manages to execute more than a few primitives |
| 127 : |
|
|
|
| 128 : |
anton
|
1.9
|
install: gforth $(FORTH_SRC) gforth.fi gforth.1 gforth.info |
| 129 : |
|
|
$(INSTALL) -d $(bindir) $(mandir) $(infodir) $(libdir)/gforth $(datadir)/gforth |
| 130 : |
anton
|
1.15
|
$(INSTALL_PROGRAM) -s gforth $(bindir) |
| 131 : |
anton
|
1.9
|
$(INSTALL_DATA) gforth.1 $(mandir) |
| 132 : |
anton
|
1.11
|
$(INSTALL_DATA) gforth.info* $(infodir) |
| 133 : |
anton
|
1.9
|
$(INSTALL_DATA) gforth.fi $(libdir)/gforth |
| 134 : |
|
|
for i in $(FORTH_SRC); do \ |
| 135 : |
anton
|
1.21
|
$(INSTALL_DATA) $$i $(libdir)/gforth; \ |
| 136 : |
anton
|
1.9
|
done |
| 137 : |
|
|
|
| 138 : |
anton
|
1.21
|
test: gforth |
| 139 : |
|
|
@echo 'Expect to see INCORRECT RESULT: { GS1 -> <TRUE> <TRUE> }' |
| 140 : |
|
|
@echo 'This is a bug of the testing program' |
| 141 : |
|
|
$(FORTH) tester.fs coretest.fs -e bye |
| 142 : |
|
|
$(FORTH) startup.fs blocks.fs checkans.fs -e bye |
| 143 : |
|
|
@echo 'Expect no differences' |
| 144 : |
|
|
$(FORTH) prims2x.fs -e "s\" primitives.b\" ' output-c process-file bye"| diff -c - primitives.i |
| 145 : |
|
|
|
| 146 : |
anton
|
1.9
|
dvi: gforth.dvi |
| 147 : |
anton
|
1.5
|
|
| 148 : |
anton
|
1.21
|
gforth: $(OBJECTS) |
| 149 : |
pazsan
|
1.4
|
-$(CP) gforth gforth~ |
| 150 : |
pazsan
|
1.1
|
$(GCC) $(LDFLAGS) $(OBJECTS) $(LDLIBS) -o $@ |
| 151 : |
anton
|
1.9
|
@MAKE_EXE@ |
| 152 : |
pazsan
|
1.1
|
|
| 153 : |
pazsan
|
1.13
|
kernl16l.fi: main.fs search-order.fs cross.fs aliases.fs vars.fs add.fs \ |
| 154 : |
|
|
errore.fs kernal.fs extend.fs tools.fs toolsext.fs \ |
| 155 : |
anton
|
1.15
|
mach16l.fs $(FORTH_GEN1) |
| 156 : |
pazsan
|
1.13
|
-$(CP) kernl16l.fi kernl16l.fi~ |
| 157 : |
|
|
$(FORTH) -e 's" mach16l.fs"' main.fs |
| 158 : |
|
|
@LINK_KERNL16L@ |
| 159 : |
|
|
|
| 160 : |
|
|
kernl16b.fi: main.fs search-order.fs cross.fs aliases.fs vars.fs add.fs \ |
| 161 : |
|
|
errore.fs kernal.fs extend.fs tools.fs toolsext.fs \ |
| 162 : |
anton
|
1.15
|
mach16b.fs $(FORTH_GEN1) |
| 163 : |
pazsan
|
1.13
|
-$(CP) kernl16b.fi kernl16b.fi~ |
| 164 : |
|
|
$(FORTH) -e 's" mach16b.fs"' main.fs |
| 165 : |
|
|
@LINK_KERNL16B@ |
| 166 : |
|
|
|
| 167 : |
pazsan
|
1.1
|
kernl32l.fi: main.fs search-order.fs cross.fs aliases.fs vars.fs add.fs \ |
| 168 : |
|
|
errore.fs kernal.fs extend.fs tools.fs toolsext.fs \ |
| 169 : |
anton
|
1.15
|
mach32l.fs $(FORTH_GEN1) |
| 170 : |
pazsan
|
1.4
|
-$(CP) kernl32l.fi kernl32l.fi~ |
| 171 : |
pazsan
|
1.1
|
$(FORTH) -e 's" mach32l.fs"' main.fs |
| 172 : |
anton
|
1.9
|
@LINK_KERNL32L@ |
| 173 : |
pazsan
|
1.1
|
|
| 174 : |
|
|
kernl32b.fi: main.fs search-order.fs cross.fs aliases.fs vars.fs add.fs \ |
| 175 : |
|
|
errore.fs kernal.fs extend.fs tools.fs toolsext.fs \ |
| 176 : |
anton
|
1.15
|
mach32b.fs $(FORTH_GEN1) |
| 177 : |
pazsan
|
1.4
|
-$(CP) kernl32b.fi kernl32b.fi~ |
| 178 : |
pazsan
|
1.1
|
$(FORTH) -e 's" mach32b.fs"' main.fs |
| 179 : |
anton
|
1.9
|
@LINK_KERNL32B@ |
| 180 : |
pazsan
|
1.13
|
|
| 181 : |
|
|
kernl64l.fi: main.fs search-order.fs cross.fs aliases.fs vars.fs add.fs \ |
| 182 : |
|
|
errore.fs kernal.fs extend.fs tools.fs toolsext.fs \ |
| 183 : |
anton
|
1.15
|
mach64l.fs $(FORTH_GEN1) |
| 184 : |
pazsan
|
1.13
|
-$(CP) kernl64l.fi kernl64l.fi~ |
| 185 : |
|
|
$(FORTH) -e 's" mach64l.fs"' main.fs |
| 186 : |
|
|
@LINK_KERNL64L@ |
| 187 : |
|
|
|
| 188 : |
|
|
kernl64b.fi: main.fs search-order.fs cross.fs aliases.fs vars.fs add.fs \ |
| 189 : |
|
|
errore.fs kernal.fs extend.fs tools.fs toolsext.fs \ |
| 190 : |
anton
|
1.15
|
mach64b.fs $(FORTH_GEN1) |
| 191 : |
pazsan
|
1.13
|
-$(CP) kernl64b.fi kernl64b.fi~ |
| 192 : |
|
|
$(FORTH) -e 's" mach64b.fs"' main.fs |
| 193 : |
|
|
@LINK_KERNL64B@ |
| 194 : |
pazsan
|
1.1
|
|
| 195 : |
|
|
engine.s: engine.c primitives.i prim_labels.i machine.h $(INCLUDES) |
| 196 : |
anton
|
1.9
|
$(GCC) $(CFLAGS) $(ENGINE_FLAGS) -S engine.c |
| 197 : |
pazsan
|
1.1
|
|
| 198 : |
|
|
engine.o: engine.c primitives.i prim_labels.i machine.h $(INCLUDES) |
| 199 : |
anton
|
1.9
|
$(GCC) $(CFLAGS) $(ENGINE_FLAGS) -c engine.c |
| 200 : |
|
|
|
| 201 : |
|
|
strtoul.o: strtoul.c strtol.c |
| 202 : |
pazsan
|
1.1
|
|
| 203 : |
|
|
primitives.b: primitives |
| 204 : |
|
|
m4 primitives >$@ |
| 205 : |
|
|
|
| 206 : |
|
|
primitives.i : primitives.b prims2x.fs |
| 207 : |
|
|
$(FORTH) prims2x.fs -e "s\" primitives.b\" ' output-c process-file bye" >$@ |
| 208 : |
|
|
|
| 209 : |
|
|
prim_labels.i : primitives.b prims2x.fs |
| 210 : |
|
|
$(FORTH) prims2x.fs -e "s\" primitives.b\" ' output-label process-file bye" >$@ |
| 211 : |
|
|
|
| 212 : |
|
|
aliases.fs: primitives.b prims2x.fs |
| 213 : |
|
|
$(FORTH) prims2x.fs -e "s\" primitives.b\" ' output-alias process-file bye" >$@ |
| 214 : |
|
|
|
| 215 : |
|
|
primitives.fs: primitives.b prims2x.fs |
| 216 : |
|
|
$(FORTH) prims2x.fs -e "s\" primitives.b\" ' output-forth process-file bye" >$@ |
| 217 : |
|
|
|
| 218 : |
anton
|
1.20
|
doc.fs: makedoc.fs float.fs search-order.fs glocals.fs environ.fs \ |
| 219 : |
|
|
toolsext.fs wordinfo.fs \ |
| 220 : |
|
|
vt100.fs colorize.fs see.fs bufio.fs debug.fs history.fs \ |
| 221 : |
|
|
doskey.fs vt100key.fs startup.fs assert.fs debugging.fs |
| 222 : |
|
|
$(FORTH) -e "s\" doc.fs\"" makedoc.fs startup.fs -e bye |
| 223 : |
|
|
|
| 224 : |
|
|
gforth.texi: gforth.ds primitives.b ds2texi.fs prims2x.fs doc.fs |
| 225 : |
pazsan
|
1.4
|
$(FORTH) ds2texi.fs >$@ |
| 226 : |
pazsan
|
1.1
|
|
| 227 : |
|
|
gforth.dvi: gforth.texi |
| 228 : |
anton
|
1.9
|
$(TEXI2DVI) gforth.texi |
| 229 : |
anton
|
1.5
|
|
| 230 : |
|
|
gforth.ps: gforth.dvi |
| 231 : |
anton
|
1.9
|
$(DVI2PS) gforth.dvi -o $@ |
| 232 : |
anton
|
1.11
|
|
| 233 : |
|
|
gforth.info: gforth.texi |
| 234 : |
|
|
-$(MAKEINFO) gforth.texi |
| 235 : |
anton
|
1.15
|
|
| 236 : |
|
|
html: gforth.texi |
| 237 : |
|
|
-$(RM) html/* |
| 238 : |
|
|
-mkdir html |
| 239 : |
|
|
cd html; $(TEXI2HTML) -menu -split_node ../gforth.texi |
| 240 : |
pazsan
|
1.1
|
|
| 241 : |
anton
|
1.9
|
# For an explanation of the following Makefile rules, see node |
| 242 : |
|
|
# `Automatic Remaking' in GNU Autoconf documentation. |
| 243 : |
|
|
Makefile: Makefile.in config.status |
| 244 : |
|
|
CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status |
| 245 : |
|
|
config.status: configure |
| 246 : |
|
|
./config.status --recheck |
| 247 : |
|
|
configure: configure.in |
| 248 : |
|
|
cd $(srcdir) && autoconf |
| 249 : |
|
|
|
| 250 : |
|
|
#unnecessary and does not work with all makes |
| 251 : |
|
|
#%.s : %.c $(INCLUDES) |
| 252 : |
|
|
# $(CC) $(CFLAGS) -S $< -o $@ |
| 253 : |
pazsan
|
1.1
|
|
| 254 : |
anton
|
1.9
|
#%.o : %.s |
| 255 : |
|
|
# $(CC) $(CFLAGS) -c $< -o $@ |
| 256 : |
pazsan
|
1.1
|
|