File:  [gforth] / gforth / engine / Makefile.in
Revision 1.65: download - view: text, annotated - select for diffs
Sat Jun 30 20:28:55 2007 UTC (16 years, 9 months ago) by anton
Branches: MAIN
CVS tags: HEAD
fixed minor bug in -falign-* configure tests
cleaned up dependencies on .h files in engine/Makefile.in
made Alpha port compile with gcc-2.95 (disabled longlong.h division)
optimized Alpha port:
  use old division code
  native code after a jump is now aligned.  Speed effect:
   sieve bubble matrix  fib
    1.950 1.605  1.259 1.653 b1 gcc-3.3.5
    1.453 1.932  1.230 1.458 b1 gcc-3.3.5 with alignment
  aligning branch targets would probably also help

    1: #Makefile for the C part of Gforth
    2: 
    3: #Copyright (C) 1995,1996,1997,1998,2000,2003,2006 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 =@PACKAGE_VERSION@
   24: DOSVERSION=`echo $VERSION|sed 's/\.//g'`
   25: EXE=@EXEEXT@
   26: 
   27: # ------------- System specific variables
   28: 
   29: machine=@machine@
   30: kernel_fi = @kernel_fi@
   31: include_fi = @include_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: EC = @EC@
   42: 
   43: # ------------- Utility programs
   44: 
   45: SHELL	= /bin/sh
   46: RM	= rm
   47: RMTREE	= rm -rf
   48: CP	= cp -p
   49: TAR	= tar cf -
   50: GCC	= @CC@
   51: CC	= $(GCC)
   52: LD	= $(GCC:gcc=ld)
   53: AS	= $(GCC:gcc=as)
   54: STRIP	= strip
   55: GCCLD	= @GCC_LD@
   56: 
   57: FORTHPATH = .$(PATHSEP)$(libdir)/gforth/site-forth$(PATHSEP)$(datadir)/gforth/site-forth$(PATHSEP)$(libdir)/gforth/$(VERSION)$(PATHSEP)$(datadir)/gforth/$(VERSION)
   58: 
   59: # ------------	Install Directorys
   60: 
   61: VPATH = @srcdir@
   62: prefix = @prefix@
   63: exec_prefix = @exec_prefix@
   64: srcdir = @srcdir@
   65: bindir = $(exec_prefix)/bin
   66: #read-only architecture-independent files
   67: datadir = $(prefix)/share
   68: #read-only architecture-dependent non-ascii files
   69: libdir = $(prefix)/lib
   70: infodir = $(prefix)/info
   71: mandir = $(prefix)/man
   72: man1dir= $(mandir)/man1
   73: man1ext= .1
   74: 
   75: # ------------- Compiler Flags
   76: 
   77: XCFLAGS	= @CFLAGS@
   78: XDEFINES = @DEFS@
   79: SWITCHES = $(XCFLAGS) $(XDEFINES)
   80: #use -fno-inline to avoid register problems with asinh, atanh on gcc-3.3 on 386
   81: ENGINE_FLAGS = @ENGINE_FLAGS@ -fno-defer-pop -fcaller-saves -fno-inline
   82: DEBUGFLAG = @DEBUGFLAG@
   83: CFLAGS	= $(DEBUGFLAG) -I$(srcdir)/../arch/$(machine) -I. -Wall $(SWITCHES) -DDEFAULTPATH='"$(FORTHPATH)"'
   84: CFLAGS2	= $(DEBUGFLAG) -I$(srcdir)/../arch/$(machine) -I. -Wall $(SWITCHES) -DDEFAULTPATH='"$(FORTHPATH)"'
   85: FORTHKFLAGS= --die-on-signal -p "..$(PATHSEP)$(srcdir)" -i ../$(kernel_fi)
   86: FORTHK	= ../gforth $(FORTHKFLAGS)
   87: FORTH	= ../gforth --die-on-signal -p "..$(PATHSEP)$(srcdir)" -i ../gforth.fi
   88: 
   89: #John Wavrik should use -Xlinker -N to get a writable text (executable)
   90: XLDFLAGS = @LDFLAGS@
   91: LDFLAGS =  $(DEBUGFLAG) $(XLDFLAGS)
   92: LDLIBS  = @LIBS@
   93: 
   94: AOBJECTS = @signals_o@ support.o @LIBOBJS@
   95: 
   96: @MAKEINC@
   97: 
   98: OBJECTS = engine.o @engine2@ main.o
   99: OBJECTS_NATIVE = engine-native.o engine-native2.o engine-native3.o main-native.o
  100: OBJECTS_FAST = engine-fast.o @engine_fast2@ main-fast.o
  101: OBJECTS_ITC = engine-itc.o main-itc.o
  102: OBJECTS_DITC = engine-ditc.o main-ditc.o
  103: OBJECTS_PROF = engine-prof.o main-prof.o
  104: OBJECTS_FI =  engine.o main-fi.o
  105: 
  106: # In engine subdirectory there are (or should be) only files that belong to
  107: # our engine, so we can make life easy
  108: DEPS =  config.h forth.h io.h $(srcdir)/../arch/$(machine)/*.[h]
  109: ENGINE_DEPS = engine.c $(DEPS) prim_lab.i prim.i @image_i@ fnmatch.h threaded.h
  110: MAIN_DEPS = main.c $(DEPS) prim_superend.i prim_num.i prim_grp.i costs.i super2.i
  111: ENGINE_FAST_DEPS = engine.c $(DEPS) prim_lab-fast.i prim-fast.i fnmatch.h threaded.h
  112: MAIN_FAST_DEPS = main.c $(DEPS) prim_superend-fast.i prim_num-fast.i prim_grp-fast.i costs-fast.i super2-fast.i
  113: 
  114: #some makes don't do the -o $@ correctly, so we help them
  115: .c.o:
  116: 	$(GCC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
  117: 
  118: .s.o:
  119: 	$(GCC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
  120: 
  121: support.o: support.c config.h forth.h longlong.h
  122: 
  123: strtol.o: strtol.c ansidecl.h
  124: 
  125: fnmatch.o: fnmatch.c fnmatch.h
  126: 
  127: getopt1.o: getopt1.c getopt.h
  128: 
  129: getopt.o: getopt.c getopt.h
  130: 
  131: gforth$(EC)$(EXE):	$(OBJECTS) $(AOBJECTS)
  132: 	$(GCCLD) $(LDFLAGS) $(OBJECTS) $(AOBJECTS) $(LDLIBS) -o $@
  133: 
  134: gforth-native$(EC)$(EXE):	$(OBJECTS_NATIVE) $(AOBJECTS)
  135: 	$(GCCLD) $(LDFLAGS) $(OBJECTS_NATIVE) $(AOBJECTS) $(LDLIBS) -o $@
  136: 
  137: gforth-fast$(EC)$(EXE):	$(OBJECTS_FAST) $(AOBJECTS)
  138: 	$(GCCLD) $(LDFLAGS) $(OBJECTS_FAST) $(AOBJECTS) $(LDLIBS) -o $@
  139: 
  140: gforth-itc$(EC)$(EXE):	$(OBJECTS_ITC) $(AOBJECTS)
  141: 	$(GCCLD) $(LDFLAGS) $(OBJECTS_ITC) $(AOBJECTS) $(LDLIBS) -o $@
  142: 
  143: gforth-ditc$(EC)$(EXE): $(OBJECTS_DITC) $(AOBJECTS)
  144: 	$(GCCLD) $(LDFLAGS) $(OBJECTS_DITC) $(AOBJECTS) $(LDLIBS) -o $@
  145: 
  146: gforth-prof$(EC)$(EXE): $(OBJECTS_PROF) $(AOBJECTS) profile.o
  147: 	$(GCCLD) $(LDFLAGS) $(OBJECTS_PROF) $(AOBJECTS) profile.o $(LDLIBS) -o $@
  148: 
  149: gforth-fi$(EC)$(EXE):	$(OBJECTS_FI) $(AOBJECTS)
  150: 	$(GCCLD) $(LDFLAGS) $(OBJECTS_FI) $(AOBJECTS) $(LDLIBS) -o $@
  151: 
  152: engine.s:	$(ENGINE_FAST_DEPS)
  153: 		$(GCC) $(CFLAGS2) $(ENGINE_FLAGS) -S $(srcdir)/engine.c
  154: 
  155: engine.o:	$(ENGINE_DEPS)
  156: 		$(GCC) $(CFLAGS2) $(ENGINE_FLAGS) -DGFORTH_DEBUGGING -o $@ -c $(srcdir)/engine.c
  157: 
  158: engine2.o:	$(ENGINE_DEPS)
  159: 		$(GCC) $(CFLAGS2) $(ENGINE_FLAGS) -DGFORTH_DEBUGGING -DENGINE=2 -o $@ -c $(srcdir)/engine.c
  160: 
  161: engine-native.o:$(ENGINE_FAST_DEPS)
  162: 		$(GCC) $(CFLAGS2) $(ENGINE_FLAGS) -DNO_IP -o $@ -c $(srcdir)/engine.c
  163: 
  164: engine-native2.o:$(ENGINE_FAST_DEPS)
  165: 		$(GCC) $(CFLAGS2) $(ENGINE_FLAGS) -DNO_IP -DENGINE=2 -o $@ -c $(srcdir)/engine.c
  166: 
  167: engine-native3.o:$(ENGINE_FAST_DEPS)
  168: 		$(GCC) $(CFLAGS2) $(ENGINE_FLAGS) -DNO_IP -DENGINE=3 -o $@ -c $(srcdir)/engine.c
  169: 
  170: engine-fast.o:	$(ENGINE_FAST_DEPS)
  171: 		$(GCC) $(CFLAGS2) $(ENGINE_FLAGS) -o $@ -c $(srcdir)/engine.c
  172: 
  173: engine-fast2.o:	$(ENGINE_FAST_DEPS)
  174: 		$(GCC) $(CFLAGS2) $(ENGINE_FLAGS) -DENGINE=2 -o $@ -c $(srcdir)/engine.c
  175: 
  176: engine-itc.o:	$(ENGINE_DEPS)
  177: 		$(GCC) $(CFLAGS2) $(ENGINE_FLAGS) -DINDIRECT_THREADED -DGFORTH_DEBUGGING -o $@ -c $(srcdir)/engine.c
  178: 
  179: engine-ditc.o:	$(ENGINE_DEPS)
  180: 		$(GCC) $(CFLAGS2) $(ENGINE_FLAGS) -DDOUBLY_INDIRECT -o $@ -c $(srcdir)/engine.c
  181: 
  182: engine-prof.o:	$(ENGINE_DEPS)
  183: 		$(GCC) $(CFLAGS2) $(ENGINE_FLAGS) -DVM_PROFILING -o $@ -c $(srcdir)/engine.c
  184: 
  185: main.o:		$(MAIN_DEPS) 
  186: 		$(GCC) $(CFLAGS) -DGFORTH_DEBUGGING @no_dynamic@ -o $@ -c $(srcdir)/main.c
  187: 
  188: main-native.o:	$(MAIN_FAST_DEPS) 
  189: 		$(GCC) $(CFLAGS) -DNO_IP -o $@ -c $(srcdir)/main.c
  190: 
  191: main-fast.o:	$(MAIN_FAST_DEPS) 
  192: 		$(GCC) $(CFLAGS) -o $@ -c $(srcdir)/main.c
  193: 
  194: main-itc.o:	$(MAIN_DEPS) 
  195: 		$(GCC) $(CFLAGS) -DINDIRECT_THREADED -DGFORTH_DEBUGGING -o $@ -c $(srcdir)/main.c
  196: 
  197: main-ditc.o:	$(MAIN_DEPS)
  198: 		$(GCC) $(CFLAGS) -DDOUBLY_INDIRECT -o $@ -c $(srcdir)/main.c
  199: 
  200: main-prof.o:	$(MAIN_DEPS)
  201: 		$(GCC) $(CFLAGS) -DVM_PROFILING -o $@ -c $(srcdir)/main.c
  202: 
  203: main-fi.o:	$(MAIN_DEPS)
  204: 		$(GCC) $(CFLAGS) -DINCLUDE_IMAGE -o $@ -c $(srcdir)/main.c
  205: 
  206: peephole.o:	peephole.c peephole.i $(DEPS)
  207: 		$(GCC) $(CFLAGS) -o $@ -c $(srcdir)/peephole.c
  208: 
  209: profile.o:	profile.c profile.i $(DEPS)
  210: 		$(GCC) $(CFLAGS) -o $@ -c $(srcdir)/profile.c
  211: 
  212: #The next two rules seem to be superfluous:
  213: 
  214: # engine:		$(OBJECTS) $(OBJECTS0) ;
  215: 
  216: # engine_ditc:	$(OBJECTS_DITC) $(OBJECTS0) ;
  217: 
  218: #NeXTstep hack
  219: 
  220: termios.o:	/usr/lib/libposix.a
  221: 	ar x /usr/lib/libposix.a termios.o
  222: 
  223: #duplicated rules to avoid too many recursive make invocations
  224: # !! No any forth stuff should be done in ../Makefile.
  225: # !! I added the dependencies on prim.i and prim_lab.i in the main Makefile, jens
  226: 
  227: #I commented out the following rules because they are no longer up-to-date. - anton
  228: 
  229: #prim.i:		../prim.b ../prims2x.fs
  230: #		$(FORTHK) prims2x.fs -e "s\" ../prim.b\" ' output-c process-file bye" >$@-
  231: #		$(CP) $@- $@
  232: #		$(RM) $@-
  233: #
  234: #prim_lab.i:	../prim.b ../prims2x.fs
  235: #		$(FORTHK) prims2x.fs -e "s\" ../prim.b\" ' output-label process-file bye" >$@-
  236: #		$(CP) $@- $@
  237: #		$(RM) $@-
  238: 
  239: config.h:	stamp-h
  240: stamp-h:	config.h.in ../config.status ../stamp-h.in
  241: 		cd .. && CONFIG_FILES=$@ CONFIG_HEADERS=engine/config.h ./config.status
  242: 		echo timestamp > stamp-h
  243: 
  244: image.i:	../fi2c.fs ../$(include_fi)
  245: 		$(FORTH) fi2c.fs -e "s\" ../$(include_fi)\" fi2c bye" >$@
  246: 
  247: ../$(include_fi):	FORCE
  248: 		cd .. && $(MAKE) $(include_fi)
  249: 
  250: #phony targets depend on FORCE; this is more portable than .PHONY
  251: FORCE:
  252: 

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