File:  [gforth] / gforth / Makefile.in
Revision 1.16: download - view: text, annotated - select for diffs
Mon Jan 30 18:47:43 1995 UTC (29 years, 2 months ago) by anton
Branches: MAIN
CVS tags: HEAD
fixed a few bugs and documented others
added required and require
added [ENDIF]

    1: #Copyright 1992 by the ANSI figForth Development Group
    2: # 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: 
    7: #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: RM	= rm
   13: CP	= cp
   14: INSTALL	= @INSTALL@
   15: INSTALL_PROGRAM = @INSTALL_PROGRAM@
   16: INSTALL_DATA = @INSTALL_DATA@
   17: LN_S	= @LN_S@
   18: GCC	= gcc
   19: FORTH	= ./gforth
   20: CC	= gcc
   21: TEXI2DVI = tex
   22: DVI2PS	= dvips
   23: #you can get texi2html from http://asis01.cern.ch/infohtml/texi2html.html
   24: TEXI2HTML = texi2html
   25: MAKEINFO = makeinfo
   26: XCFLAGS	= @CFLAGS@
   27: XDEFINES = @DEFS@
   28: SWITCHES = $(XCFLAGS) $(XDEFINES) #-DNDEBUG #turn off assertions
   29: ENGINE_FLAGS =  -fforce-mem -fforce-addr -fomit-frame-pointer -fno-defer-pop -fcaller-saves
   30: CFLAGS	= -g -O4 -Wall $(SWITCHES)
   31: 
   32: #John Wavrik should use -Xlinker -N to get a writable text (executable)
   33: LDFLAGS	=  @LDFLAGS@ @GCCLDFLAGS@
   34: 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: 
   47: 
   48: INCLUDES = forth.h io.h
   49: 
   50: FORTH_SRC = add.fs assert.fs ansi.fs blocks.fs bufio.fs checkans.fs \
   51: 	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: 	kernal.fs locals-test.fs look.fs main.fs \
   55:  	mach16b.fs mach16l.fs mach32b.fs mach32l.fs mach64b.fs mach64l.fs \
   56: 	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: 	vt100key.fs wordinfo.fs wordsets.fs
   59: 
   60: SOURCES	= CVS Makefile.in configure.in configure config.sub  config.guess \
   61: 	install-sh INSTALL README ToDo BUGS model gforth.ds texinfo.tex \
   62: 	primitives engine.c main.c io.c \
   63: 	m68k.h mips.h 386.h hppa.h cache.c sparc.h power.h 32bit.h \
   64: 	getopt.c getopt1.c getopt.h select.c \
   65: 	ecvt.c memcmp.c strtol.c strtoul.c memmove.c \
   66: 	makefile.dos io-dos.h configure.bat startup.dos \
   67: 	glosgen.glo glossaries.doc \
   68: 	$(INCLUDES) $(FORTH_SRC)
   69: 
   70: RCS_FILES =  ToDo model high-level
   71: 
   72: GEN = gforth
   73: 
   74: OBJECTS	= engine.o io.o main.o @LIBOBJS@ @getopt_long@
   75: 
   76: # things that need a working forth system to be generated
   77: FORTH_GEN0 = primitives.b primitives.i prim_labels.i aliases.fs
   78: FORTH_GEN =  $(FORTH_GEN0) @KERNAL@ 
   79: # this is used for antidependences,
   80: FORTH_GEN1 = $(FORTH_GEN0) @gforth_fi@ 
   81: 
   82: 
   83: GEN_PRECIOUS = $(FORTH_GEN) gforth.texi gforth.dvi gforth.ps Makefile configure
   84: 
   85: #standards.info recommends this:
   86: .SUFFIXES:
   87: .SUFFIXES: .c .o
   88: 
   89: all:
   90: 	if [ ! -f gforth ]; then $(MAKE) first; fi
   91: 	$(MAKE) more
   92: 
   93: first:	gforth
   94: 
   95: more:	$(FORTH_GEN) gforth
   96: 
   97: #from the gcc Makefile: 
   98: #"Deletion of files made during compilation.
   99: # There are four levels of this:
  100: #   `mostlyclean', `clean', `distclean' and `realclean'.
  101: # `mostlyclean' is useful while working on a particular type of machine.
  102: # It deletes most, but not all, of the files made by compilation.
  103: # It does not delete libgcc.a or its parts, so it won't have to be recompiled.
  104: # `clean' deletes everything made by running `make all'.
  105: # `distclean' also deletes the files made by config.
  106: # `realclean' also deletes everything that could be regenerated automatically."
  107: 
  108: clean:		
  109: 		-$(RM) $(GEN) *.o *.s
  110: 
  111: distclean:	clean
  112: 		-$(RM) machine.h gforth.fi config.cache config.log
  113: 
  114: realclean:	distclean
  115: 		-$(RM) $(GEN_PRECIOUS)
  116: 
  117: dist:		$(SOURCES) $(FORTH_GEN)
  118: 		-rm gforth-$(VERSION)
  119: 		ln -s `pwd` gforth-$(VERSION)
  120: 		echo "" $(SOURCES) $(FORTH_GEN) |\
  121: 			sed -e 's| | gforth-$(VERSION)/|g' |\
  122: 			xargs tar cvf gforth-$(VERSION).tar
  123: 		gzip -9 -f gforth-$(VERSION).tar
  124: 		-rm gforth-$(VERSION)
  125: 
  126: #strip gforth, because the debugging stuff is hardly useful once
  127: # gforth manages to execute more than a few primitives
  128: 
  129: install:	gforth $(FORTH_SRC) gforth.fi gforth.1 gforth.info
  130: 		$(INSTALL) -d $(bindir) $(mandir) $(infodir) $(libdir)/gforth $(datadir)/gforth	
  131: 		$(INSTALL_PROGRAM) -s gforth $(bindir)
  132: 		$(INSTALL_DATA) gforth.1 $(mandir)
  133: 		$(INSTALL_DATA) gforth.info* $(infodir)
  134: 		$(INSTALL_DATA) gforth.fi $(libdir)/gforth
  135: 		for i in $(FORTH_SRC); do \
  136: 			$(CP) $$i $(datadir)/gforth; \
  137: 			$(LN_S) $(datadir)/gforth/$$i $(libdir)/gforth \
  138: 		done
  139: 		
  140: dvi:		gforth.dvi
  141: 
  142: gforth:	$(OBJECTS)
  143: 		-$(CP) gforth gforth~
  144: 		$(GCC) $(LDFLAGS) $(OBJECTS) $(LDLIBS) -o $@
  145: 		@MAKE_EXE@
  146: 
  147: kernl16l.fi:	main.fs search-order.fs cross.fs aliases.fs vars.fs add.fs \
  148: 		errore.fs kernal.fs extend.fs tools.fs toolsext.fs \
  149: 		mach16l.fs $(FORTH_GEN1)
  150: 		-$(CP) kernl16l.fi kernl16l.fi~
  151: 		$(FORTH) -e 's" mach16l.fs"' main.fs
  152: 		@LINK_KERNL16L@
  153: 
  154: kernl16b.fi:	main.fs search-order.fs cross.fs aliases.fs vars.fs add.fs \
  155: 		errore.fs kernal.fs extend.fs tools.fs toolsext.fs \
  156: 		mach16b.fs $(FORTH_GEN1)
  157: 		-$(CP) kernl16b.fi kernl16b.fi~
  158: 		$(FORTH) -e 's" mach16b.fs"' main.fs
  159: 		@LINK_KERNL16B@
  160: 
  161: kernl32l.fi:	main.fs search-order.fs cross.fs aliases.fs vars.fs add.fs \
  162: 		errore.fs kernal.fs extend.fs tools.fs toolsext.fs \
  163: 		mach32l.fs $(FORTH_GEN1)
  164: 		-$(CP) kernl32l.fi kernl32l.fi~
  165: 		$(FORTH) -e 's" mach32l.fs"' main.fs
  166: 		@LINK_KERNL32L@
  167: 
  168: kernl32b.fi:	main.fs search-order.fs cross.fs aliases.fs vars.fs add.fs \
  169: 		errore.fs kernal.fs extend.fs tools.fs toolsext.fs \
  170: 		mach32b.fs $(FORTH_GEN1)
  171: 		-$(CP) kernl32b.fi kernl32b.fi~
  172: 		$(FORTH) -e 's" mach32b.fs"' main.fs
  173: 		@LINK_KERNL32B@
  174: 
  175: kernl64l.fi:	main.fs search-order.fs cross.fs aliases.fs vars.fs add.fs \
  176: 		errore.fs kernal.fs extend.fs tools.fs toolsext.fs \
  177: 		mach64l.fs $(FORTH_GEN1)
  178: 		-$(CP) kernl64l.fi kernl64l.fi~
  179: 		$(FORTH) -e 's" mach64l.fs"' main.fs
  180: 		@LINK_KERNL64L@
  181: 
  182: kernl64b.fi:	main.fs search-order.fs cross.fs aliases.fs vars.fs add.fs \
  183: 		errore.fs kernal.fs extend.fs tools.fs toolsext.fs \
  184: 		mach64b.fs $(FORTH_GEN1)
  185: 		-$(CP) kernl64b.fi kernl64b.fi~
  186: 		$(FORTH) -e 's" mach64b.fs"' main.fs
  187: 		@LINK_KERNL64B@
  188: 
  189: engine.s:	engine.c primitives.i prim_labels.i machine.h $(INCLUDES)
  190: 		$(GCC) $(CFLAGS) $(ENGINE_FLAGS) -S engine.c
  191: 
  192: engine.o:	engine.c primitives.i prim_labels.i machine.h $(INCLUDES)
  193: 		$(GCC) $(CFLAGS) $(ENGINE_FLAGS) -c engine.c
  194: 
  195: strtoul.o:	strtoul.c strtol.c
  196: 
  197: primitives.b:	primitives
  198: 		m4 primitives >$@ 
  199: 
  200: primitives.i :	primitives.b prims2x.fs
  201: 		$(FORTH) prims2x.fs -e "s\" primitives.b\" ' output-c process-file bye" >$@
  202: 
  203: prim_labels.i :	primitives.b prims2x.fs
  204: 		$(FORTH) prims2x.fs -e "s\" primitives.b\" ' output-label process-file bye" >$@
  205: 
  206: aliases.fs:	primitives.b prims2x.fs
  207: 		$(FORTH) prims2x.fs -e "s\" primitives.b\" ' output-alias process-file bye" >$@
  208: 
  209: primitives.fs:	primitives.b prims2x.fs
  210: 		$(FORTH) prims2x.fs -e "s\" primitives.b\" ' output-forth process-file bye" >$@
  211: 
  212: gforth.texi:	gforth.ds primitives.b ds2texi.fs prims2x.fs
  213: 		$(FORTH) ds2texi.fs >$@
  214: 
  215: gforth.dvi:	gforth.texi
  216: 		$(TEXI2DVI) gforth.texi
  217: 
  218: gforth.ps:	gforth.dvi
  219: 		$(DVI2PS) gforth.dvi -o $@
  220: 
  221: gforth.info:	gforth.texi
  222: 		-$(MAKEINFO) gforth.texi
  223: 
  224: html:		gforth.texi
  225: 		-$(RM) html/*
  226: 		-mkdir html
  227: 		cd html; $(TEXI2HTML) -menu -split_node ../gforth.texi
  228: 
  229: # For an explanation of the following Makefile rules, see node
  230: # `Automatic Remaking' in GNU Autoconf documentation.
  231: Makefile: Makefile.in config.status
  232: 	CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
  233: config.status: configure
  234: 	./config.status --recheck
  235: configure: configure.in
  236: 	cd $(srcdir) && autoconf
  237: 
  238: #unnecessary and does not work with all makes
  239: #%.s :		%.c $(INCLUDES)
  240: #		$(CC) $(CFLAGS) -S $< -o $@
  241: 
  242: #%.o :		%.s
  243: #		$(CC) $(CFLAGS) -c $< -o $@
  244: 

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