1: #Makefile for the C part of Gforth
2:
3: #Copyright (C) 1995-1997 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., 675 Mass Ave, Cambridge, MA 02139, USA.
20:
21: # ------------- gforth version
22:
23: VERSION =@VERSION@
24: DOSVERSION=`echo $VERSION|sed 's/\.//g'`
25:
26: # ------------- System specific variables
27:
28: machine=@machine@
29: # this is the type of machine
30: # used to extend the include path with ./arch/$machine
31: # so we could include a machine specific
32: # machine.h file
33:
34: PATHSEP = @PATHSEP@
35:
36: osclass = @OSCLASS@
37:
38: # ------------- Utility programs
39:
40: SHELL = /bin/sh
41: RM = rm
42: RMTREE = rm -rf
43: CP = cp
44: TAR = tar cf -
45: GCC = @CC@
46: CC = $(GCC)
47: STRIP = strip
48:
49: FORTHPATH = .$(PATHSEP)$(libdir)/gforth/site-forth$(PATHSEP)$(datadir)/gforth/site-forth$(PATHSEP)$(libdir)/gforth/$(VERSION)$(PATHSEP)$(datadir)/gforth/$(VERSION)
50:
51: # ------------ Install Directorys
52:
53: VPATH = @srcdir@
54: prefix = @prefix@
55: exec_prefix = @exec_prefix@
56: srcdir = @srcdir@
57: bindir = $(exec_prefix)/bin
58: #read-only architecture-independent files
59: datadir = $(prefix)/share
60: #read-only architecture-dependent non-ascii files
61: libdir = $(prefix)/lib
62: infodir = $(prefix)/info
63: mandir = $(prefix)/man
64: man1dir= $(mandir)/man1
65: man1ext= .1
66:
67: # ------------- Compiler Flags
68:
69: XCFLAGS = @CFLAGS@
70: XDEFINES = @DEFS@
71: SWITCHES = $(XCFLAGS) $(XDEFINES)
72: ENGINE_FLAGS = @ENGINE_FLAGS@ -fno-defer-pop -fcaller-saves
73: DEBUGFLAG = @DEBUGFLAG@
74: CFLAGS = $(DEBUGFLAG) -I$(srcdir)/../arch/$(machine) -O4 -Wall $(SWITCHES) -DDEFAULTPATH=\"$(FORTHPATH)\"
75:
76: #John Wavrik should use -Xlinker -N to get a writable text (executable)
77: XLDFLAGS = @LDFLAGS@
78: LDFLAGS = $(DEBUGFLAG) $(XLDFLAGS)
79: LDLIBS = @LIBS@
80:
81: AOBJECTS = io.o memcmpc.o @LIBOBJS@
82:
83: OBJECTS = engine.o main.o
84: OBJECTS_DITC = engine-ditc.o main-ditc.o
85:
86: # In engine subdirectory there are (or should be) only files that belong to
87: # our engine, so we can make life easy
88: DEPS = config.h *.h ../arch/$(machine)/*.[h]
89: ENGINE_DEPS = engine.c $(DEPS) prim_lab.i prim.i
90:
91: gforth: $(OBJECTS) $(AOBJECTS)
92: $(GCC) $(LDFLAGS) $(OBJECTS) $(AOBJECTS) $(LDLIBS) -o $@
93:
94: gforth-ditc: $(OBJECTS_DITC) $(AOBJECTS)
95: $(GCC) $(LDFLAGS) $(OBJECTS_DITC) $(AOBJECTS) $(LDLIBS) -o $@
96:
97: engine.s: $(ENGINE_DEPS)
98: $(GCC) $(CFLAGS) $(ENGINE_FLAGS) -S engine.c
99:
100: engine.o: $(ENGINE_DEPS)
101: $(GCC) $(CFLAGS) $(ENGINE_FLAGS) -c engine.c -o $@
102:
103: engine-ditc.o: $(ENGINE_DEPS)
104: $(GCC) $(CFLAGS) $(ENGINE_FLAGS) -DDOUBLY_INDIRECT -o $@ -c engine.c
105:
106: main.o: main.c $(DEPS)
107: $(GCC) $(CFLAGS) $(ENGINE_FLAGS) -o $@ -c main.c
108:
109: main-ditc.o: main.c $(DEPS)
110: $(GCC) $(CFLAGS) $(ENGINE_FLAGS) -DDOUBLY_INDIRECT -o $@ -c main.c
111:
112: engine: $(OBJECTS) $(OBJECTS0) ;
113:
114: engine_ditc: $(OBJECTS_DITC) $(OBJECTS0) ;
115:
116: #NeXTstep hack
117:
118: termios.o: /usr/lib/libposix.a
119: ar x /usr/lib/libposix.a termios.o
120:
121: prim.i: FORCE
122: cd ..; $(MAKE) engine/$@
123:
124: prim_lab.i: FORCE
125: cd ..; $(MAKE) engine/$@
126:
127: config.h: FORCE
128: cd .. && $(MAKE) engine/$@
129:
130: #phony targets depend on FORCE; this is more portable than .PHONY
131: FORCE:
132:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>