Fixed bash build.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7998 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2004-06-15 22:13:59 +00:00
parent 79b4983458
commit 020be68a26
2 changed files with 58 additions and 46 deletions

View File

@ -2,6 +2,10 @@ SubDir OBOS_TOP src apps bin bash ;
SubDirCcFlags -DHAVE_CONFIG_H -DPROGRAM='\"sh\"' -DCONF_HOSTTYPE='\"i586\"' -DCONF_OSTYPE='\"beos\"' -DCONF_MACHTYPE='\"i586-pc-beos\"' -DCONF_VENDOR='\"pc\"' -DSHELL ;
# filter warnings we don't want here
local originalCCFlags = $(CCFLAGS) ;
CCFLAGS = [ Filter $(CCFLAGS) : -Wall -Wmissing-prototypes -Wsign-compare ] ;
SubDirHdrs [ FDirName $(SUBDIR) include ] ;
SubDirHdrs [ FDirName $(SUBDIR) lib ] ;
@ -13,7 +17,7 @@ BinCommand mksignames :
SEARCH on [ FGristFiles mksignames.c ] = [ FDirName $(SUBDIR) support ] ;
MakeLocate mksyntax mksignames : $(LOCATE_TARGET) ;
MakeLocate mksyntax mksignames : [ FObjectsDir ] ;
rule MkSyntaxExt
{
@ -30,14 +34,14 @@ actions MkSyntaxExt1
$(2) -o $(1) ;
}
MkSyntaxExt <src!apps!bin!bash>syntax.c ;
MkSyntaxExt [ FGristFiles syntax.c ] ;
rule MkSignamesExt
{
SetupObjectsDir ;
MakeLocate $(<) : $(LOCATE_TARGET) ;
Depends $(<) : mksyntax ;
Depends $(<) : mksignames ;
MkSignamesExt1 $(<) : mksignames ;
LocalClean clean : $(<) ;
}
@ -47,7 +51,7 @@ actions MkSignamesExt1
$(2) $(1) ;
}
MkSignamesExt <src!apps!bin!bash>signames.h ;
MkSignamesExt <bash>signames.h ;
BinCommand sh :
parse.y shell.c eval.c general.c make_cmd.c print_cmd.c
@ -61,5 +65,14 @@ BinCommand sh :
: libreadline.a libglob.a libbuiltins.a libtilde.a libsh.a libtermcap.a
: bash.rdef ;
# trap.c includes signames.h
Includes [ FGristFiles trap.c ] : <bash>signames.h ;
# some sources include the generated builtext.h
Includes [ FGristFiles execute_cmd.c nojobs.c parse.c ] : <bash>builtext.h ;
SubInclude OBOS_TOP src apps bin bash lib ;
SubInclude OBOS_TOP src apps bin bash builtins ;
# restore CCFLAGS
CCFLAGS = $(originalCCFlags) ;

View File

@ -10,28 +10,17 @@ BinCommand mkbuiltins : mkbuiltins.c ;
MakeLocate mkbuiltins : $(LOCATE_TARGET) ;
rule UserObject
{
switch $(2)
{
case *.S : assemble $(1) : $(2) ;
case *.o : return ;
case *.def : {
Depends $(<) : builtext.h ;
Cc $(<) : $(<:S=.c) ;
MkBuiltinsComp $(<:S=.c) : $(>) ;
}
case * : ECHO "unknown suffix on" $(2) ;
}
}
rule MkBuiltinsComp
{
MakeLocate $(<) : $(LOCATE_SOURCE) ;
local source = $(1) ;
local defFile = $(2) ;
Depends $(<) : $(>) mkbuiltins ;
MkBuiltinsComp1 $(<) : mkbuiltins $(>) ;
LocalClean clean : $(<) ;
SEARCH on $(defFile) = $(SEARCH_SOURCE) ;
MakeLocate $(source) : $(LOCATE_SOURCE) ;
Depends $(source) : $(defFile) mkbuiltins ;
MkBuiltinsComp1 $(source) : mkbuiltins $(defFile) ;
LocalClean clean : $(source) ;
}
actions MkBuiltinsComp1
@ -41,12 +30,15 @@ actions MkBuiltinsComp1
rule MkBuiltinsExt
{
MakeLocate $(<) : $(LOCATE_SOURCE) ;
SEARCH on $(>) = $(SEARCH_SOURCE) ;
local sources = $(1) ;
local defFiles = [ FGristFiles $(2) ] ;
MakeLocate $(sources) : $(LOCATE_SOURCE) ;
SEARCH on $(defFiles) = $(SEARCH_SOURCE) ;
Depends $(<) : $(>) mkbuiltins ;
MkBuiltinsExt1 $(<) : mkbuiltins $(>) ;
LocalClean clean : $(<) ;
Depends $(sources) : $(defFiles) mkbuiltins ;
MkBuiltinsExt1 $(sources) : mkbuiltins $(defFiles) ;
LocalClean clean : $(sources) ;
}
actions MkBuiltinsExt1
@ -54,25 +46,32 @@ actions MkBuiltinsExt1
$(2[1]) -externfile $(1[1]) -structfile $(1[2]) -noproduction $(2[2-]) ;
}
MkBuiltinsExt builtext.h <src!apps!bin!bash!builtins>builtins.c :
alias.def bind.def
break.def builtin.def cd.def colon.def command.def
declare.def echo.def enable.def eval.def exec.def
exit.def fc.def fg_bg.def hash.def help.def history.def jobs.def kill.def let.def
pushd.def read.def return.def set.def setattr.def shift.def source.def
suspend.def test.def times.def trap.def type.def ulimit.def umask.def
wait.def getopts.def shopt.def printf.def complete.def
local bashDefFiles =
alias.def bind.def break.def builtin.def cd.def colon.def command.def
declare.def echo.def enable.def eval.def exec.def exit.def fc.def fg_bg.def
hash.def help.def history.def jobs.def kill.def let.def pushd.def read.def
return.def set.def setattr.def shift.def source.def suspend.def test.def
times.def trap.def type.def ulimit.def umask.def wait.def getopts.def
shopt.def printf.def complete.def
;
StaticLibrary builtins :
alias.def bind.def
break.def builtin.def cd.def colon.def command.def
common.c declare.def echo.def enable.def eval.def evalfile.c
evalstring.c exec.def
exit.def fc.def fg_bg.def hash.def help.def history.def jobs.def kill.def let.def
pushd.def read.def return.def set.def setattr.def shift.def source.def
suspend.def test.def times.def trap.def type.def ulimit.def umask.def
wait.def getopts.def shopt.def printf.def getopt.c bashgetopt.c complete.def
builtins.c
# generate the source file for the .def files
local bashDefFile ;
for bashDefFile in [ FGristFiles $(bashDefFiles) ] {
local source = $(bashDefFile:S=.c) ;
Includes $(cFile) : <bash>builtext.h ;
Depends $(cFile:S=$(SUFOBJ)) : <bash>builtext.h ;
MkBuiltinsComp $(source) : $(bashDefFile) ;
}
# generate builtext.h and builtins.c
MkBuiltinsExt <bash>builtext.h [ FGristFiles builtins.c ] : $(bashDefFiles) ;
# generate the builtins library
StaticLibrary builtins
: common.c evalfile.c evalstring.c getopt.c bashgetopt.c builtins.c
[ FGristFiles $(bashDefFiles:S=.c) ]
;
# common.c includes builtext.h
Includes [ FGristFiles common.c ] : <bash>builtext.h ;