buildtools/jam/Jamfile
Ingo Weinhold ecc89c9a6a Moved jam into the buildtools modules, where it belongs.
git-svn-id: file:///srv/svn/repos/haiku/buildtools/trunk@15729 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-29 18:40:48 +00:00

286 lines
6.1 KiB
Plaintext

#
# 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)
{
CCFLAGS += -pg ;
LINKFLAGS += -pg ;
LOCATE_TARGET = $(LOCATE_TARGET)/pg ;
}
if $(DEBUG)
{
CCFLAGS += -g ;
C++FLAGS += -g ;
LINKFLAGS += -g ;
LOCATE_TARGET = $(LOCATE_TARGET)/g ;
}
# We have to signal jam.h for these
if $(OS) = NT { CCFLAGS += /DNT ; }
### LOCAL CHANGE
#
# Include header caching.
#
DEFINES += OPT_HEADER_CACHE_EXT ;
DEFINES += OPT_JAMFILE_CACHE_EXT ;
#
### LOCAL CHANGE
### LOCAL CHANGE
#
# Include rule profiling support, if specified in the environment.
#
if $(OPT_RULE_PROFILING_EXT) {
DEFINES += OPT_RULE_PROFILING_EXT ;
}
#
### LOCAL CHANGE
### LOCAL CHANGE
#
# Include stat cache server under BeOS.
#
if $(OS) = BEOS {
DEFINES += OPT_STAT_CACHE_SERVER_EXT ;
}
#
### LOCAL CHANGE
# 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 ;
}
### LOCAL CHANGE
#
# These files contain locally developed improvements.
#
code += jcache.c ;
# code primarily not written locally, but grabbed from the net
code += hcache.c ;
#
### LOCAL CHANGE
### LOCAL CHANGE
#
# Include stat cache server under BeOS.
#
if $(OS) = BEOS {
code += beos_stat_cache.c ;
}
#
### LOCAL CHANGE
#
# How to build the compiled in jambase.
#
Main mkjambase : mkjambase.c ;
if $(VMS)
{
CC = cxx ;
LINK = cxxlink ;
CCFLAGS += /define=VMS ;
}
if $(OS) = BEOS {
DEFINES += _ZETA_USING_DEPRECATED_API_=1 ;
}
#
# 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 $(OS) = BEOS {
LINKLIBS on jam += -lnet ;
}
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 ;
if $(BINDIR) { InstallBin $(BINDIR) : jam ; }
### LOCAL CHANGE
#
# Build stat cache server under BeOS.
#
if $(OS) = BEOS {
rule CompileResources
{
SEARCH on $(2) += $(SEARCH_SOURCE) ;
MakeLocate $(1) : $(LOCATE_TARGET) ;
Depends $(1) : $(2) ;
LocalClean clean : $(1) ;
}
# rc must exist, if we are to compile the resources. We hard-code the
# path where it should be located. Not nice, but good enough for the moment.
actions CompileResources
{
RC=
for arch in x86 ppc
do
for plat in r5 bone dano haiku
do
for version in release debug_1 debug_2
do
PATH=../../../generated/objects/${plat}/${arch}/${version}/tools/rc/rc
if [ -f $PATH ]
then
RC=$PATH
break 3
fi
done
done
done
if [ -f $RC ]; then
$RC -o "$(1)" "$(2)"
else
echo "Error: Couldn't find rc, the resources compiler. It should "
echo "Error: be located in objects/<arch>.<version>.<plat>/tools/rc/ and can be made"
echo "Error: by invoking \`jam rc'. You can also build the"
echo "Error: StatCacheServer without resources by running"
echo "Error: NO_STAT_CACHE_SERVER_RESOURCES=1 jam"
exit 1;
fi
}
rule AddResources
{
SEARCH on $(2) += $(SEARCH_SOURCE) ;
Depends $(1) : $(2) ;
}
actions AddResources
{
xres -o "$(1)" $(2)
}
LINK on StatCacheServer = g++ ;
LINKLIBS on StatCacheServer
= [ on StatCacheServer return $(LINKLIBS) ] -lbe ;
Main StatCacheServer : StatCacheServer.cpp ;
if ! $(NO_STAT_CACHE_SERVER_RESOURCES) {
CompileResources StatCacheServer.rsrc : StatCacheServer.rdef ;
AddResources StatCacheServer : StatCacheServer.rsrc ;
}
if $(BINDIR) { InstallBin $(BINDIR) : StatCacheServer ; }
}
#
### LOCAL CHANGE
#
# Distribution making from here on out.
#
ALLSOURCE =
Build.com Build.mpw Jam.html Jambase Jambase.html Jamfile
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 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 ;
### LOCAL CHANGE
#
ALLSOURCE += LOCAL_DIFFERENCES.txt ;
#
### LOCAL CHANGE
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) ;