File: Jamfile

package info (click to toggle)
ftjam 2.5.2-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,216 kB
  • ctags: 1,237
  • sloc: ansic: 7,226; sh: 2,751; yacc: 443; makefile: 121
file content (309 lines) | stat: -rwxr-xr-x 6,032 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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
#
# Jamfile to build Jam (a make(1)-like program)
#
# There are no user-serviceable parts in this file.
#
# Put executables in platform-specific  subdirectory.

include Jamrules ;

# note that we use the target directory 'bin.unix' to ensure that
# 'make install' and 'make uninstall' work correctly
#
if $(VMS) 	{ LOCATE_TARGET ?= [.binvms] ; }
else if $(MAC) 	{ LOCATE_TARGET ?= :bin.mac ; }
else if $(UNIX) { LOCATE_TARGET ?= bin.unix ; }
else		{ LOCATE_TARGET ?= bin.$(OSFULL[1]:L) ; }

# Leave generated source in current directory; it would be nice to use
# these lines below to build the source into the platform-specific
# directory, but getting scan.c to include the right jambase.h is
# hard: with ""'s, it always gets the bootstrap version; with <>'s,
# it won't find the bootstrap version.

# SEARCH_SOURCE ?= $(LOCATE_TARGET) $(DOT) ;
# LOCATE_SOURCE ?= $(LOCATE_TARGET) ;

#
# We have some different files for UNIX, VMS, and NT.
#

#
# For some really stupid reason, classic Jam doesn't define NT
# when compiling with Mingw, but the variable MINGW instead..
#

if ! $(NT) && $(MINGW)
{
  NT = 1 ;
  JAM_TOOLSET = MINGW ;
}

if $(NT) 	{ code = execunix.c filent.c pathunix.c ; }
else if $(OS2)
{
  # special case for OS/2: when compiling with GCC/EMX, we use
  # "fileunix.c" instead of "fileos2.c"
  code = execunix.c pathunix.c ;
  if $(JAM_TOOLSET) = EMX
  {
    CCFLAGS += -D__OS2__ ;
    code += fileunix.c ;
  }
  else
  {
    code += fileos2.c ;
  }
}
else if $(VMS) 	{ code = execvms.c filevms.c pathvms.c ; }
else if $(MAC)	{ code = execmac.c filemac.c pathmac.c ; }
else 		{ code = execunix.c fileunix.c pathunix.c ; }

if $(UNIX) && $(OS) = CYGWIN
{
  CCFLAGS += -D__cygwin__ ;
}

# For jam profiling/debugging.

if $(PROFILE)
{
	CCFLAGS += -pg ;
	LINKFLAGS += -pg ;
	LOCATE_TARGET = $(LOCATE_TARGET)/pg ;
}

if $(DEBUG)
{
	CCFLAGS += -g ;
	LINKFLAGS += -g ;
	LOCATE_TARGET = $(LOCATE_TARGET)/g ;
}

# We have to signal jam.h for these

if $(OS) = NT
{
  switch $(JAM_TOOLSET)
  {
    case MINGW       : CCFLAGS += -DNT ;
    case LCC         : CCFLAGS += -DNT ;
    case DIGITALMARS : CCFLAGS += -DNT ;
    case *           : CCFLAGS += /DNT ;
  }
}

# Do we know yacc?

if $(YACC) 	{ code += jamgram.y ; }
else            { code += jamgram.c ; }

#
# Build the jamgram.y from the jamgram.yy
# yyacc is a slippery script that makes grammars a little
# easier to read/maintain.
#

if $(YACC) && $(SUFEXE) = ""
{
	GenFile jamgram.y jamgramtab.h : ./yyacc jamgram.yy ;
}

#
# How to build the compiled in jambase.
#

Main		mkjambase : mkjambase.c ;

if $(VMS)
{
	CC = cxx ;
	LINK = cxxlink ;
	CCFLAGS += /define=VMS ;
}

#
# The guts of the Jamfile: how to build Jam
#

Main            jam : jam.c jambase.c ;
LinkLibraries 	jam : libjam.a ;
GenFile 	    jambase.c : mkjambase Jambase ;

if $(UNIX)
{
  actions Strip
  {
    strip $(1)
  }

  Strip jam ;
}

Library         libjam.a :
		    builtins.c command.c compile.c $(code) expand.c
		    glob.c hash.c headers.c lists.c make.c make1.c
		    newstr.c option.c parse.c regexp.c rules.c scan.c
		    search.c timestamp.c variable.c
		    hdrmacro.c
		    ;

