- Timestamp:
- 09/30/2005 06:51:32 PM (19 years ago)
- Branches:
- 0.2, 1.0, 2.3, 2.3.x, 2.4, ablfs, ablfs-more, legacy, new_features, trunk
- Children:
- 8b33a10
- Parents:
- a5e49c6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
jhalfs
ra5e49c6 r0209bb7 286 286 name=`echo $i | sed -e 's@[0-9]\{3\}-@@' -e 's@-pass[0-9]\{1\}@@'` 287 287 288 # Drop in the name of the target on a new line. 289 echo -e "\n$i:" >> $MKFILE.tmp 288 # Set the dependency for the first target. 289 if [ -z $PREV ] ; then PREV=chapter4 ; fi 290 291 # Drop in the name of the target on a new line, and the 292 # pevious target as a dependency. 293 echo -e "\n$i: $PREV" >> $MKFILE.tmp 290 294 291 295 # Find the version of the command files, if it corresponds with the building of … … 304 308 # the PKGDIR variable. 305 309 echo -e "\t\$(call unpack-lfs,$FILE)" >> $MKFILE.tmp 306 echo -e "\t ROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp310 echo -e "\t-ROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp 307 311 echo -e "\tchown -R lfs \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp 308 312 echo -e "\techo \"PKGDIR=\$(LFS)\$(SRC)/\$\$ROOT\" > envars && \\" >> $MKFILE.tmp … … 311 315 312 316 # Insert the script run 313 echo -e "\tsu - lfs -c \". /home/lfs/.bashrc && $JHALFSDIR/commands/$file\" >\$(LOGDIR)/$i.log 2>&1 && \\" >> $MKFILE.tmp 314 315 # Remove the build directory(ies). 316 # (How could it be deleted even if the package build fails?) 317 if [ "$vrs" != "" ] ; then 318 echo -e "\trm -r \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp 319 echo -e "\tif [ -e \$(LFS)\$(SRC)/*-build ]; then \\" >> $MKFILE.tmp 320 echo -e "\t\t rm -r \$(LFS)\$(SRC)/*-build; \\" >> $MKFILE.tmp 321 echo -e "\tfi;" >> $MKFILE.tmp 322 fi 317 echo -e "\tsu - lfs -c \". /home/lfs/.bashrc && $JHALFSDIR/commands/$file\" >\$(LOGDIR)/$i 2>&1 && \\" >> $MKFILE.tmp 323 318 324 319 # Include a touch of the target name so make can check 325 320 # if it's already been made. 326 321 echo -e "\ttouch \$@" >> $MKFILE.tmp 322 323 # Remove the build directory(ies) even if the package build fails. 324 if [ "$vrs" != "" ] ; then 325 echo -e "\tROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp 326 echo -e "\trm -r \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp 327 echo -e "\tif [ -e \$(LFS)\$(SRC)/*-build ]; then \\" >> $MKFILE.tmp 328 echo -e "\t\trm -r \$(LFS)\$(SRC)/*-build; \\" >> $MKFILE.tmp 329 echo -e "\tfi;" >> $MKFILE.tmp 330 fi 331 332 # Check if the package has been sucessfully build. 333 echo -e "\tif [ ! -e \$@ ] ; then \\" >> $MKFILE.tmp 334 echo -e "\t\techo \"The build of \$@ has failed\" && exit 1; \\" >> $MKFILE.tmp 335 echo -e "\tfi;" >> $MKFILE.tmp 336 337 # Keep the script file name in a second variable for Makefile dependencies. 338 PREV=$i 327 339 328 340 done … … 343 355 echo -e "all: chapter4 chapter5\n" >> $MKFILE 344 356 echo -e "chapter4: 020-creatingtoolsdir 021-addinguser 022-settingenvironment\n" >> $MKFILE 345 echo -e "chapter5: $chapter5\n" >> $MKFILE357 echo -e "chapter5: chapter4 $chapter5\n" >> $MKFILE 346 358 347 359 # Clean targets 348 echo "clean: clean-chapter5 clean-chapter4" >> $MKFILE 360 echo "clean-all: clean" >> $MKFILE 361 echo -e "\trm -rfv ./*\n" >> $MKFILE 362 363 echo -e "clean: clean-chapter5 clean-chapter4\n" >> $MKFILE 349 364 350 365 echo "clean-chapter4:" >> $MKFILE 351 echo -e "\tuserdel lfs && \\" >> $MKFILE 352 echo -e "\trm -r /home/lfs && \\" >> $MKFILE 353 echo -e "\trm -r \$(LFS)/tools && \\" >> $MKFILE 354 echo -e "\trm /tools" >> $MKFILE 355 echo -e "\trm 02*\n" >> $MKFILE 366 echo -e "\t-userdel lfs" >> $MKFILE 367 echo -e "\trm -rfv /home/lfs" >> $MKFILE 368 echo -e "\trm -rfv \$(LFS)/tools" >> $MKFILE 369 echo -e "\trm -fv /tools" >> $MKFILE 370 echo -e "\trm -fv envars" >> $MKFILE 371 echo -e "\trm -fv 02* logs/02*.log\n" >> $MKFILE 356 372 357 373 echo "clean-chapter5:" >> $MKFILE 358 echo -e "\trm -r \$(LFS)/tools/* && \\" >> $MKFILE 359 echo -e "\trm -f $chapter5\n" >> $MKFILE 374 echo -e "\trm -rfv \$(LFS)/tools/*" >> $MKFILE 375 echo -e "\trm -fv envars" >> $MKFILE 376 echo -e "\trm -fv $chapter5" >> $MKFILE 377 echo -e "\tcd logs && rm -fv $chapter5 && cd ..\n" >> $MKFILE 360 378 361 379 # The chapter4 sub-targets are hard-coded to can create the lfs user, … … 367 385 echo -e "\ttouch \$@\n" >> $MKFILE 368 386 369 echo "021-addinguser: " >> $MKFILE387 echo "021-addinguser: 020-creatingtoolsdir" >> $MKFILE 370 388 echo -e "\tgroupadd lfs && \\" >> $MKFILE 371 389 echo -e "\tuseradd -s /bin/bash -g lfs -m -k /dev/null lfs && \\" >> $MKFILE … … 376 394 echo -e "\ttouch \$@\n" >> $MKFILE 377 395 378 echo "022-settingenvironment: " >> $MKFILE396 echo "022-settingenvironment: 021-addinguser" >> $MKFILE 379 397 echo -e "\techo \"exec env -i HOME=\\\$\$HOME TERM=\\\$\$TERM PS1='\u:\w\$$ ' /bin/bash\" > /home/lfs/.bash_profile && \\" >> $MKFILE 380 398 echo -e "\techo \"set +h\" > /home/lfs/.bashrc && \\" >> $MKFILE … … 414 432 get_book 415 433 build_Makefile 434 #make
Note:
See TracChangeset
for help on using the changeset viewer.