Changeset 0bad6ba
- Timestamp:
- 09/27/2005 10:33:06 PM (19 years ago)
- Branches:
- 0.2, 1.0, 2.3, 2.3.x, 2.4, ablfs, ablfs-more, legacy, new_features, trunk
- Children:
- b8bf2f8
- Parents:
- dc2fee8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
jhalfs
rdc2fee8 r0bad6ba 254 254 >$MKFILE.tmp 255 255 256 for file in chapter0 {4,5}/* ; do256 for file in chapter05/* ; do 257 257 # Keep the script file name 258 258 i=`basename $file` … … 260 260 # First append each name of the script files to a list (this will become 261 261 # the names of the targets in the Makefile 262 list="$list$i"262 chapter5="$chapter5 $i" 263 263 264 264 # Grab the name of the target (minus the -pass1 or -pass2 in the case of gcc … … 282 282 283 283 # Insert instructions for unpacking the package and changing directories 284 echo -e "\t\$(call unpack ,$FILE)" >> $MKFILE.tmp284 echo -e "\t\$(call unpack-lfs,$FILE) && \\" >> $MKFILE.tmp 285 285 echo -e "\tROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp 286 echo -e "\tcd \$( SRC)/\$\$ROOT && \\" >> $MKFILE.tmp287 fi 288 289 # Run the script290 echo -e "\tsu - lfs -c \"/bin/bash $file\"" >> $MKFILE.tmp286 echo -e "\tcd \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp 287 fi 288 289 # Insert the script run 290 echo -e "\tsu lfs -c \". /home/lfs/.bashrc && $JHALFSDIR/commands/$file\" && \\" >> $MKFILE.tmp 291 291 292 292 # Include a touch of the target name so make can check if it's already been made. 293 293 echo -e "\ttouch \$@" >> $MKFILE.tmp 294 294 done 295 # These seds turn the variables '$$LFS' into '$(LFS)' so make will understand,296 # and remove the ' && \'s from the end of each line of a cat command.297 sed -i -e 's|\$\$LFS|\$(LFS)|' -e '/^\tcat/,/^\tEOF/s/ \&\& \\//' $MKFILE.tmp298 295 299 296 # Stick a variable and some defines at the top of the real makefile 300 297 echo "export SRC := /sources" > $MKFILE 301 298 echo "export LFS := $BUILDDIR" >> $MKFILE 299 echo "define unpack-lfs" >> $MKFILE 300 echo -e "\t@cd \$(LFS)\$(SRC) ; tar -xvjf \$(1) > /tmp/unpacked" >> $MKFILE 301 echo -e "endef\n" >> $MKFILE 302 302 echo "define unpack" >> $MKFILE 303 303 echo -e "\t@cd \$(SRC) ; tar -xvf \$(1) > /tmp/unpacked" >> $MKFILE 304 304 echo -e "endef\n" >> $MKFILE 305 305 306 # Drop in the list as the main target 'all:' with each sub-target as a dependency. 307 echo "all: $list" >> $MKFILE 306 # Drop in the main target 'all:' and the chapter targets with each sub-target 307 # as a dependency. 308 echo -e "all: chapter4 chapter5\n" >> $MKFILE 309 echo -e "chapter4: 020-creatingtoolsdir 021-addinguser 022-settingenvironment\n" >> $MKFILE 310 echo -e "chapter5: $chapter5\n" >> $MKFILE 311 312 # Clean targets 313 echo "clean-chapter4:" >> $MKFILE 314 echo -e "\tuserdel lfs && \\" >> $MKFILE 315 echo -e "\trm -r /home/lfs && \\" >> $MKFILE 316 echo -e "\trm -r \$(LFS)/tools && \\" >> $MKFILE 317 echo -e "\trm /tools" >> $MKFILE 318 echo -e "\trm $JHALFSDIR/02*\n" >> $MKFILE 319 320 # The chapter4 sub-targets are hard-coded to can create the lfs user and 321 # environment, and to make the scripts executables (as part of 021-addinguser). 322 echo "020-creatingtoolsdir:" >> $MKFILE 323 echo -e "\tmkdir \$(LFS)/tools && \\" >> $MKFILE 324 echo -e "\tln -s \$(LFS)/tools / && \\" >> $MKFILE 325 echo -e "\ttouch \$@\n" >> $MKFILE 326 327 echo "021-addinguser:" >> $MKFILE 328 echo -e "\tgroupadd lfs && \\" >> $MKFILE 329 echo -e "\tuseradd -s /bin/bash -g lfs -m -k /dev/null lfs && \\" >> $MKFILE 330 echo -e "\tchown lfs \$(LFS)/tools && \\" >> $MKFILE 331 echo -e "\tchown lfs \$(LFS)/sources && \\" >> $MKFILE 332 # Make the scripts executables 333 echo -e "\tchmod -R +x $JHALFSDIR/commands && \\" >> $MKFILE 334 echo -e "\ttouch \$@\n" >> $MKFILE 335 336 echo "022-settingenvironment:" >> $MKFILE 337 echo -e "\techo \"exec env -i HOME=\\\$\$HOME TERM=\\\$\$TERM PS1='\u:\w\$$ ' /bin/bash\" > /home/lfs/.bash_profile && \\" >> $MKFILE 338 echo -e "\techo \"set +h\" > /home/lfs/.bashrc && \\" >> $MKFILE 339 echo -e "\techo \"umask 022\" >> /home/lfs/.bashrc && \\" >> $MKFILE 340 echo -e "\techo \"LFS=/mnt/lfs\" >> /home/lfs/.bashrc && \\" >> $MKFILE 341 echo -e "\techo \"LC_ALL=POSIX\" >> /home/lfs/.bashrc && \\" >> $MKFILE 342 echo -e "\techo \"PATH=/tools/bin:/bin:/usr/bin\" >> /home/lfs/.bashrc && \\" >> $MKFILE 343 echo -e "\techo \"export LFS LC_ALL PATH\" >> /home/lfs/.bashrc && \\" >> $MKFILE 344 echo -e "\tchown lfs /home/lfs/.bash* && \\" >> $MKFILE 345 echo -e "\ttouch \$@\n" >> $MKFILE 346 308 347 309 348 # Bring over the items from the Makefile.tmp
Note:
See TracChangeset
for help on using the changeset viewer.