File: makefile.dos

package info (click to toggle)
gforth 0.7.0+ds2-0.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 5,808 kB
  • sloc: ansic: 8,506; sh: 3,660; lisp: 1,783; makefile: 993; yacc: 186; sed: 141; lex: 102; awk: 21
file content (268 lines) | stat: -rw-r--r-- 8,915 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
#Makefile for the C part of Gforth

#Copyright (C) 1995,1996,1997,1998,2000,2003,2006,2007,2008 Free Software Foundation, Inc.

#This file is part of Gforth.

#Gforth is free software; you can redistribute it and/or
#modify it under the terms of the GNU General Public License
#as published by the Free Software Foundation, either version 3
#of the License, or (at your option) any later version.

#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.#See the
#GNU General Public License for more details.

#You should have received a copy of the GNU General Public License
#along with this program. If not, see http://www.gnu.org/licenses/.

# ------------- gforth version

VERSION =0.5.9
DOSVERSION=`echo $VERSION|sed 's/\.//g'`
EXE=.exe

# ------------- System specific variables

machine=386
kernel_fi = kernl32l.fi
include_fi = @include_fi@
# this is the type of machine
# used to extend the include path with ./arch/$machine
# so we could include a machine specific
# machine.h file

PATHSEP = ;

osclass = dos

EC = @EC@

# ------------- Utility programs

# SHELL	= /bin/sh
RM	= del
RMTREE	= deltree
CP	= copy
TAR	= tar cf -
GCC	= gcc
BOOTFORTH	= ../preforth
CC	= $(GCC)
LD	= $(GCC:gcc=ld)
AS	= $(GCC:gcc=as)
STRIP	= strip
GCCLD	= @GCC_LD@

FORTHPATH = .$(PATHSEP)$(libdir)/gforth/site-forth$(PATHSEP)$(datadir)/gforth/site-forth$(PATHSEP)$(libdir)/gforth/$(VERSION)$(PATHSEP)$(datadir)/gforth/$(VERSION)

# ------------  Source and Build directories

top_srcdir = @top_srcdir@
top_builddir = @top_builddir@

# ------------	Install directories

VPATH = .
prefix = 
exec_prefix = 
srcdir = .
bindir = 
#read-only architecture-independent files
datadir = $(prefix)/share
#read-only architecture-dependent non-ascii files
libdir = $(prefix)/lib
infodir = $(prefix)/info
mandir = $(prefix)/man
man1dir= $(mandir)/man1
man1ext= .1

# ------------- ltdl variables

LTDLDEPS = @LTDLDEPS@
LTDLINCL = @LTDLINCL@
LIBLTDL  = @LIBLTDL@

# ------------- Compiler Flags

XCFLAGS	= -fomit-frame-pointer
XDEFINES = 
SWITCHES = $(XCFLAGS) $(XDEFINES) $(OPTDEFINES)
#use -fno-inline to avoid register problems with asinh, atanh on gcc-3.3 on 386
ENGINE_FLAGS =  -fno-defer-pop -fcaller-saves -fno-inline
DEBUGFLAG = 
CFLAGS	= $(DEBUGFLAG) -I$(srcdir)/../arch/$(machine) -I. -Wall $(SWITCHES) -DDEFAULTPATH='"$(FORTHPATH)"' $(LTDLINCL)
CFLAGS2	= $(DEBUGFLAG) -I$(srcdir)/../arch/$(machine) -I. -Wall $(SWITCHES) -DDEFAULTPATH='"$(FORTHPATH)"' $(LTDLINCL)
CPPFLAGS=@CPPFLAGS@
FORTHKFLAGS= -s -p "..$(PATHSEP)$(srcdir)" -i ../$(kernel_fi)
FORTHK	= ../gforth $(FORTHKFLAGS)
FORTH	= $(BOOTFORTH) -s

#John Wavrik should use -Xlinker -N to get a writable text (executable)
XLDFLAGS = 
LDFLAGS =  $(DEBUGFLAG) $(XLDFLAGS)
LDLIBS  = -lm -lpc @LTDL_LDLIBS@

AOBJECTS = @signals_o@ support$(OPT).o ecvt.o io.o strsig.o getopt.o getopt1.o select.o $(OPTOBJECTS)

@MAKEINC@

OBJECTS = engine$(OPT).o @engine2@ main$(OPT).o
OBJECTS_NATIVE = engine-native$(OPT).o engine-native2$(OPT).o engine-native3$(OPT).o main-native$(OPT).o
OBJECTS_FAST = engine-f$(OPT).o @engine_fast2@ main-f$(OPT).o
OBJECTS_ITC = engine-itc$(OPT).o main-itc$(OPT).o
OBJECTS_DITC = engine-d$(OPT).o main-d$(OPT).o
OBJECTS_PROF = engine-prof$(OPT).o main-prof$(OPT).o
OBJECTS_FI =  engine$(OPT).o main-fi$(OPT).o