# Strip the Jam executable on Mingw
#
if $(JAM_TOOLSET) = MINGW
{
  actions  Strip
  {
    strip $(1)
  }

  Strip  jam$(SUFEXE) ;
}


if $(BINDIR) 	{ InstallBin $(BINDIR) : jam ; }

#
# Distribution making from here on out.
#

ALLSOURCE =
	Build.com Build.mpw Jam.html Jambase Jambase.html Jamfile
	Jamfile.html Porting README RELNOTES builtins.c builtins.h
	command.c command.h compile.c compile.h execcmd.h execmac.c
	execnt.c execunix.c execvms.c expand.c expand.h filemac.c filent.c
	fileos2.c filesys.h fileunix.c filevms.c glob.c hash.c hash.h
	hdrmacro.c hdrmacro.h headers.c headers.h jam.c jam.h jambase.c
	jambase.h jamgram.c jamgram.h jamgram.y jamgram.yy jamgramtab.h
	lists.c lists.h make.c make.h make1.c mkjambase.c newstr.c newstr.h
	option.c option.h parse.c parse.h patchlevel.h pathmac.c pathsys.h
	pathunix.c pathvms.c regexp.c regexp.h rules.c rules.h scan.c
	scan.h search.c search.h timestamp.c timestamp.h variable.c
	variable.h yyacc
	hdrmacro.c
	INSTALL
	README.ORG
	CHANGES
	common.mk
	[ GLOB builds : *.mk ]
	[ GLOB builds/unix : *.in ]
	builds/unix/configure
	builds/unix/configure.ac
	builds/unix/config.sub
	builds/unix/config.guess
	builds/unix/install-sh
	builds/unix/mkinstalldirs
	configure
	;


rule Binary
{
    NotFile  package ;
    Depends  package : $(<) ;

    DEPENDS $(<) : $(>) ;

    switch $(<)
    {
    case *-win32.zip       : Zip-Exe  $(<) : $(>) ;
    case *-os2.zip         : Zip-Exe  $(<) : $(>) ;
    case *-linux-libc6.tar : GZip-Exe $(<) : $(>) ;
    }
}


rule Package
{
	NotFile package ;
	Depends package : $(<) ;

	DEPENDS $(<) : $(>) ;

	switch $(<)
	{
	case *.tar  : { Tar-Gz  $(<) : $(>) ; Tar-Bz2 $(<) : $(>) ; }
	case *.zip  :   Zip     $(<) : $(>) ;
	}
}


VERSION = ftjam-2.5.2 ;

actions Tar-Gz
{
  ln -s . $(VERSION)
  tar cvhf $(<) $(VERSION)/$(>)
  rm -f $(VERSION)
  gzip -9f $(<)
}

actions Tar-Bz2
{
  ln -s . $(VERSION)
  tar cvhf $(<) $(VERSION)/$(>)
  bzip2 -9f $(<)
  rm -f $(<)
}


if $(UNIX)
{
  actions Zip
  {
    rm -f $(<)
    ln -s . $(VERSION)
    zip -9rl $(<) $(VERSION)/$(>)
    rm -f $(VERSION)
  }
}
else
{
  actions Zip
  {
    $(RMF) $(<)
    zip -9rl $(<) $(>)
  }
}


actions Zip-Exe
{
  zip -9j $(<) $(LOCATE_TARGET)\jam.exe
}

actions GZip-Exe
{
  ln -s $(LOCATE_TARGET)/jam jam
  tar chf $(<) jam
  rm -f jam
  gzip -9f $(<)
}



if $(NT)
{
  Binary  $(VERSION)-win32.zip : $(ALLSOURCE) ;
  Package $(VERSION).zip       : $(ALLSOURCE) ;
}
else if $(OS2)
{
  Binary  $(VERSION)-os2.zip : $(ALLSOURCE) ;
  Package $(VERSION).zip     : $(ALLSOURCE) ;
}
else if $(UNIX)
{
  # how can we detect the C library version reliably ??
  # for now, this should only be used for convenience
  # purposes, until we add .rpm and .deb support in..
  #
  if $(OS) = LINUX
  {
    Binary $(VERSION)-linux-libc6.tar : jam ;
  }

  Package $(VERSION).tar : $(ALLSOURCE) ;
  Package $(VERSION).zip : $(ALLSOURCE) ;
}