File:  [gforth] / gforth / Makefile.in
Revision 1.8: download - view: text, annotated - select for diffs
Wed Nov 30 17:46:03 1994 UTC (24 years, 11 months ago) by anton
Branches: MAIN
CVS tags: HEAD
Added FORCE_REG stuff to decstation.h
added man page

#Copyright 1992 by the ANSI figForth Development Group

VERSION	=#gforth version
RM	= rm
CP	= cp
GCC	= gcc
FORTH	= gforth
CC	= gcc
#MAKE	= gmake
XCFLAGS	=
XDEFINES	=
SWITCHES	= $(XCFLAGS) $(XDEFINES) -DDEFAULTBIN='"'`pwd`'"' #-DNDEBUG #turn off assertions
CFLAGS	= -O4 -Wall $(SWITCHES)

#-Xlinker -n puts text and data into the same 256M region
#John Wavrik should use -Xlinker -N to get a writable text (executable)
LDFLAGS	= -Xlinker -N
LDLIBS	= -lm

EMACS	= emacs

INCLUDES = forth.h io.h

FORTH_SRC = add.fs assert.fs ansi.fs blocks.fs bufio.fs checkans.fs \
	colorize.fs cross.fs debug.fs debugging.fs doskey.fs ds2texi.fs \
	dumpimage.fs environ.fs errore.fs etags.fs extend.fs filedump.fs \
	float.fs glocals.fs glosgen.fs gray.fs hash.fs history.fs \
	kernal.fs locals-test.fs look.fs mach32b.fs mach32l.fs main.fs \
	other.fs prims2x.fs random.fs search-order.fs see.fs sieve.fs \
	startup.fs struct.fs tools.fs toolsext.fs tt.fs vars.fs vt100.fs \
	vt100key.fs wordinfo.fs wordsets.fs

SOURCES	= Makefile.in configure  config.sub  config.guess \
	INSTALL README ToDo BUGS model gforth.ds \
	primitives engine.c main.c io.c \
	apollo68k.h decstation.h 386.h hppa.h cache.c ecvt.c sparc.h \
	getopt.c getopt1.c getopt.h \
	makefile.dos io-dos.h configure.bat startup.dos \
	glosgen.glo glossaries.doc \
	$(INCLUDES) $(FORTH_SRC)

RCS_FILES =  ToDo model high-level

GEN = gforth

OBJECTS	= engine.o io.o main.o

# things that need a working forth system to be generated
# this is used for antidependences,

FORTH_GEN =  primitives.b primitives.i prim_labels.i aliases.fs kernl32l.fi kernl32b.fi

GEN_PRECIOUS = $(FORTH_GEN) gforth.texi gforth.dvi gforth.ps Makefile

all:
	if [ ! -f gforth ]; then $(MAKE) first; fi
	$(MAKE) more

first:	gforth

more:	$(FORTH_GEN) gforth

#from the gcc Makefile: 
#"Deletion of files made during compilation.
# There are four levels of this:
#   `mostlyclean', `clean', `distclean' and `realclean'.
# `mostlyclean' is useful while working on a particular type of machine.
# It deletes most, but not all, of the files made by compilation.
# It does not delete libgcc.a or its parts, so it won't have to be recompiled.
# `clean' deletes everything made by running `make all'.
# `distclean' also deletes the files made by config.
# `realclean' also deletes everything that could be regenerated automatically."

clean:		
		-$(RM) $(GEN) *.o *.s

distclean:	clean
		-$(RM) machine.h

realclean:	distclean
		-$(RM) $(GEN_PRECIOUS)

package:	$(SOURCES) $(FORTH_GEN)
		-rm ../gforth-$(VERSION)
		ln -s `pwd` ../gforth-$(VERSION)
		echo "" $(SOURCES) $(FORTH_GEN) |\
			sed -e 's| | gforth-$(VERSION)/|g' |\
			(cd ..; xargs tar cvf gforth/gforth-$(VERSION).tar)
		gzip -9 -f gforth-$(VERSION).tar
		-rm ../gforth-$(VERSION)

Makefile:	Makefile.in
		configure

gforth:	$(OBJECTS)
		-$(CP) gforth gforth~
		$(GCC) $(LDFLAGS) $(OBJECTS) $(LDLIBS) -o $@
		@MAKE-EXECUTE@

kernl32l.fi:	main.fs search-order.fs cross.fs aliases.fs vars.fs add.fs \
		errore.fs kernal.fs extend.fs tools.fs toolsext.fs \
		mach32l.fs $(FORTH_GEN)
		-$(CP) kernl32l.fi kernl32l.fi~
		$(FORTH) -e 's" mach32l.fs"' main.fs
		@LINK-KERNL32L@

kernl32b.fi:	main.fs search-order.fs cross.fs aliases.fs vars.fs add.fs \
		errore.fs kernal.fs extend.fs tools.fs toolsext.fs \
		mach32b.fs $(FORTH_GEN)
		-$(CP) kernl32b.fi kernl32b.fi~
		$(FORTH) -e 's" mach32b.fs"' main.fs
		@LINK-KERNL32B@

engine.s:	engine.c primitives.i prim_labels.i machine.h $(INCLUDES)
		$(GCC) $(CFLAGS) -S engine.c

engine.o:	engine.c primitives.i prim_labels.i machine.h $(INCLUDES)

primitives.b:	primitives
		m4 primitives >$@ 

primitives.i :	primitives.b prims2x.fs
		$(FORTH) prims2x.fs -e "s\" primitives.b\" ' output-c process-file bye" >$@

prim_labels.i :	primitives.b prims2x.fs
		$(FORTH) prims2x.fs -e "s\" primitives.b\" ' output-label process-file bye" >$@

aliases.fs:	primitives.b prims2x.fs
		$(FORTH) prims2x.fs -e "s\" primitives.b\" ' output-alias process-file bye" >$@

primitives.fs:	primitives.b prims2x.fs
		$(FORTH) prims2x.fs -e "s\" primitives.b\" ' output-forth process-file bye" >$@

gforth.texi:	gforth.ds primitives.b ds2texi.fs prims2x.fs
		$(FORTH) ds2texi.fs >$@

gforth.dvi:	gforth.texi
		tex gforth.texi

gforth.ps:	gforth.dvi
		dvips gforth.dvi -o $@

%.s :		%.c $(INCLUDES)
		$(CC) $(CFLAGS) -S $< -o $@

%.o :		%.s
		$(CC) $(CFLAGS) -c $< -o $@


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>