Jamfile #14

  • //
  • guest/
  • craig_mcpheeters/
  • jam/
  • src/
  • Jamfile
  • View
  • Commits
  • Open Download .zip Download (5 KB)
#
# Jamfile to build Jam (a make(1)-like program)
#
# There are no user-serviceable parts in this file.
#
# Put executables in platform-specific  subdirectory.

if $(VMS) 	{ LOCATE_TARGET ?= [.binvms] ; }
else if $(MAC) 	{ LOCATE_TARGET ?= :bin.mac ; }
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.
#

if $(NT) 	{ code = execunix.c filent.c pathunix.c ; } 
else if $(MINGW) { code = execunix.c filent.c pathunix.c ; } 
else if $(OS2)	{ code = execunix.c fileos2.c pathunix.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 ; }

# For jam profiling/debugging.

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

if $(DEBUG)
{
	LOCATE_TARGET = $(LOCATE_TARGET)/g ;
}

# We have to signal jam.h for these

if $(OS) = NT 			{ CCFLAGS += /DNT ; }

# CWM
if $(OS) = IRIX
{
    # Ensure it runs on mips3 & mips4
    CCFLAGS += -n32 -mips3 ;
    LINKFLAGS += -n32 -mips3 ;
}
if $(UNIX) 
{
   if $(DEBUG)        
   {
       CCFLAGS += -g ;
       LINKFLAGS += -g ;
   }
   else {
       CCFLAGS += -O2 ;
   }
}
else if $(NT) 
{
   if $(DEBUG)
   { 
       CCFLAGS += /Z7 /MDd ;
       LINKFLAGS += /NODEFAULTLIB:MSVCRT.lib /DEBUG /PDB:NONE
                    /libpath:\"$(MSVCNT)\\lib\" ;
                    LINKLIBS = $(MSVCNT)\\lib\\advapi32.lib
                    $(MSVCNT)\\lib\\oldnames.lib
                    $(MSVCNT)\\lib\\kernel32.lib ;
   }
   else { 
       CCFLAGS += /O2 ; 
   }

   # Ensure there is a large stack - CWM.
   LINKFLAGS += /STACK:0x400000 ;
}
else if $(OS) = MACOSX
{
    # Ensure there is a large stack - CWM.
    LINKFLAGS += -Wl,-stack_size -Wl,0x800000 ;
}

# 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 ;
}

# CWM.
# Determine what configurations are enabled
include Jamfile.config ;

if $(HeaderCache)
{
    # If the header cache extension is turned on, then set the cache
    # variable to use it.  Although Jam is small and doesn't need the
    # cache, this helps test the feature
    HCACHEFILE = .jamhcache ;
}

#
# How to build the compiled in jambase.
#

Main		mkjambase : mkjambase.c ;

if $(VMS)
{
	CC = cxx ;
	LINK = cxxlink ;
	DEFINES += 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 ;

Library         libjam.a :
		    builtins.c command.c compile.c $(code) expand.c
		    glob.c hash.c headers.c hcache.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 
            w32_getreg.c ;


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

#
# Distribution making from here on out.
#

ALLSOURCE =
	Build.com Build.mpw Jam.html Jambase Jambase.html Jamfile
	Jamfile.config
	Jamfile.html Makefile Porting README RELNOTES builtins.c builtins.h
	command.c command.h compile.c compile.h execcmd.h execmac.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
	headers.c headers.h jam.c jam.h	hcache.c hcache.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 
    w32_getreg.h w32_getreg.c 
    ;

rule Ball
{
	NotFile balls ;
	Depends balls : $(<) ;

	DEPENDS $(<) : $(>) ;

	switch $(<) 
	{
	case *.tar : Tar $(<) : $(>) ;
	case *.shar : Shar $(<) : $(>) ;
	case *.zip : Zip $(<) : $(>) ;
	}
}

VERSION = jam-2.5rc1 ;

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

actions Shar
{
	shar $(>) > $(<)
}

actions Zip
{
	zip $(<) $(>) 
}

Ball $(VERSION).shar : $(ALLSOURCE) ;
Ball $(VERSION).tar : $(ALLSOURCE) ;
Ball $(VERSION).zip : $(ALLSOURCE) ;
# Change User Description Committed
#14 3360 Craig Mcpheeters Made a few improvements suggested by Johan Nilsson.
#13 3184 Craig Mcpheeters Integration of my recent work jam changes into my public mainline branch
#12 3181 Craig Mcpheeters Integration of the Jam mainline into my branch
#11 1662 Craig Mcpheeters Integration of 2.4 final from the jam mainline
#10 1630 Craig Mcpheeters Integration from the mainline of jam rc2
#9 1604 Craig Mcpheeters Integration of rc1 from the mainline
#8 1471 Craig Mcpheeters Incorporation of two extensions from Matt Armstrong.
 W32_GETREG and
  the printing of the total time.  See the comments in Jamfile.config.
#7 1371 Craig Mcpheeters Integration from the jam mainline.
 Note, many of these are empty
  integrations, but I wanted to not leave any pending integrations
  into my branch.
#6 1353 Craig Mcpheeters Integration from the mainline.
#5 1251 Craig Mcpheeters This return integrates a modified version of Matt Armstrong's
  extension to my header cache code.  Matt documented his extensions
  in the file README.header_scan_cache, read that file for details.
  The modifications to his extensions are recorded in the integration
  history of this return.  My modifications retain all of the new
  properties Matt added in his extension, but it is implemented in
  a slightly different way.  He has reviewed my changes to his changes
  and approves of them
#4 1023 Craig Mcpheeters Integration from //guest/craig_mcpheeters/work/jam/src/...
This return incorporates all of the Alias|Wavefront extensions to
  Jam, into an area which is a proper branch of the Jam mainline.
  An integration of these files into the Jam mainline will show all
  of the differences.
There are several extensions to Jam in this return.  Look at the
  new file Jamfile.config for an explanation of the extensions, and
  how to compile them into your own copy of Jam.  If you want to
  build a copy of Jam with all of the extensions, do this:
    jam -sAllOptions=1
  Read the config file for more info.
The extensions range from minor output tweaks and simple fixes to
  more major things like a header cache, serialization of output from
  multiple jobs, dynamic command block sizing
These are all offered without warranty, etc.
#3 784 Craig Mcpheeters Integration from Jam mainline
#2 617 Craig Mcpheeters Integration from mainline as of @3
#1 616 Craig Mcpheeters Integration from Jam mainline, as of @2