Changeset 9e406b5 for jhalfs


Ignore:
Timestamp:
09/12/2005 02:53:48 AM (19 years ago)
Author:
Jeremy Huntwork <jhuntwork@…>
Branches:
0.2, 1.0, 2.3, 2.3.x, 2.4, ablfs, ablfs-more, legacy, new_features, trunk
Children:
fbb6b78
Parents:
48d7968
Message:

Fixed some tagging, added a new sed to use 'cat' properly in the Makefile

File:
1 edited

Legend:

Unmodified
Added
Removed
  • jhalfs

    r48d7968 r9e406b5  
    256256
    257257build_Makefile() {
     258  echo -n "Creating Makefile... "
    258259  cd $JHALFSDIR/commands
    259260 
     
    292293
    293294        # Drop in the actual commands that were parsed from the book
     295        # These seds add an extra $ to each variable so make doesn't break,
     296        # add tabs to the beginning of each line, and add ' && \' to the end
     297        # of each line except for those that end in '\'.
    294298        cat $i | sed -e 's:\$:&&:g' -e 's:^:\t:' -e 's:[^\\]$:& \&\& \\:' >> $MKFILE.tmp
    295         sed -i -e '$s: \&\& \\::' $MKFILE.tmp -e 's|\$\$LFS|\$(LFS)|' $MKFILE.tmp
     299        # This sed removes the ' && \' from the last command of each target
     300        sed -i '$s: \&\& \\::' $MKFILE.tmp
    296301
    297302        # Include a touch of the target name so make can check if it's already been made.
    298303        echo -e "\ttouch \$@" >> $MKFILE.tmp
    299304  done
    300 
    301         # Stick a variable and some defines at the top of the real makefile     
    302         echo "export SRC := /sources" > $MKFILE
    303         echo "export LFS := $BUILDDIR" >> $MKFILE
    304         echo "define unpack" >> $MKFILE
    305         echo -e "\t@cd \$(SRC) ; tar -xvf \$(1) > /tmp/unpacked" >> $MKFILE
    306         echo -e "endef\n" >> $MKFILE
    307 
    308         # Drop in the list as the main target 'all:' with each sub-target as a dependency.
    309         echo "all: $list" >> $MKFILE
    310 
    311         # Bring over the items from the Makefile.tmp
    312         cat $MKFILE.tmp >> $MKFILE
    313         rm $MKFILE.tmp
     305  # These seds turn the variables '$$LFS' into '$(LFS)' so make will understand,
     306  # and remove the ' && \'s from the end of each line of a cat command.
     307  sed -i -e 's|\$\$LFS|\$(LFS)|' -e '/^\tcat/,/^\tEOF/s/ \&\& \\//' $MKFILE.tmp
     308
     309  # Stick a variable and some defines at the top of the real makefile   
     310  echo "export SRC := /sources" > $MKFILE
     311  echo "export LFS := $BUILDDIR" >> $MKFILE
     312  echo "define unpack" >> $MKFILE
     313  echo -e "\t@cd \$(SRC) ; tar -xvf \$(1) > /tmp/unpacked" >> $MKFILE
     314  echo -e "endef\n" >> $MKFILE
     315
     316  # Drop in the list as the main target 'all:' with each sub-target as a dependency.
     317  echo "all: $list" >> $MKFILE
     318
     319  # Bring over the items from the Makefile.tmp
     320  cat $MKFILE.tmp >> $MKFILE
     321  rm $MKFILE.tmp
     322  echo -ne "done\n"
    314323}
    315324
Note: See TracChangeset for help on using the changeset viewer.