File:  [gforth] / gforth / engine / Makefile.in
Revision 1.31: download - view: text, annotated - select for diffs
Sun Dec 2 13:00:12 2001 UTC (22 years, 4 months ago) by anton
Branches: MAIN
CVS tags: HEAD
explicit register allocation for gcc-3.0.x (not as good as gcc-2.95, but
  better than before); don't use TOS with gcc-3.x, so rp can be allocated.
Compile engine.c with -fno-gcse (to improve gcc-3.x code quality).

    1: #Makefile for the C part of 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: # ------------- gforth version
   22: 
   23: VERSION =@VERSION@
   24: DOSVERSION=`echo $VERSION|sed 's/\.//g'`
   25: EXE=@EXE@
   26: 
   27: # ------------- System specific variables
   28: 
   29: machine=@machine@
   30: kernel_fi=@kernel_fi@
   31: include_fi=gforth.fi
   32: # this is the type of machine
   33: # used to extend the include path with ./arch/$machine
   34: # so we could include a machine specific
   35: # machine.h file
   36: 
   37: PATHSEP = @PATHSEP@
   38: 
   39: osclass = @OSCLASS@
   40: 
   41: # ------------- Utility programs
   42: 
   43: SHELL	= /bin/sh
   44: RM	= rm
   45: RMTREE	= rm -rf
   46: CP	= cp -p
   47: TAR	= tar cf -
   48: GCC	= @CC@
   49: CC	= $(GCC)
   50: STRIP	= strip
   51: 
   52: FORTHPATH = .$(PATHSEP)$(libdir)/gforth/site-forth$(PATHSEP)$(datadir)/gforth/site-forth$(PATHSEP)$(libdir)/gforth/$(VERSION)$(PATHSEP)$(datadir)/gforth/$(VERSION)
   53: 
   54: # ------------	Install Directorys
   55: 
   56: VPATH = @srcdir@
   57: prefix = @prefix@
   58: exec_prefix = @exec_prefix@
   59: srcdir = @srcdir@
   60: bindir = $(exec_prefix)/bin
   61: #read-only architecture-independent files
   62: datadir = $(prefix)/share
   63: #read-only architecture-dependent non-ascii files
   64: libdir = $(prefix)/lib
   65: infodir = $(prefix)/info
   66: mandir = $(prefix)/man
   67: man1dir= $(mandir)/man1
   68: man1ext= .1
   69: 
   70: # ------------- Compiler Flags
   71: 
   72: XCFLAGS	= @CFLAGS@
   73: XDEFINES = @DEFS@
   74: SWITCHES = $(XCFLAGS) $(XDEFINES)
   75: ENGINE_FLAGS = @ENGINE_FLAGS@ -fno-defer-pop -fcaller-saves
   76: DEBUGFLAG = @DEBUGFLAG@
   77: CFLAGS	= $(DEBUGFLAG) -I$(srcdir)/../arch/$(machine) -I. -O3 -Wall $(SWITCHES) -DDEFAULTPATH=\"$(FORTHPATH)\"
   78: CFLAGS2	= $(DEBUGFLAG) -I$(srcdir)/../arch/$(machine) -I. -O3 -Wall $(SWITCHES) -DDEFAULTPATH=\"$(FORTHPATH)\"
   79: FORTHKFLAGS= --die-on-signal -p "..$(PATHSEP)$(srcdir)" -i ../$(kernel_fi)
   80: FORTHK	= ../gforth $(FORTHKFLAGS)
   81: 
   82: #John Wavrik should use -Xlinker -N to get a writable text (executable)
   83: XLDFLAGS = @LDFLAGS@
   84: LDFLAGS =  $(DEBUGFLAG) $(XLDFLAGS)
   85: LDLIBS  = @LIBS@
   86: 
   87: AOBJECTS = io.o signals.o memcmpc.o peephole.o @LIBOBJS@
   88: 
   89: OBJECTS = engine.o main.o
   90: OBJECTS_FAST = engine-fast.o main-fast.o
   91: OBJECTS_DITC = engine-ditc.o main-ditc.o
   92: OBJECTS_PROF = engine-prof.o main-prof.o
   93: OBJECTS_FI =  engine.o main-fi.o
   94: 
   95: # In engine subdirectory there are (or should be) only files that belong to
   96: # our engine, so we can make life easy
   97: DEPS =  config.h *.h $(srcdir)/../arch/$(machine)/*.[h]
   98: ENGINE_DEPS = engine.c $(DEPS) prim_lab.i prim.i
   99: 
  100: #some makes don't do the -o $@ correctly, so we help them
  101: .c.o:
  102: 	$(GCC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
  103: 
  104: gforth$(EXE):	$(OBJECTS) $(AOBJECTS)
  105: 	$(GCC) $(LDFLAGS) $(OBJECTS) $(AOBJECTS) $(LDLIBS) -o $@
  106: 
  107: gforth-fast$(EXE):	$(OBJECTS_FAST) $(AOBJECTS)
  108: 	$(GCC) $(LDFLAGS) $(OBJECTS_FAST) $(AOBJECTS) $(LDLIBS) -o $@
  109: 
  110: gforth-ditc$(EXE): $(OBJECTS_DITC) $(AOBJECTS)
  111: 	$(GCC) $(LDFLAGS) $(OBJECTS_DITC) $(AOBJECTS) $(LDLIBS) -o $@
  112: 
  113: gforth-prof$(EXE): $(OBJECTS_PROF) $(AOBJECTS) profile.o
  114: 	$(GCC) $(LDFLAGS) $(OBJECTS_PROF) $(AOBJECTS) profile.o $(LDLIBS) -o $@
  115: 
  116: gforth-fi$(EXE):	$(OBJECTS_FI) $(AOBJECTS)
  117: 	$(GCC) $(LDFLAGS) $(OBJECTS_FI) $(AOBJECTS) $(LDLIBS) -o $@
  118: 
  119: engine.s:	$(ENGINE_DEPS)
  120: 		$(GCC) -fno-gcse $(CFLAGS) $(ENGINE_FLAGS) -S $(srcdir)/engine.c
  121: 
  122: engine.o:	$(ENGINE_DEPS)
  123: 		$(GCC) -fno-gcse $(CFLAGS2) $(ENGINE_FLAGS) -DGFORTH_DEBUGGING -o $@ -c $(srcdir)/engine.c
  124: 
  125: engine-fast.o:	$(ENGINE_DEPS)
  126: 		$(GCC) -fno-gcse $(CFLAGS) $(ENGINE_FLAGS) -o $@ -c $(srcdir)/engine.c
  127: 
  128: engine-ditc.o:	$(ENGINE_DEPS)
  129: 		$(GCC) -fno-gcse $(CFLAGS2) $(ENGINE_FLAGS) -DDOUBLY_INDIRECT -o $@ -c $(srcdir)/engine.c
  130: 
  131: engine-prof.o:	$(ENGINE_DEPS)
  132: 		$(GCC) -fno-gcse $(CFLAGS2) $(ENGINE_FLAGS) -DVM_PROFILING -o $@ -c $(srcdir)/engine.c
  133: 
  134: main.o:		main.c $(DEPS) 
  135: 		$(GCC) $(CFLAGS) $(ENGINE_FLAGS) -DGFORTH_DEBUGGING -o $@ -c $(srcdir)/main.c
  136: 
  137: main-fast.o:	main.c $(DEPS) 
  138: 		$(GCC) $(CFLAGS) $(ENGINE_FLAGS) -o $@ -c $(srcdir)/main.c
  139: 
  140: main-ditc.o:	main.c $(DEPS)
  141: 		$(GCC) $(CFLAGS) $(ENGINE_FLAGS) -DDOUBLY_INDIRECT -o $@ -c $(srcdir)/main.c
  142: 
  143: main-prof.o:	main.c $(DEPS)
  144: 		$(GCC) $(CFLAGS) $(ENGINE_FLAGS) -DVM_PROFILING -o $@ -c $(srcdir)/main.c
  145: 
  146: main-fi.o:	main.c $(DEPS)
  147: 		$(GCC) $(CFLAGS) $(ENGINE_FLAGS) -DINCLUDE_IMAGE -o $@ -c $(srcdir)/main.c
  148: 
  149: peephole.o:	peephole.c peephole.i $(DEPS)
  150: 		$(GCC) $(CFLAGS) $(ENGINE_FLAGS) -o $@ -c $(srcdir)/peephole.c
  151: 
  152: profile.o:	profile.c profile.i $(DEPS)
  153: 		$(GCC) $(CFLAGS) $(ENGINE_FLAGS) -o $@ -c $(srcdir)/profile.c
  154: 
  155: #The next two rules seem to be superfluous:
  156: 
  157: # engine:		$(OBJECTS) $(OBJECTS0) ;
  158: 
  159: # engine_ditc:	$(OBJECTS_DITC) $(OBJECTS0) ;
  160: 
  161: #NeXTstep hack
  162: 
  163: termios.o:	/usr/lib/libposix.a
  164: 	ar x /usr/lib/libposix.a termios.o
  165: 
  166: #duplicated rules to avoid too many recursive make invocations
  167: # !! No any forth stuff should be done in ../Makefile.
  168: # !! I added the dependencies on prim.i and prim_lab.i in the main Makefile, jens
  169: 
  170: #I commented out the following rules because they are no longer up-to-date. - anton
  171: 
  172: #prim.i:		../prim.b ../prims2x.fs
  173: #		$(FORTHK) prims2x.fs -e "s\" ../prim.b\" ' output-c process-file bye" >$@-
  174: #		$(CP) $@- $@
  175: #		$(RM) $@-
  176: #
  177: #prim_lab.i:	../prim.b ../prims2x.fs
  178: #		$(FORTHK) prims2x.fs -e "s\" ../prim.b\" ' output-label process-file bye" >$@-
  179: #		$(CP) $@- $@
  180: #		$(RM) $@-
  181: 
  182: config.h:	stamp-h
  183: stamp-h:	config.h.in ../config.status
  184: 		cd .. && CONFIG_FILES=$@ CONFIG_HEADERS=engine/config.h ./config.status
  185: 		echo timestamp > stamp-h
  186: 
  187: image.c:	../fi2c.fs ../$(include_fi)
  188: 		$(FORTHK) fi2c.fs -e "s\" ../$(include_fi)\" fi2c bye" >$@
  189: 
  190: ../$(include_fi):	FORCE
  191: 		cd .. && $(MAKE) $(include_fi)
  192: 
  193: #phony targets depend on FORCE; this is more portable than .PHONY
  194: FORCE:
  195: 

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