File:  [gforth] / gforth / engine / Makefile.in
Revision 1.90: download - view: text, annotated - select for diffs
Mon Dec 31 15:25:19 2012 UTC (11 years, 3 months ago) by anton
Branches: MAIN
CVS tags: HEAD
updated copyright year

    1: #Makefile for the C part of Gforth
    2: 
    3: #Copyright (C) 1995,1996,1997,1998,2000,2003,2006,2007,2008,2009,2011,2012 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 3
   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, see http://www.gnu.org/licenses/.
   19: 
   20: # ------------- gforth version
   21: 
   22: VERSION =@PACKAGE_VERSION@
   23: LIBVERSION=@LIB_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: EC = @EC@
   40: ARCH= @ARCH@
   41: 
   42: # ------------- Utility programs
   43: 
   44: SHELL	= /bin/sh
   45: RM	= rm
   46: RMTREE	= rm -rf
   47: CP	= cp -p
   48: TAR	= tar cf -
   49: GCC	= @CC@
   50: BOOTFORTH	= ../preforth
   51: CC	= $(GCC)
   52: LD	= $(GCC:gcc=ld)
   53: AS	= $(GCC:gcc=as)
   54: STRIP	= strip
   55: GCCLD	= @GCC_LD@
   56: LIBTOOL = @GNU_LIBTOOL@
   57: LTLD = $(LIBTOOL) --mode=link $(GCCLD) -rpath $(libdir) -version-info $(LIBVERSION) -module
   58: 
   59: FORTHPATH = .$(PATHSEP)$(libdir)/gforth/site-forth$(PATHSEP)$(datadir)/gforth/site-forth$(PATHSEP)$(libdir)/gforth$(ARCH)/$(VERSION)$(PATHSEP)$(datadir)/gforth/$(VERSION)
   60: 
   61: # ------------  Source and Build directories
   62: 
   63: top_srcdir = @top_srcdir@
   64: top_builddir = @top_builddir@
   65: 
   66: # ------------	Install directories
   67: 
   68: VPATH = @srcdir@
   69: prefix = @prefix@
   70: exec_prefix = @exec_prefix@
   71: srcdir = @srcdir@
   72: bindir = @bindir@
   73: #read-only architecture-independent files
   74: datadir = @datadir@
   75: #read-only architecture-dependent non-ascii files
   76: libdir = @libdir@
   77: infodir = @infodir@
   78: mandir = @mandir@
   79: man1dir= $(mandir)/man1
   80: man1ext= .1
   81: 
   82: # ------------- ltdl variables
   83: 
   84: LTDLDEPS = @LTDLDEPS@
   85: LTDLINCL = @LTDLINCL@
   86: LIBLTDL  = @LIBLTDL@
   87: 
   88: # ------------- Compiler Flags
   89: 
   90: XCFLAGS	= @CFLAGS@
   91: XDEFINES = @DEFS@
   92: SWITCHES = $(XCFLAGS) $(XDEFINES) $(OPTDEFINES)
   93: #use -fno-inline to avoid register problems with asinh, atanh on gcc-3.3 on 386
   94: ENGINE_FLAGS = @ENGINE_FLAGS@ -fno-defer-pop -fcaller-saves -fno-inline
   95: DEBUGFLAG = @DEBUGFLAG@
   96: CFLAGS	= $(DEBUGFLAG) -I$(srcdir)/../arch/$(machine) -I. -Wall $(SWITCHES) -DDEFAULTPATH='"$(FORTHPATH)"' $(LTDLINCL)
   97: CPPFLAGS=@CPPFLAGS@
   98: FORTHKFLAGS= --die-on-signal -p "..$(PATHSEP)$(srcdir)" -i ../$(kernel_fi)
   99: FORTHK	= ../gforth $(FORTHKFLAGS)
  100: FORTH	= $(BOOTFORTH) --die-on-signal
  101: 
  102: #John Wavrik should use -Xlinker -N to get a writable text (executable)
  103: XLDFLAGS = @LDFLAGS@
  104: LDFLAGS =  $(DEBUGFLAG) $(XLDFLAGS)
  105: LDLIBS  = @LIBS@ @LTDL_LDLIBS@
  106: 
  107: AOBJECTS = @signals_o@ support$(OPT).o @LIBOBJS@ $(OPTOBJECTS)
  108: 
  109: @MAKEINC@
  110: 
  111: OBJECTS = engine$(OPT).o @engine2@ main$(OPT).o
  112: OBJECTS_NATIVE = engine-native$(OPT).o engine-native2$(OPT).o engine-native3$(OPT).o main-native$(OPT).o
  113: OBJECTS_FAST = engine-fast$(OPT).o @engine_fast2@ main-fast$(OPT).o
  114: OBJECTS_ITC = engine-itc$(OPT).o main-itc$(OPT).o
  115: OBJECTS_DITC = engine-ditc$(OPT).o main-ditc$(OPT).o
  116: OBJECTS_PROF = engine-prof$(OPT).o main-prof$(OPT).o
  117: OBJECTS_FI =  engine$(OPT).o main-fi$(OPT).o
  118: 
  119: # In engine subdirectory there are (or should be) only files that belong to
  120: # our engine, so we can make life easy
  121: DEPS =  config.h forth.h io.h $(srcdir)/../arch/$(machine)/*.[h]
  122: ENGINE_DEPS = engine.c $(DEPS) prim_lab.i prim.i @image_i@ fnmatch.h threaded.h
  123: MAIN_DEPS = main.c $(DEPS) prim_superend.i prim_num.i prim_grp.i costs.i super2.i
  124: ENGINE_FAST_DEPS = engine.c $(DEPS) prim_lab-fast.i prim-fast.i fnmatch.h threaded.h
  125: MAIN_FAST_DEPS = main.c $(DEPS) prim_superend-fast.i prim_num-fast.i prim_grp-fast.i costs-fast.i super2-fast.i
  126: 
  127: COMPILE.c = $(GCC) $(CFLAGS) $(CPPFLAGS) -c # simulate BSD sys.mk
  128: LIBTOOL.c = $(LIBTOOL) --mode=compile $(COMPILE.c)
  129: COMPILER = $(COMPILE.c)
  130: 
  131: %.lo:	COMPILER = $(LIBTOOL.c)
  132: 
  133: #some makes don't do the -o $@ correctly, so we help them
  134: .c.o:
  135: 	$(COMPILER) -o $@ $<
  136: 
  137: %.lo:	%.c
  138: 	$(COMPILER) -o $@ $<
  139: 
  140: .s.o:
  141: 	$(COMPILER) -o $@ $<
  142: 
  143: support$(OPT).o support$(OPT).lo: support.c config.h forth.h longlong.h
  144: 	$(COMPILER) -o $@ $(srcdir)/support.c
  145: 
  146: strtol.o strtol.lo: strtol.c ansidecl.h
  147: 
  148: fnmatch.o fnmatch.lo: fnmatch.c fnmatch.h
  149: 
  150: getopt1.o getopt1.lo: getopt1.c getopt.h
  151: 
  152: getopt.o getopt.lo: getopt.c getopt.h
  153: 
  154: GFORTHDEPS = $(AOBJECTS) $(LTDLDEPS) libmain.o
  155: GFORTHOBJS = $(AOBJECTS) $(LDLIBS) libmain.o
  156: 
  157: LINKER=$(GCCLD) $(LDFLAGS) 
  158: %.la:	LINKER=$(LTLD) $(LDFLAGS) 
  159: 
  160: gforth$(OPT)$(EC)$(ARCH)$(EXE):	$(OBJECTS) $(GFORTHDEPS)
  161: 	$(LINKER) $(OBJECTS) $(GFORTHOBJS) -o $@
  162: 
  163: gforth-native$(OPT)$(EC)$(ARCH)$(EXE):	$(OBJECTS_NATIVE) $(GFORTHDEPS)
  164: 	$(LINKER) $(OBJECTS_NATIVE) $(GFORTHOBJS) -o $@
  165: 
  166: gforth-fast$(OPT)$(EC)$(ARCH)$(EXE):	$(OBJECTS_FAST) $(GFORTHDEPS)
  167: 	$(LINKER) $(OBJECTS_FAST) $(GFORTHOBJS) -o $@
  168: 
  169: gforth-itc$(OPT)$(EC)$(ARCH)$(EXE):	$(OBJECTS_ITC) $(GFORTHDEPS)
  170: 	$(LINKER) $(OBJECTS_ITC) $(GFORTHOBJS) -o $@
  171: 
  172: gforth-ditc$(OPT)$(EC)$(ARCH)$(EXE): $(OBJECTS_DITC) $(GFORTHDEPS)
  173: 	$(LINKER) $(OBJECTS_DITC) $(GFORTHOBJS) -o $@
  174: 
  175: gforth-prof$(OPT)$(EC)$(ARCH)$(EXE): $(OBJECTS_PROF) profile$(OPT).o $(GFORTHDEPS)
  176: 	$(LINKER) $(OBJECTS_PROF) $(AOBJECTS) profile$(OPT).o $(LDLIBS) -o $@
  177: 
  178: gforth-fi$(OPT)$(EC)$(ARCH)$(EXE):	$(OBJECTS_FI) $(GFORTHDEPS)
  179: 	$(LINKER) $(OBJECTS_FI) $(GFORTHOBJS) -o $@
  180: 
  181: LIBGFORTHDEPS = $(AOBJECTS:%.o=%.lo) $(LTDLDEPS)
  182: LIBGFORTHOBJS = $(AOBJECTS:%.o=%.lo) $(LDLIBS)
  183: 
  184: libgforth$(EC)$(ARCH).la libgforth$(OPT)$(EC)$(ARCH).la:	$(OBJECTS:%.o=%.lo) $(LIBGFORTHDEPS)
  185: 	$(LINKER) $(OBJECTS:%.o=%.lo) $(LIBGFORTHOBJS) -o $@
  186: 
  187: libgforth-native$(EC)$(ARCH).la libgforth-native$(OPT)$(EC)$(ARCH).la:	$(OBJECTS_NATIVE:%.o=%.lo) $(LIBGFORTHDEPS)
  188: 	$(LINKER) $(OBJECTS_NATIVE:%.o=%.lo) $(LIBGFORTHOBJS) -o $@
  189: 
  190: libgforth-fast$(EC)$(ARCH).la libgforth-fast$(OPT)$(EC)$(ARCH).la:	$(OBJECTS_FAST:%.o=%.lo) $(LIBGFORTHDEPS)
  191: 	$(LINKER) $(OBJECTS_FAST:%.o=%.lo) $(LIBGFORTHOBJS) -o $@
  192: 
  193: libgforth-itc$(EC)$(ARCH).la libgforth-itc$(OPT)$(EC)$(ARCH).la:	$(OBJECTS_ITC:%.o=%.lo) $(LIBGFORTHDEPS)
  194: 	$(LINKER) $(OBJECTS_ITC:%.o=%.lo) $(LIBGFORTHOBJS) -o $@
  195: 
  196: libgforth-ditc$(EC)$(ARCH).la libgforth-ditc$(OPT)$(EC)$(ARCH).la: $(OBJECTS_DITC:%.o=%.lo) $(LIBGFORTHDEPS)
  197: 	$(LINKER) $(OBJECTS_DITC:%.o=%.lo) $(LIBGFORTHOBJS) -o $@
  198: 
  199: libgforth-prof$(EC)$(ARCH).la libgforth-prof$(OPT)$(EC)$(ARCH).la: $(OBJECTS_PROF:%.o=%.lo) profile$(OPT).o $(LIBGFORTHDEPS)
  200: 	$(LINKER) $(OBJECTS_PROF:%.o=%.lo) $(AOBJECTS) profile$(OPT).o $(LDLIBS) -o $@
  201: 
  202: libgforth-fi$(EC)$(ARCH).la libgforth-fi$(OPT)$(EC)$(ARCH).la:	$(OBJECTS_FI:%.o=%.lo) $(LIBGFORTHDEPS)
  203: 	$(LINKER) $(OBJECTS_FI:%.o=%.lo) $(LIBGFORTHOBJS) -o $@
  204: 
  205: # executables generated by linking to library
  206: 
  207: libgforth%$(EXE):	libgforth%.la libmain.lo
  208: 	$(LTLD) $(LDFLAGS) $(patsubst lib%,-l%,$@) libmain.lo -o $@
  209: 
  210: libgforth$(EXE):	libgforth.la libmain.lo
  211: 	$(LTLD) $(LDFLAGS) $(patsubst lib%,-l%,$@) libmain.lo -o $@
  212: 
  213: engine.s:	$(ENGINE_FAST_DEPS)
  214: 		$(GCC) $(CFLAGS) $(CPPFLAGS) $(ENGINE_FLAGS) -S $(srcdir)/engine.c
  215: 
  216: engine$(OPT).o engine$(OPT).lo:	$(ENGINE_DEPS)
  217: 		$(COMPILER) $(ENGINE_FLAGS) -DGFORTH_DEBUGGING -o $@ $(srcdir)/engine.c
  218: 
  219: engine2$(OPT).o engine2$(OPT).lo:	$(ENGINE_DEPS)
  220: 		$(COMPILER) $(ENGINE_FLAGS) -DGFORTH_DEBUGGING -DENGINE=2 -o $@ $(srcdir)/engine.c
  221: 
  222: engine-native$(OPT).o engine-native$(OPT).lo:$(ENGINE_FAST_DEPS)
  223: 		$(COMPILER) $(ENGINE_FLAGS) -DNO_IP -o $@ $(srcdir)/engine.c
  224: 
  225: engine-native2$(OPT).o engine-native2$(OPT).lo:$(ENGINE_FAST_DEPS)
  226: 		$(COMPILER) $(ENGINE_FLAGS) -DNO_IP -DENGINE=2 -o $@ $(srcdir)/engine.c
  227: 
  228: engine-native3$(OPT).o engine-native3$(OPT).lo:$(ENGINE_FAST_DEPS)
  229: 		$(COMPILER) $(ENGINE_FLAGS) -DNO_IP -DENGINE=3 -o $@ $(srcdir)/engine.c
  230: 
  231: engine-fast$(OPT).o engine-fast$(OPT).lo:	$(ENGINE_FAST_DEPS)
  232: 		$(COMPILER) $(ENGINE_FLAGS) -o $@ $(srcdir)/engine.c
  233: 
  234: engine-fast2$(OPT).o engine-fast2$(OPT).lo:	$(ENGINE_FAST_DEPS)
  235: 		$(COMPILER) $(ENGINE_FLAGS) -DENGINE=2 -o $@ $(srcdir)/engine.c
  236: 
  237: engine-itc$(OPT).o engine-itc$(OPT).lo:	$(ENGINE_DEPS)
  238: 		$(COMPILER) $(ENGINE_FLAGS) -DINDIRECT_THREADED -DGFORTH_DEBUGGING -o $@ $(srcdir)/engine.c
  239: 
  240: engine-ditc$(OPT).o engine-ditc$(OPT).lo:	$(ENGINE_DEPS)
  241: 		$(COMPILER) $(ENGINE_FLAGS) -DDOUBLY_INDIRECT -o $@ $(srcdir)/engine.c
  242: 
  243: engine-prof$(OPT).o engine-prof$(OPT).lo:	$(ENGINE_DEPS)
  244: 		$(COMPILER) $(ENGINE_FLAGS) -DVM_PROFILING -o $@ $(srcdir)/engine.c
  245: 
  246: main$(OPT).o main$(OPT).lo:		$(MAIN_DEPS) 
  247: 		$(COMPILER) -DGFORTH_DEBUGGING @no_dynamic@ -o $@ $(srcdir)/main.c
  248: 
  249: main-native$(OPT).o main-native$(OPT).lo:	$(MAIN_FAST_DEPS) 
  250: 		$(COMPILER) -DNO_IP -o $@ $(srcdir)/main.c
  251: 
  252: main-fast$(OPT).o main-fast$(OPT).lo:	$(MAIN_FAST_DEPS) 
  253: 		$(COMPILER) -o $@ $(srcdir)/main.c
  254: 
  255: main-itc$(OPT).o main-itc$(OPT).lo:	$(MAIN_DEPS) 
  256: 		$(COMPILER) -DINDIRECT_THREADED -DGFORTH_DEBUGGING -o $@ $(srcdir)/main.c
  257: 
  258: main-ditc$(OPT).o main-ditc$(OPT).lo:	$(MAIN_DEPS)
  259: 		$(COMPILER) -DDOUBLY_INDIRECT -o $@ $(srcdir)/main.c
  260: 
  261: main-prof$(OPT).o main-prof$(OPT).lo:	$(MAIN_DEPS)
  262: 		$(COMPILER) -DVM_PROFILING -o $@ $(srcdir)/main.c
  263: 
  264: main-fi$(OPT).o main-fi$(OPT).lo:	$(MAIN_DEPS)
  265: 		$(COMPILER) -DINCLUDE_IMAGE -o $@ $(srcdir)/main.c
  266: 
  267: peephole$(OPT).o peephole$(OPT).lo:	peephole.c peephole.i $(DEPS)
  268: 		$(COMPILER) -o $@ $(srcdir)/peephole.c
  269: 
  270: profile$(OPT).o profile$(OPT).lo:	profile.c profile.i $(DEPS)
  271: 		$(COMPILER) -o $@ $(srcdir)/profile.c
  272: 
  273: #The next two rules seem to be superfluous:
  274: 
  275: # engine:		$(OBJECTS) $(OBJECTS0) ;
  276: 
  277: # engine_ditc:	$(OBJECTS_DITC) $(OBJECTS0) ;
  278: 
  279: #NeXTstep hack
  280: 
  281: termios.o:	/usr/lib/libposix.a
  282: 	ar x /usr/lib/libposix.a termios.o
  283: 
  284: config.h:	stamp-h
  285: stamp-h:	config.h.in ../config.status ../stamp-h.in
  286: 		cd .. && CONFIG_FILES=$@ CONFIG_HEADERS=engine/config.h ./config.status
  287: 		echo timestamp > stamp-h
  288: 
  289: Makefile: Makefile.in ../config.status ../configure.in
  290: 	cd .. && $(MAKE) engine/Makefile.in
  291: 
  292: image.i:	../fi2c.fs ../$(include_fi)
  293: 		$(BOOTFORTH) ../fi2c.fs -e "s\" ../$(include_fi)\" fi2c bye" >$@
  294: 
  295: ../$(include_fi):	FORCE
  296: 		cd .. && $(MAKE) $(include_fi)
  297: 
  298: #phony targets depend on FORCE; this is more portable than .PHONY
  299: FORCE:
  300: 

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