| # (which will cause the Makefiles to be regenerated when you run `make'); |
# (which will cause the Makefiles to be regenerated when you run `make'); |
| # (2) otherwise, pass the desired values on the `make' command line. |
# (2) otherwise, pass the desired values on the `make' command line. |
| |
|
| #gforth version |
# Warning: |
| |
# For some stupid reason setting SHELL to bash does not work properly with |
| |
# DOS. If you want to use shell-specific things that must run with DOS make |
| |
# an external batch file and call it with bash (see versions.bsh). |
| |
|
| |
# ------------- gforth version |
| |
|
| VERSION_MAJOR=0 |
VERSION_MAJOR=0 |
| VERSION_MINOR=3 |
VERSION_MINOR=3 |
| VERSION_RELEASE=1 |
VERSION_RELEASE=1 |
| VERSION =$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_RELEASE) |
VERSION =$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_RELEASE) |
| DOSVERSION=$(VERSION_MAJOR)$(VERSION_MINOR)$(VERSION_RELEASE) |
DOSVERSION=$(VERSION_MAJOR)$(VERSION_MINOR)$(VERSION_RELEASE) |
| |
|
| |
# ------------- System specific variables |
| |
|
| |
machine=@mach_h@ |
| |
# this is the type of machine |
| |
# used to extend the include path with ./arch/$machine |
| |
# so we could include a machine specific |
| |
# machine.h file |
| |
|
| |
PATHSEP = @PATHSEP@ |
| |
|
| |
osclass = @OSCLASS@ |
| |
|
| |
# ------------- Utility programs |
| |
|
| SHELL = /bin/sh |
SHELL = /bin/sh |
| RM = rm |
RM = rm |
| RMTREE = rm -rf |
RMTREE = rm -rf |
| LN_S = @LN_S@ |
LN_S = @LN_S@ |
| GCC = @CC@ |
GCC = @CC@ |
| CC = $(GCC) |
CC = $(GCC) |
| PATHSEP = @PATHSEP@ |
|
| FORTHPATH = $(libdir)/gforth/site-forth$(PATHSEP)$(datadir)/gforth/site-forth$(PATHSEP)$(libdir)/gforth/$(VERSION)$(PATHSEP)$(datadir)/gforth/$(VERSION)$(PATHSEP). |
FORTHPATH = $(libdir)/gforth/site-forth$(PATHSEP)$(datadir)/gforth/site-forth$(PATHSEP)$(libdir)/gforth/$(VERSION)$(PATHSEP)$(datadir)/gforth/$(VERSION)$(PATHSEP). |
| FORTHSIZES = @FORTHSIZES@ |
FORTHSIZES = @FORTHSIZES@ |
| FORTH = ./gforth -p $(FORTHPATH)$(PATHSEP)$(srcdir) |
FORTH = ./gforth -p $(FORTHPATH)$(PATHSEP)$(srcdir) |
| #you can get texi2html from http://wwwcn.cern.ch/dci/texi2html/ |
#you can get texi2html from http://wwwcn.cern.ch/dci/texi2html/ |
| TEXI2HTML = texi2html |
TEXI2HTML = texi2html |
| MAKEINFO = makeinfo |
MAKEINFO = makeinfo |
| |
|
| |
# ------------- Compiler Flags |
| |
|
| XCFLAGS = @CFLAGS@ |
XCFLAGS = @CFLAGS@ |
| XDEFINES = @DEFS@ |
XDEFINES = @DEFS@ |
| SWITCHES = $(XCFLAGS) $(XDEFINES) #-DNDEBUG #turn off assertions |
SWITCHES = $(XCFLAGS) $(XDEFINES) #-DNDEBUG #turn off assertions |
| ENGINE_FLAGS = @ENGINE_FLAGS@ -fno-defer-pop -fcaller-saves |
ENGINE_FLAGS = @ENGINE_FLAGS@ -fno-defer-pop -fcaller-saves |
| DEBUGFLAG = @DEBUGFLAG@ |
DEBUGFLAG = @DEBUGFLAG@ |
| CFLAGS = $(DEBUGFLAG) -I$(srcdir)/engine -I$(srcdir) -O4 -Wall $(SWITCHES) -DDEFAULTPATH=\"$(FORTHPATH)\" |
CFLAGS = $(DEBUGFLAG) -I$(srcdir)/engine -I$(srcdir)/arch/$(machine) -O4 -Wall $(SWITCHES) -DDEFAULTPATH=\"$(FORTHPATH)\" |
| |
|
| #John Wavrik should use -Xlinker -N to get a writable text (executable) |
#John Wavrik should use -Xlinker -N to get a writable text (executable) |
| XLDFLAGS = @LDFLAGS@ |
XLDFLAGS = @LDFLAGS@ |
| LDFLAGS = $(DEBUGFLAG) $(XLDFLAGS) $(GCCLDFLAGS) |
LDFLAGS = $(DEBUGFLAG) $(XLDFLAGS) $(GCCLDFLAGS) |
| LDLIBS = @LIBS@ |
LDLIBS = @LIBS@ |
| |
|
| |
# ------------ Install Directorys |
| |
|
| VPATH = @srcdir@ |
VPATH = @srcdir@ |
| prefix = @prefix@ |
prefix = @prefix@ |
| exec_prefix = @exec_prefix@ |
exec_prefix = @exec_prefix@ |
| |
|
| ALLSUBDIRS = engine |
ALLSUBDIRS = engine |
| |
|
| ARCHS = arch/m68k/machine.h \ |
ARCHS = arch/generic/machine.h \ |
| |
arch/m68k/machine.h \ |
| arch/mips/machine.h \ |
arch/mips/machine.h \ |
| arch/386/machine.h \ |
arch/386/machine.h \ |
| arch/hppa/machine.h \ |
arch/hppa/machine.h \ |
| #stuff in a binonly distribution |
#stuff in a binonly distribution |
| BINONLYDIST = config.status Makefile gforth gforth-ditc \ |
BINONLYDIST = config.status Makefile gforth gforth-ditc \ |
| $(OBJECTS0) $(OBJECTS) $(OBJECTS_DITC)\ |
$(OBJECTS0) $(OBJECTS) $(OBJECTS_DITC)\ |
| machine/machine.h engine/config.h kernel.fi \ |
arch/$(machine)/machine.h engine/config.h kernel.fi \ |
| stamp-h engine/version.h kernel/version.fs version-stamp \ |
stamp-h engine/version.h kernel/version.fs version-stamp \ |
| INSTALL.BINDIST |
INSTALL.BINDIST |
| |
|
| .SUFFIXES: |
.SUFFIXES: |
| .SUFFIXES: .c .o |
.SUFFIXES: .c .o |
| |
|
| |
|
| all: kernel/version.fs more |
all: kernel/version.fs more |
| |
|
| |
# use this dependency for phony targets just as mostlyclean,... |
| |
FORCE: ; |
| |
|
| #this rule avoids remaking everything after minor changes in Makefile.in |
#this rule avoids remaking everything after minor changes in Makefile.in |
| version: Makefile.in |
version: Makefile.in |
| if test -r $@ && test x'$(VERSION)' = x`cat $@` ; then true ; else echo $(VERSION) > $@ ; fi |
if test -r $@ && test x'$(VERSION)' = x`cat $@` ; then true ; else echo $(VERSION) > $@ ; fi |
| |
|
| |
# With dos we use normal dos echo |
| |
# we cannot pipe the output to engine/version.h directly because |
| |
# of the "/ and \" problem. Copying works because we use the |
| |
# shell und file utilities. |
| |
|
| engine/version.h: version |
engine/version.h: version |
| echo "static char gforth_version[]=\"$(VERSION)\" ;" >$@ |
bash versions.bsh $(VERSION) |
| |
|
| kernel/version.fs: version |
kernel/version.fs: version |
| $(MAKE) gforth |
$(MAKE) gforth |
| echo ": version-string s\" $(VERSION)\" ;" >$@ |
bash versions.bsh $(VERSION) |
| |
|
| more: $(OBJECTS) $(FORTH_GEN) gforth |
more: engine $(FORTH_GEN) gforth |
| |
|
| #from the gcc Makefile: |
#from the gcc Makefile: |
| #"Deletion of files made during compilation. |
#"Deletion of files made during compilation. |
| # `distclean' also deletes the files made by config. |
# `distclean' also deletes the files made by config. |
| # `realclean' also deletes everything that could be regenerated automatically." |
# `realclean' also deletes everything that could be regenerated automatically." |
| |
|
| mostlyclean: |
mostlyclean: FORCE |
| -$(RM) -rf *.s gforth.fi *.fi~ *.fi- kernel/version.fs *TAGS \ |
-$(RM) -rf *.s gforth.fi *.fi~ *.fi- kernel/version.fs *TAGS \ |
| doc/crossdoc.fd doc/doc.fd doc/gforth.texi doc/gforth.fns \ |
doc/crossdoc.fd doc/doc.fd doc/gforth.texi doc/gforth.fns \ |
| doc/gforth.aux doc/gforth.cp doc/gforth.cps \ |
doc/gforth.aux doc/gforth.cp doc/gforth.cps \ |
| |
|
| #deinstall all files specific to this version of gforth |
#deinstall all files specific to this version of gforth |
| #to uninstall version foo, type `make uninstall VERSION=foo' |
#to uninstall version foo, type `make uninstall VERSION=foo' |
| uninstall: |
uninstall: FORCE |
| -$(RM) -rf $(libdir)/gforth/$(VERSION) $(datadir)/gforth/$(VERSION) $(bindir)/gforth-$(VERSION) |
-$(RM) -rf $(libdir)/gforth/$(VERSION) $(datadir)/gforth/$(VERSION) $(bindir)/gforth-$(VERSION) |
| @echo -e "Type\n$(RM) -rf $(bindir)/gforth $(man1dir)/gforth.1 $(infodir)/gforth.info* $(datadir)/gforth $(libdir)/gforth\nto remove Gforth completely" |
@echo -e "Type\n$(RM) -rf $(bindir)/gforth $(man1dir)/gforth.1 $(infodir)/gforth.info* $(datadir)/gforth $(libdir)/gforth\nto remove Gforth completely" |
| |
|
| time $(FORTH) -m 160000 matrix.fs -e "main bye" |
time $(FORTH) -m 160000 matrix.fs -e "main bye" |
| time $(FORTH) fib.fs -e "main bye" |
time $(FORTH) fib.fs -e "main bye" |
| |
|
| gforth: $(OBJECTS) $(OBJECTS0) |
# ------------- Make forth images |
| -$(CP) gforth gforth~ |
|
| $(GCC) $(LDFLAGS) $(OBJECTS) $(OBJECTS0) $(LDLIBS) -o $@ |
|
| @GFORTH_EXE@ |
|
| |
|
| gforth-ditc: $(OBJECTS_DITC) $(OBJECTS0) |
# Hot to make new images: |
| $(GCC) $(LDFLAGS) $(OBJECTS_DITC) $(OBJECTS0) $(LDLIBS) -o $@ |
# 1. Produce an image called kernlXYZ.fi- |
| @GFORTHDITC_EXE@ |
# the original kernel.fi is not touched because it's needed for creation |
| |
# 2. copy old kernlXYZ.fi to kernlXYZ.fi~ |
| |
# that's a backup copy in case the new kernels don't work |
| |
# 3. copy new kernels to kernlXYZ.fi |
| |
# these are the ones we want to use now |
| |
|
| kernl16l.fi-: $(KERN_SRC) kernel/version.fs mach16l.fs $(FORTH_GEN0) |
kernl16l.fi-: $(KERN_SRC) kernel/version.fs mach16l.fs $(FORTH_GEN0) |
| $(FORTHK) -e 's" mach16l.fs"' kernel/main.fs -e "save-cross kernl16l.fi- $(bindir)/gforth-$(VERSION) bye" |
$(FORTHK) -e 's" mach16l.fs"' kernel/main.fs -e "save-cross kernl16l.fi- $(bindir)/gforth-$(VERSION) bye" |
| # -$(CP) $@ $@~ |
# -$(CP) $@ $@~ |
| # -$(CP) $< $@ |
# -$(CP) $< $@ |
| |
|
| gforth.fi: @kernel_fi@ gforthmi gforth gforth-ditc $(GFORTH_FI_SRC) |
# If we want a new kernel.fi we should use "kernel.fi:" this makes |
| GFORTHD="./gforth-ditc -p .$(PATHSEP)$(srcdir)" GFORTH="./gforth-ditc -p .$(PATHSEP)$(srcdir) -i kernel.fi startup.fs" $(srcdir)/gforthmi gforth.fi $(FORTHSIZES) $(FORTHKFLAGS) startup.fs |
# a link or a copy from kernl....fi to kernel.fi |
| |
# works for dos-computers, too!! |
| #TAGS is a GNU standard target |
|
| TAGS: gforth.TAGS |
|
| $(CP) gforth.TAGS $@ |
|
| |
|
| gforth.TAGS: @kernel_fi@ gforth $(GFORTH_FI_SRC) prim.TAGS |
|
| $(FORTHK) etags.fs startup.fs -e bye |
|
| cat TAGS prim.TAGS kernel.TAGS >gforth.TAGS |
|
| rm TAGS |
|
| |
|
| engine/replace.a: |
|
| cd engine; $(MAKE) replace.a |
|
| |
|
| engine.s: engine/engine.c engine/prim.i engine/prim_lab.i machine/machine.h engine/threaded.h $(INCLUDES) engine/config.h |
|
| $(GCC) $(CFLAGS) $(ENGINE_FLAGS) -S $(srcdir)/engine/engine.c |
|
| |
|
| engine/engine.o: engine/engine.c engine/prim.i engine/prim_lab.i machine/machine.h engine/threaded.h $(INCLUDES) engine/config.h |
|
| $(GCC) $(CFLAGS) $(ENGINE_FLAGS) -c $(srcdir)/engine/engine.c -o $@ |
|
| |
|
| engine/engine-ditc.o: engine/engine.c engine/prim.i engine/prim_lab.i machine/machine.h engine/threaded.h $(INCLUDES) engine/config.h |
|
| $(GCC) $(CFLAGS) $(ENGINE_FLAGS) -DDOUBLY_INDIRECT -o $@ -c $(srcdir)/engine/engine.c |
|
| |
|
| engine/main.o: engine/main.c machine/machine.h engine/threaded.h $(INCLUDES) engine/config.h engine/version.h |
kernel.fi: @kernel_fi@ |
| $(GCC) $(CFLAGS) $(ENGINE_FLAGS) -o $@ -c $(srcdir)/engine/main.c |
@LINK_KERNL@ |
| |
|
| engine/main-ditc.o: engine/main.c machine/machine.h engine/threaded.h $(INCLUDES) engine/config.h engine/version.h |
gforth.fi: kernel.fi gforthmi gforth gforth-ditc $(GFORTH_FI_SRC) |
| $(GCC) $(CFLAGS) $(ENGINE_FLAGS) -DDOUBLY_INDIRECT -o $@ -c $(srcdir)/engine/main.c |
GFORTHD="./gforth-ditc -p .$(PATHSEP)$(srcdir)" GFORTH="./gforth-ditc -p .$(PATHSEP)$(srcdir) -i kernel.fi startup.fs" $(srcdir)/gforthmi gforth.fi $(FORTHSIZES) $(FORTHKFLAGS) startup.fs |
| |
|
| engine/strtoul.o: strtoul.c strtol.c |
# ------------- Make c-engine |
| |
|
| prim.b: prim |
prim.b: prim |
| m4 -s $(srcdir)/prim >$@ |
m4 -s $(srcdir)/prim >$@ |
| $(CP) $@- $@ |
$(CP) $@- $@ |
| $(RM) $@- |
$(RM) $@- |
| |
|
| |
engine: engine/prim_lab.i engine/prim.i engine/version.h FORCE |
| |
bash makein.bsh engine engine |
| |
|
| |
engine_ditc: engine/prim_lab.i engine/prim.i engine/version.h FORCE |
| |
bash makein.bsh engine engine_ditc |
| |
|
| |
gforth: engine |
| |
-$(CP) gforth gforth~ |
| |
$(GCC) $(LDFLAGS) $(OBJECTS) $(OBJECTS0) $(LDLIBS) -o $@ |
| |
@GFORTH_EXE@ |
| |
|
| |
gforth-ditc: engine_ditc |
| |
$(GCC) $(LDFLAGS) $(OBJECTS_DITC) $(OBJECTS0) $(LDLIBS) -o $@ |
| |
@GFORTHDITC_EXE@ |
| |
|
| |
# ------------- Make Documentation |
| |
|
| |
#TAGS is a GNU standard target |
| |
TAGS: gforth.TAGS |
| |
$(CP) gforth.TAGS $@ |
| |
|
| |
gforth.TAGS: @kernel_fi@ gforth $(GFORTH_FI_SRC) prim.TAGS |
| |
$(FORTHK) etags.fs startup.fs -e bye |
| |
cat TAGS prim.TAGS kernel.TAGS >gforth.TAGS |
| |
rm TAGS |
| |
|
| prim.TAGS: prim.b prims2x.fs |
prim.TAGS: prim.b prims2x.fs |
| $(FORTHK) prims2x.fs -e "s\" $(srcdir)/prim.b\" ' output-tag process-file bye" >$@- |
$(FORTHK) prims2x.fs -e "s\" $(srcdir)/prim.b\" ' output-tag process-file bye" >$@- |
| $(CP) $@- $@ |
$(CP) $@- $@ |
| |
|
| |
|
| #create files for DOS, because DOS cannot do it itself |
#create files for DOS, because DOS cannot do it itself |
| makefile.dos: mkdosmf.sed Makefile.in |
makefile.dos: mkdosmf.sed Makefile.in engine/Makefile.in |
| sed -f mkdosmf.sed <Makefile.in >makefile.dos |
sed -f mkdosmf.sed <Makefile.in >makefile.dos |
| sed -f mkdosmf.sed <engine/Makefile.in >engine/makefile.dos |
sed -f mkdosmf.sed <engine/Makefile.in >engine/makefile.dos |
| |
|
| makefile.os2: mkos2mf.sed Makefile.in |
makefile.os2: mkos2mf.sed Makefile.in engine/Makefile.in |
| sed -f mkos2mf.sed <Makefile.in >makefile.os2 |
sed -f mkos2mf.sed <Makefile.in >makefile.os2 |
| sed -f mkos2mf.sed <engine/Makefile.in >engine/makefile.os2 |
sed -f mkos2mf.sed <engine/Makefile.in >engine/makefile.os2 |
| echo '%.o: %.c' >>makefile.os2 |
echo '%.o: %.c' >>makefile.os2 |
| echo '%.o: %.c' >>engine/makefile.os2 |
echo '%.o: %.c' >>engine/makefile.os2 |
| echo ' $$(GCC) $$(CFLAGS) -c $$<' >>engine/makefile.os2 |
echo ' $$(GCC) $$(CFLAGS) -c $$<' >>engine/makefile.os2 |
| |
|
| |
# Garbage: |
| |
# to be deleted! |
| |
|
| # history is a little bit different now! JAW |
# history is a little bit different now! JAW |
| #history.dos: history.fs Makefile.in |
#history.dos: history.fs Makefile.in |
| # sed -e "s,~/\.gforth-history,/gforth.his,g" <history.fs >history.dos |
# sed -e "s,~/\.gforth-history,/gforth.his,g" <history.fs >history.dos |
| |
|
| startup.dos: startup.fs Makefile.in |
# startup.dos: startup.fs Makefile.in |
| sed -e "s/\\\\ include doskey/include doskey/g" \ |
# sed -e "s/\\\\ include doskey/include doskey/g" \ |
| -e "s/include vt100key/\\\\ include vt100key/g" <startup.fs >startup.dos |
# -e "s/include vt100key/\\\\ include vt100key/g" <startup.fs >startup.dos |