Changeset 0fc4c75
- Timestamp:
- 10/03/2005 12:56:55 AM (19 years ago)
- Branches:
- 0.2, 1.0, 2.3, 2.3.x, 2.4, ablfs, ablfs-more, legacy, new_features, trunk
- Children:
- 47e0a38
- Parents:
- 968dafd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
jhalfs
r968dafd r0fc4c75 148 148 MKFILE=$JHALFSDIR/Makefile 149 149 XSL=dump-lfs-scripts.xsl 150 FNC=functions 150 151 if [ -z $TEST ] ; then TEST=0 ; fi 151 152 … … 321 322 322 323 # Drop in the name of the target on a new line, and the previous target 323 # as a dependency. 324 # as a dependency. Also call the echo_message function. 324 325 echo -e "\n$i: $PREV" >> $MKFILE.tmp 326 echo -e "\t@\$(call echo_message, Building)" >> $MKFILE.tmp 325 327 326 328 # Find the version of the command files, if it corresponds with the building of … … 338 340 # Insert instructions for unpacking the package and to set 339 341 # the PKGDIR variable. 340 echo -e "\t \$(call unpack-lfs,$FILE)" >> $MKFILE.tmp341 echo -e "\t -ROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp342 echo -e "\t@\$(call unpack-lfs,$FILE)" >> $MKFILE.tmp 343 echo -e "\t@ROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp 342 344 echo -e "\tchown -R lfs \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp 343 345 echo -e "\techo \"PKGDIR=\$(LFS)\$(SRC)/\$\$ROOT\" > envars && \\" >> $MKFILE.tmp … … 347 349 # Dump the path to the Binutils pass1 or TCL sources directory. 348 350 if [ "$i" = "027-binutils-pass1" -o "$i" = "032-tcl" ] ; then 349 echo -e "\techo \"\$(LFS)\$(SRC)/\$\$ROOT\" > sources-dir && \\" >> $MKFILE.tmp 350 fi 351 echo -e "\techo \"\$(LFS)\$(SRC)/\$\$ROOT\" > sources-dir" >> $MKFILE.tmp 351 352 352 353 # Dump the path to the Binutils pass2 sources directory. 353 if [ "$i" = "036-binutils-pass2" ] ; then 354 echo -e "\techo \"\$(SRC)/\$\$ROOT\" > sources-dir && \\" >> $MKFILE.tmp 355 fi 354 elif [ "$i" = "036-binutils-pass2" ] ; then 355 echo -e "\techo \"\$(SRC)/\$\$ROOT\" > sources-dir" >> $MKFILE.tmp 356 356 357 357 # For the Adjusting phase we must to cd to the binutils-build directory. 358 if [ "$i" = "031-adjusting" ] ; then358 elif [ "$i" = "031-adjusting" ] ; then 359 359 echo -e "\techo \"PKGDIR=\$(LFS)\$(SRC)/binutils-build\" > envars && \\" >> $MKFILE.tmp 360 echo -e "\techo \"export PKGDIR\" >> envars && \\" >> $MKFILE.tmp 361 fi 360 echo -e "\techo \"export PKGDIR\" >> envars" >> $MKFILE.tmp 362 361 363 362 # For the Expect build we need to set the TCLPATH envar. 364 if [ "$i" = "033-expect" ] ; then363 elif [ "$i" = "033-expect" ] ; then 365 364 echo -e "\techo \"TCLPATH=\`cat sources-dir\`\" >> envars && \\" >> $MKFILE.tmp 366 echo -e "\techo \"export TCLPATH\" >> envars && \\" >> $MKFILE.tmp 365 echo -e "\techo \"export TCLPATH\" >> envars" >> $MKFILE.tmp 366 367 # Everything else, add a true statment so we don't confuse make 368 else 369 echo -e "\ttrue" >> $MKFILE.tmp 367 370 fi 368 371 369 372 # Insert date and disk usage at the top of the log file. 370 echo -e "\t echo -e \"\\\n\`date\`\\\n\\\nKB: \`du -sk --exclude=0??-* \$(LFS)\`\\\n\" >logs/$i && \\" >> $MKFILE.tmp373 echo -e "\t@echo -e \"\\\n\`date\`\\\n\\\nKB: \`du -sk --exclude=0??-* \$(LFS)\`\\\n\" >logs/$i && \\" >> $MKFILE.tmp 371 374 372 375 # Insert the script run … … 374 377 375 378 # Insert date and disk usage at the bottom of the log file. 376 echo -e "\techo -e \"\\\n\`date\`\\\n\\\nKB: \`du -sk --exclude=0??-* \$(LFS)\`\\\n\" >>logs/$i && \\" >> $MKFILE.tmp379 echo -e "\techo -e \"\\\n\`date\`\\\n\\\nKB: \`du -sk --exclude=0??-* \$(LFS)\`\\\n\" >>logs/$i" >> $MKFILE.tmp 377 380 378 381 # Remove the build directory(ies) even if the package build fails, except for … … 381 384 if [ "$vrs" != "" ] ; then 382 385 if [ "$i" != "027-binutils-pass1" ] && [ "$i" != "032-tcl" ] && [ "$i" != "036-binutils-pass2" ] ; then 383 echo -e "\t ROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp386 echo -e "\t@ROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp 384 387 echo -e "\trm -r \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp 385 388 echo -e "\tif [ -e \$(LFS)\$(SRC)/$name-build ]; then \\" >> $MKFILE.tmp … … 389 392 fi 390 393 if [ "$i" = "027-binutils-pass1" -o "$i" = "036-binutils-pass2" ] ; then 391 echo -e "\t if [ ! -e \$@ ] ; then \\" >> $MKFILE.tmp394 echo -e "\t@if [ ! -e \$@ ] ; then \\" >> $MKFILE.tmp 392 395 echo -e "\t\tROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp 393 396 echo -e "\t\trm -r \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp … … 396 399 fi 397 400 if [ "$i" = "032-tcl" ] ; then 398 echo -e "\t if [ ! -e \$@ ] ; then \\" >> $MKFILE.tmp401 echo -e "\t@if [ ! -e \$@ ] ; then \\" >> $MKFILE.tmp 399 402 echo -e "\t\tROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp 400 403 echo -e "\t\trm -r \$(LFS)\$(SRC)/\$\$ROOT; \\" >> $MKFILE.tmp … … 404 407 # Remove the Binutils pass 1 sources after a successful Adjusting phase. 405 408 if [ "$i" = "031-adjusting" ] ; then 406 echo -e "\t if [ -e \$@ ] ; then \\" >> $MKFILE.tmp409 echo -e "\t@if [ -e \$@ ] ; then \\" >> $MKFILE.tmp 407 410 echo -e "\t\trm -r \`cat sources-dir\` && \\" >> $MKFILE.tmp 408 411 echo -e "\t\trm -r \$(LFS)\$(SRC)/binutils-build && \\" >> $MKFILE.tmp … … 413 416 # Remove the TCL sources after a successful Expect build. 414 417 if [ "$i" = "033-expect" ] ; then 415 echo -e "\t if [ -e \$@ ] ; then \\" >> $MKFILE.tmp418 echo -e "\t@if [ -e \$@ ] ; then \\" >> $MKFILE.tmp 416 419 echo -e "\t\trm -r \`cat sources-dir\` && \\" >> $MKFILE.tmp 417 420 echo -e "\t\trm sources-dir; \\" >> $MKFILE.tmp … … 419 422 fi 420 423 421 # Check if the package has been successfully built.422 echo -e "\t@if [ ! -e \$@ ] ; then \\" >> $MKFILE.tmp423 echo -e "\t\techo \"The build of \$@ has failed\" && exit 1; \\" >> $MKFILE.tmp424 echo -e "\tfi;" >> $MKFILE.tmp425 426 424 # Include a touch of the target name so make can check 427 425 # if it's already been made. 428 echo -e "\t touch \$@" >> $MKFILE.tmp426 echo -e "\t@touch \$@" >> $MKFILE.tmp 429 427 430 428 # Keep the script file name for Makefile dependencies. … … 459 457 460 458 # Insert instructions for unpacking the package and changing directories 461 echo -e "\t \$(call unpack,$FILE)" >> $MKFILE.tmp462 echo -e "\t -ROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp459 echo -e "\t@\$(call unpack,$FILE)" >> $MKFILE.tmp 460 echo -e "\t@ROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp 463 461 echo -e "\techo \"PKGDIR=\$(SRC)/\$\$ROOT\" > envars && \\" >> $MKFILE.tmp 464 462 echo -e "\techo \"export PKGDIR\" >> envars && \\" >> $MKFILE.tmp … … 468 466 if [ "$i" = "067-readjusting" ] ; then 469 467 echo -e "\techo \"PKGDIR=\$(SRC)/binutils-build\" > envars && \\" >> $MKFILE.tmp 470 echo -e "\techo \"export PKGDIR\" >> envars && \\" >> $MKFILE.tmp 471 fi 468 echo -e "\techo \"export PKGDIR\" >> envars" >> $MKFILE.tmp 472 469 473 470 # Insert the script run 474 471 # For the mount of kernel filesystems we need to set LFS. 475 if [ "$i" = "057-kernfs" ] ; then472 elif [ "$i" = "057-kernfs" ] ; then 476 473 echo -e "\techo \"LFS=\$(LFS)\" > envars && \\" >> $MKFILE.tmp 477 474 echo -e "\techo \"export LFS\" >> envars && \\" >> $MKFILE.tmp … … 480 477 echo -e "\t. envars && commands/$file >>logs/$i 2>&1 && \\" >> $MKFILE.tmp 481 478 # Insert date and disk usage at the bottom of the log file. 482 echo -e "\techo -e \"\\\n\`date\`\\\n\\\nKB: \`du -sk --exclude=0??-* \$(LFS)\`\\\n\" >>logs/$i && \\" >> $MKFILE.tmp479 echo -e "\techo -e \"\\\n\`date\`\\\n\\\nKB: \`du -sk --exclude=0??-* \$(LFS)\`\\\n\" >>logs/$i" >> $MKFILE.tmp 483 480 else 484 481 # Insert date and disk usage at the top of the log file. … … 486 483 echo -e "\t. envars && commands/$file >>logs/$i 2>&1 && \\" >> $MKFILE.tmp 487 484 # Insert date and disk usage at the bottom of the log file. 488 echo -e "\techo -e \"\\\n\`date\`\\\n\\\nKB: \`du -sk --exclude=0??-* /\`\\\n\" >>logs/$i && \\" >> $MKFILE.tmp485 echo -e "\techo -e \"\\\n\`date\`\\\n\\\nKB: \`du -sk --exclude=0??-* /\`\\\n\" >>logs/$i" >> $MKFILE.tmp 489 486 fi 490 487 491 488 # Remove the build directory(ies) even if the package build fails. 492 489 if [ "$vrs" != "" ] ; then 493 echo -e "\t ROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp490 echo -e "\t@ROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp 494 491 echo -e "\trm -r \$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp 495 492 echo -e "\tif [ -e \$(SRC)/$name-build ]; then \\" >> $MKFILE.tmp … … 500 497 # Remove the Binutils pass 2 sources after a successful Re-Adjusting phase. 501 498 if [ "$i" = "067-readjusting" ] ; then 502 echo -e "\t if [ -e \$@ ] ; then \\" >> $MKFILE.tmp499 echo -e "\t@if [ -e \$@ ] ; then \\" >> $MKFILE.tmp 503 500 echo -e "\t\trm -r \`cat sources-dir\` && \\" >> $MKFILE.tmp 504 501 echo -e "\t\trm -r \$(SRC)/binutils-build && \\" >> $MKFILE.tmp … … 507 504 fi 508 505 509 # Check if the package has been successfully built.510 echo -e "\t@if [ ! -e \$@ ] ; then \\" >> $MKFILE.tmp511 echo -e "\t\techo \"The build of \$@ has failed\" && exit 1; \\" >> $MKFILE.tmp512 echo -e "\tfi;" >> $MKFILE.tmp513 514 506 # Include a touch of the target name so make can check 515 507 # if it's already been made. 516 echo -e "\t touch \$@" >> $MKFILE.tmp508 echo -e "\t@touch \$@" >> $MKFILE.tmp 517 509 518 510 # Keep the script file name for Makefile dependencies. … … 524 516 echo "export LFS := $BUILDDIR" >> $MKFILE 525 517 echo -e "export LOGDIR := $LOGDIR\n" >> $MKFILE 526 echo "define unpack-lfs" >> $MKFILE 527 echo -e "\t@cd \$(LFS)\$(SRC) ; tar -xvjf \$(1) > /tmp/unpacked" >> $MKFILE 528 echo -e "endef\n" >> $MKFILE 529 echo "define unpack" >> $MKFILE 530 echo -e "\t@cd \$(SRC) ; tar -xvf \$(1) > /tmp/unpacked" >> $MKFILE 531 echo -e "endef\n" >> $MKFILE 518 echo "include functions" >> $MKFILE 532 519 533 520 # Drop in the main target 'all:' and the chapter targets with each sub-target … … 563 550 # for the lfs user. 564 551 echo "020-creatingtoolsdir:" >> $MKFILE 565 echo -e "\tmkdir -v \$(LFS)/tools && \\" >> $MKFILE 552 echo -e "\t@\$(call echo_message, Building)" >> $MKFILE 553 echo -e "\t@mkdir -v \$(LFS)/tools && \\" >> $MKFILE 566 554 echo -e "\tln -sv \$(LFS)/tools / && \\" >> $MKFILE 567 555 echo -e "\ttouch \$@\n" >> $MKFILE 568 556 569 557 echo "021-addinguser: 020-creatingtoolsdir" >> $MKFILE 570 echo -e "\tgroupadd lfs && \\" >> $MKFILE 558 echo -e "\t@\$(call echo_message, Building)" >> $MKFILE 559 echo -e "\t@groupadd lfs && \\" >> $MKFILE 571 560 echo -e "\tuseradd -s /bin/bash -g lfs -m -k /dev/null lfs && \\" >> $MKFILE 572 561 echo -e "\tchown lfs \$(LFS)/tools && \\" >> $MKFILE … … 577 566 578 567 echo "022-settingenvironment: 021-addinguser" >> $MKFILE 579 echo -e "\techo \"exec env -i HOME=\\\$\$HOME TERM=\\\$\$TERM PS1='\u:\w\$$ ' /bin/bash\" > /home/lfs/.bash_profile && \\" >> $MKFILE 568 echo -e "\t@\$(call echo_message, Building)" >> $MKFILE 569 echo -e "\t@echo \"exec env -i HOME=\\\$\$HOME TERM=\\\$\$TERM PS1='\u:\w\$$ ' /bin/bash\" > /home/lfs/.bash_profile && \\" >> $MKFILE 580 570 echo -e "\techo \"set +h\" > /home/lfs/.bashrc && \\" >> $MKFILE 581 571 echo -e "\techo \"umask 022\" >> /home/lfs/.bashrc && \\" >> $MKFILE … … 619 609 620 610 if [ "$PWD" != "$JHALFSDIR" ] ; then 621 cp $0 $XSL $ JHALFSDIR/611 cp $0 $XSL $FNC $JHALFSDIR/ 622 612 fi 623 613
Note:
See TracChangeset
for help on using the changeset viewer.