# In engine subdirectory there are (or should be) only files that belong to
# our engine, so we can make life easy
DEPS =  config.h forth.h io.h $(srcdir)/../arch/$(machine)/*.[h]
ENGINE_DEPS = engine.c $(DEPS) prim_lab.i prim.i @image_i@ fnmatch.h threaded.h
MAIN_DEPS = main.c $(DEPS) prim_superend.i prim_num.i prim_grp.i costs.i super2.i
ENGINE_FAST_DEPS = engine.c $(DEPS) prim_lab-fast.i prim-fast.i fnmatch.h threaded.h
MAIN_FAST_DEPS = main.c $(DEPS) prim_superend-fast.i prim_num-fast.i prim_grp-fast.i costs-fast.i super2-fast.i

#some makes don't do the -o $@ correctly, so we help them
.c.o:
	$(GCC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<

.s.o:
	$(GCC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<

support$(OPT).o: support.c config.h forth.h longlong.h
	$(GCC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $(srcdir)/support.c

strtol.o: strtol.c ansidecl.h

fnmatch.o: fnmatch.c fnmatch.h

getopt1.o: getopt1.c getopt.h

getopt.o: getopt.c getopt.h

gforth$(OPT)$(EC)$(EXE):	$(OBJECTS) $(AOBJECTS) $(LTDLDEPS)
	$(GCCLD) $(LDFLAGS) $(OBJECTS) $(AOBJECTS) $(LDLIBS) -o $@

gforth-native$(OPT)$(EC)$(EXE):	$(OBJECTS_NATIVE) $(AOBJECTS) $(LTDLDEPS)
	$(GCCLD) $(LDFLAGS) $(OBJECTS_NATIVE) $(AOBJECTS) $(LDLIBS) -o $@

gforth-f$(OPT)$(EC)$(EXE):	$(OBJECTS_FAST) $(AOBJECTS) $(LTDLDEPS)
	$(GCCLD) $(LDFLAGS) $(OBJECTS_FAST) $(AOBJECTS) $(LDLIBS) -o $@

gforth-itc$(OPT)$(EC)$(EXE):	$(OBJECTS_ITC) $(AOBJECTS) $(LTDLDEPS)
	$(GCCLD) $(LDFLAGS) $(OBJECTS_ITC) $(AOBJECTS) $(LDLIBS) -o $@

gforth-d$(OPT)$(EC)$(EXE): $(OBJECTS_DITC) $(AOBJECTS) $(LTDLDEPS)
	$(GCCLD) $(LDFLAGS) $(OBJECTS_DITC) $(AOBJECTS) $(LDLIBS) -o $@

gforth-prof$(OPT)$(EC)$(EXE): $(OBJECTS_PROF) $(AOBJECTS) $(LTDLDEPS) profile$(OPT).o
	$(GCCLD) $(LDFLAGS) $(OBJECTS_PROF) $(AOBJECTS) profile$(OPT).o $(LDLIBS) -o $@

gforth-fi$(OPT)$(EC)$(EXE):	$(OBJECTS_FI) $(AOBJECTS) $(LTDLDEPS)
	$(GCCLD) $(LDFLAGS) $(OBJECTS_FI) $(AOBJECTS) $(LDLIBS) -o $@

engine.s:	$(ENGINE_FAST_DEPS)
		$(GCC) $(CFLAGS2) $(CPPFLAGS) $(ENGINE_FLAGS) -S $(srcdir)/engine.c

engine$(OPT).o:	$(ENGINE_DEPS)
		$(GCC) $(CFLAGS2) $(CPPFLAGS) $(ENGINE_FLAGS) -DGFORTH_DEBUGGING -o $@ -c $(srcdir)/engine.c

engine2$(OPT).o:	$(ENGINE_DEPS)
		$(GCC) $(CFLAGS2) $(CPPFLAGS) $(ENGINE_FLAGS) -DGFORTH_DEBUGGING -DENGINE=2 -o $@ -c $(srcdir)/engine.c

engine-native$(OPT).o:$(ENGINE_FAST_DEPS)
		$(GCC) $(CFLAGS2) $(CPPFLAGS) $(ENGINE_FLAGS) -DNO_IP -o $@ -c $(srcdir)/engine.c

engine-native2$(OPT).o:$(ENGINE_FAST_DEPS)
		$(GCC) $(CFLAGS2) $(CPPFLAGS) $(ENGINE_FLAGS) -DNO_IP -DENGINE=2 -o $@ -c $(srcdir)/engine.c

engine-native3$(OPT).o:$(ENGINE_FAST_DEPS)
		$(GCC) $(CFLAGS2) $(CPPFLAGS) $(ENGINE_FLAGS) -DNO_IP -DENGINE=3 -o $@ -c $(srcdir)/engine.c

engine-f$(OPT).o:	$(ENGINE_FAST_DEPS)
		$(GCC) $(CFLAGS2) $(CPPFLAGS) $(ENGINE_FLAGS) -o $@ -c $(srcdir)/engine.c

engine-f2$(OPT).o:	$(ENGINE_FAST_DEPS)
		$(GCC) $(CFLAGS2) $(CPPFLAGS) $(ENGINE_FLAGS) -DENGINE=2 -o $@ -c $(srcdir)/engine.c

engine-itc$(OPT).o:	$(ENGINE_DEPS)
		$(GCC) $(CFLAGS2) $(CPPFLAGS) $(ENGINE_FLAGS) -DINDIRECT_THREADED -DGFORTH_DEBUGGING -o $@ -c $(srcdir)/engine.c

engine-d$(OPT).o:	$(ENGINE_DEPS)
		$(GCC) $(CFLAGS2) $(CPPFLAGS) $(ENGINE_FLAGS) -DDOUBLY_INDIRECT -o $@ -c $(srcdir)/engine.c

engine-prof$(OPT).o:	$(ENGINE_DEPS)
		$(GCC) $(CFLAGS2) $(CPPFLAGS) $(ENGINE_FLAGS) -DVM_PROFILING -o $@ -c $(srcdir)/engine.c

main$(OPT).o:		$(MAIN_DEPS) 
		$(GCC) $(CFLAGS) $(CPPFLAGS) -DGFORTH_DEBUGGING @no_dynamic@ -o $@ -c $(srcdir)/main.c

main-native$(OPT).o:	$(MAIN_FAST_DEPS) 
		$(GCC) $(CFLAGS) $(CPPFLAGS) -DNO_IP -o $@ -c $(srcdir)/main.c

main-f$(OPT).o:	$(MAIN_FAST_DEPS) 
		$(GCC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $(srcdir)/main.c

main-itc$(OPT).o:	$(MAIN_DEPS) 
		$(GCC) $(CFLAGS) $(CPPFLAGS) -DINDIRECT_THREADED -DGFORTH_DEBUGGING -o $@ -c $(srcdir)/main.c

main-d$(OPT).o:	$(MAIN_DEPS)
		$(GCC) $(CFLAGS) $(CPPFLAGS) -DDOUBLY_INDIRECT -o $@ -c $(srcdir)/main.c

main-prof$(OPT).o:	$(MAIN_DEPS)
		$(GCC) $(CFLAGS) $(CPPFLAGS) -DVM_PROFILING -o $@ -c $(srcdir)/main.c

main-fi$(OPT).o:	$(MAIN_DEPS)
		$(GCC) $(CFLAGS) $(CPPFLAGS) -DINCLUDE_IMAGE -o $@ -c $(srcdir)/main.c

peephole$(OPT).o:	peephole.c peephole.i $(DEPS)
		$(GCC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $(srcdir)/peephole.c

profile$(OPT).o:	profile.c profile.i $(DEPS)
		$(GCC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $(srcdir)/profile.c

#The next two rules seem to be superfluous:

# engine:		$(OBJECTS) $(OBJECTS0) ;

# engine_ditc:	$(OBJECTS_DITC) $(OBJECTS0) ;

#NeXTstep hack

termios.o:	/usr/lib/libposix.a
	ar x /usr/lib/libposix.a termios.o

#duplicated rules to avoid too many recursive make invocations
# !! No any forth stuff should be done in ../Makefile.
# !! I added the dependencies on prim.i and prim_lab.i in the main Makefile, jens

#I commented out the following rules because they are no longer up-to-date. - anton

#prim.i:		../prim.b ../prims2x.fs
#		$(FORTHK) prims2x.fs -e "s\" ../prim.b\" ' output-c process-file bye" >$@-
#		$(CP) $@- $@
#		$(RM) $@-
#
#prim_lab.i:	../prim.b ../prims2x.fs
#		$(FORTHK) prims2x.fs -e "s\" ../prim.b\" ' output-label process-file bye" >$@-
#		$(CP) $@- $@
#		$(RM) $@-

config.h:	stamp-h
stamp-h:	 ../stamp-h.in
		echo I hope you configured your system
		echo timestamp > stamp-h

Makefile: Makefile.in ../config.status ../configure.in
	cd .. && $(MAKE) engine/Makefile.in

image.i:	../fi2c.fs ../$(include_fi)
		$(BOOTFORTH) ../fi2c.fs -e "s\" ../$(include_fi)\" fi2c bye" >$@

../$(include_fi):	FORCE
		cd .. && $(MAKE) $(include_fi)

#phony targets depend on FORCE; this is more portable than .PHONY
FORCE: