source: CLFS/master.sh@ d3d90e7

experimental
Last change on this file since d3d90e7 was 966cb20, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Merged r2771 from trunk.

  • Property mode set to 100755
File size: 41.9 KB
RevLine 
[0170229]1#!/bin/sh
[1ce084e]2# $Id$
[0170229]3
4###################################
5### FUNCTIONS ###
6###################################
7
8
9
10#----------------------------#
[fcaf131]11host_prep_Makefiles() { # Initialization of the system
[0170229]12#----------------------------#
13 local LFS_HOST
14
15 echo "${tab_}${GREEN}Processing... ${L_arrow}host prep files${R_arrow}"
16
17 # defined here, only for ease of reading
18 LFS_HOST="`echo ${MACHTYPE} | sed -e 's/unknown/cross/g' -e 's/-pc-/-cross-/g'`"
19(
20cat << EOF
21023-creatingtoolsdir:
22 @\$(call echo_message, Building)
[9199a13]23 @mkdir \$(MOUNT_PT)/tools && \\
24 rm -f /tools && \\
25 ln -s \$(MOUNT_PT)/tools /
[0170229]26 @if [ ! -d \$(MOUNT_PT)/sources ]; then \\
27 mkdir \$(MOUNT_PT)/sources; \\
28 fi;
29 @chmod a+wt \$(MOUNT_PT)/sources && \\
[9199a13]30 touch \$@ && \\
31 echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
32 echo --------------------------------------------------------------------------------\$(WHITE)
[0170229]33
34024-creatingcrossdir: 023-creatingtoolsdir
35 @mkdir -v \$(MOUNT_PT)/cross-tools && \\
[9199a13]36 rm -f /cross-tools && \\
37 ln -s \$(MOUNT_PT)/cross-tools /
38 @touch \$@ && \\
39 echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
40 echo --------------------------------------------------------------------------------\$(WHITE)
[0170229]41
42025-addinguser: 024-creatingcrossdir
43 @\$(call echo_message, Building)
44 @if [ ! -d /home/lfs ]; then \\
45 groupadd lfs; \\
46 useradd -s /bin/bash -g lfs -m -k /dev/null lfs; \\
47 else \\
48 touch user-lfs-exist; \\
49 fi;
50 @chown lfs \$(MOUNT_PT) && \\
51 chown lfs \$(MOUNT_PT)/tools && \\
52 chown lfs \$(MOUNT_PT)/cross-tools && \\
53 chown lfs \$(MOUNT_PT)/sources && \\
[9199a13]54 touch \$@ && \\
55 echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
56 echo --------------------------------------------------------------------------------\$(WHITE)
[0170229]57
58026-settingenvironment: 025-addinguser
59 @\$(call echo_message, Building)
60 @if [ -f /home/lfs/.bashrc -a ! -f /home/lfs/.bashrc.XXX ]; then \\
[9199a13]61 mv /home/lfs/.bashrc /home/lfs/.bashrc.XXX; \\
[0170229]62 fi;
63 @if [ -f /home/lfs/.bash_profile -a ! -f /home/lfs/.bash_profile.XXX ]; then \\
[9199a13]64 mv /home/lfs/.bash_profile /home/lfs/.bash_profile.XXX; \\
[0170229]65 fi;
66 @echo "set +h" > /home/lfs/.bashrc && \\
67 echo "umask 022" >> /home/lfs/.bashrc && \\
68 echo "LFS=\$(MOUNT_PT)" >> /home/lfs/.bashrc && \\
69 echo "LC_ALL=POSIX" >> /home/lfs/.bashrc && \\
70 echo "PATH=/cross-tools/bin:/bin:/usr/bin" >> /home/lfs/.bashrc && \\
71 echo "export LFS LC_ALL PATH" >> /home/lfs/.bashrc && \\
72 echo "" >> /home/lfs/.bashrc && \\
73 echo "unset CFLAGS" >> /home/lfs/.bashrc && \\
74 echo "unset CXXFLAGS" >> /home/lfs/.bashrc && \\
75 echo "" >> /home/lfs/.bashrc && \\
76 echo "export LFS_HOST=\"${LFS_HOST}\"" >> /home/lfs/.bashrc && \\
77 echo "export LFS_TARGET=\"${TARGET}\"" >> /home/lfs/.bashrc && \\
78 echo "export LFS_TARGET32=\"${TARGET32}\"" >> /home/lfs/.bashrc && \\
79 echo "source $JHALFSDIR/envars" >> /home/lfs/.bashrc
80 @chown lfs:lfs /home/lfs/.bashrc && \\
81 touch envars && \\
[9199a13]82 touch \$@ && \\
83 echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
84 echo --------------------------------------------------------------------------------\$(WHITE)
[0170229]85EOF
86) >> $MKFILE.tmp
87
88}
89
90
91
92#-----------------------------#
93cross_tools_Makefiles() { #
94#-----------------------------#
95 echo "${tab_}${GREEN}Processing... ${L_arrow}cross tools${R_arrow}"
96
97 for file in cross-tools/* ; do
98 # Keep the script file name
99 this_script=`basename $file`
100 #
101 # Skip this script...
102 case $this_script in
103 *cflags* | *variables* ) # work done in host_prep_Makefiles
104 continue; ;;
105 *) ;;
106 esac
107 #
108 # Set the dependency for the first target.
109 if [ -z $PREV ] ; then PREV=026-settingenvironment ; fi
110
111 # First append each name of the script files to a list (this will become
112 # the names of the targets in the Makefile
113 cross_tools="$cross_tools $this_script"
114
115 # Grab the name of the target (minus the -headers or -cross in the case of gcc
116 # and binutils in chapter 5)
117 name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' \
118 -e 's@-static@@' \
119 -e 's@-final@@' \
120 -e 's@-headers@@' \
121 -e 's@-64@@' \
122 -e 's@-n32@@'`
123 # Adjust 'name' and patch a few scripts on the fly..
124 case $name in
125 linux-libc) name=linux-libc-headers ;;
126 esac
127 #
128 # Find the version of the command files, if it corresponds with the building of a specific package
129 vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
130
131
132 #--------------------------------------------------------------------#
133 # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
134 #--------------------------------------------------------------------#
135 #
136 # Drop in the name of the target on a new line, and the previous target
137 # as a dependency. Also call the echo_message function.
[3e1c0e2]138 wrt_target "${this_script}" "$PREV"
[0170229]139 #
140 # If $vrs isn't empty, we've got a package...
141 #
[2fbc503]142 [[ "$vrs" != "" ]] && wrt_unpack "$name-$vrs.tar.*"
[0170229]143 #
[64cc345]144 wrt_run_as_su "${this_script}" "${file}"
[0170229]145 #
146 [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
147 #
148 # Include a touch of the target name so make can check if it's already been made.
[9199a13]149 wrt_touch
[0170229]150 #
151 #--------------------------------------------------------------------#
152 # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
153 #--------------------------------------------------------------------#
154 #
155 # Keep the script file name for Makefile dependencies.
156 PREV=$this_script
157
158 done # for file in ....
159}
160
161
162#-----------------------------#
163temptools_Makefiles() { #
164#-----------------------------#
165 echo "${tab_}${GREEN}Processing... ${L_arrow}temp system${R_arrow}"
166
167 for file in temp-system/* ; do
168 # Keep the script file name
169 this_script=`basename $file`
170 #
171 # First append each name of the script files to a list (this will become
172 # the names of the targets in the Makefile
173 temptools="$temptools $this_script"
174
175 #
176 # Grab the name of the target, strip id number, XXX-script
177 name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
178 #
179 # Find the version of the command files, if it corresponds with the building of a specific package
180 vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
181
182
183 #--------------------------------------------------------------------#
184 # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
185 #--------------------------------------------------------------------#
186 #
187 # Drop in the name of the target on a new line, and the previous target
188 # as a dependency. Also call the echo_message function.
[3e1c0e2]189 wrt_target "${this_script}" "$PREV"
[0170229]190 #
191 # If $vrs isn't empty, we've got a package...
192 # Insert instructions for unpacking the package and to set the PKGDIR variable.
193 #
[2fbc503]194 [[ "$vrs" != "" ]] && wrt_unpack "$name-$vrs.tar.*"
[c205656]195 [[ "$vrs" != "" ]] && [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
[0170229]196 #
[64cc345]197 wrt_run_as_su "${this_script}" "${file}"
[0170229]198 #
199 [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
200 #
201 # Include a touch of the target name so make can check if it's already been made.
[9199a13]202 wrt_touch
[0170229]203 #
204 #--------------------------------------------------------------------#
205 # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
206 #--------------------------------------------------------------------#
207 #
208 # Keep the script file name for Makefile dependencies.
209 PREV=$this_script
210 done # for file in ....
211}
212
213
214#-----------------------------#
215boot_Makefiles() { #
216#-----------------------------#
217 echo "${tab_}${GREEN}Processing... ${L_arrow}boot${R_arrow}"
218
219 for file in boot/* ; do
220 # Keep the script file name
221 this_script=`basename $file`
222
223 # A little housekeeping on the scripts
224 case $this_script in
[6d3564b]225 *grub | *aboot | *colo | *silo | *arcload | *lilo ) continue ;;
[0170229]226 *whatnext*) continue ;;
[0271c0c]227 *kernel) # if there is no kernel config file do not build the kernel
[4845f38]228 [[ -z $CONFIG ]] && continue
[0271c0c]229 # Copy the config file to /sources with a standardized name
[6eef5ef]230 cp $BOOT_CONFIG $BUILDDIR/sources/bootkernel-config
[0170229]231 ;;
232 esac
233 #
234 # First append each name of the script files to a list (this will become
235 # the names of the targets in the Makefile
236 boottools="$boottools $this_script"
237 #
238 # Grab the name of the target, strip id number and misc words.
239 case $this_script in
[6d3564b]240 *kernel) name=linux ;;
[fcaf131]241 *bootscripts) name="bootscripts-cross-lfs" ;;
[9dc8222]242 *udev-rules) name="udev-cross-lfs" ;;
[6d3564b]243 *grub-build) name=grub ;;
244 *-aboot-build) name=aboot ;;
245 *yaboot-build) name=yaboot ;;
246 *colo-build) name=colo ;;
247 *silo-build) name=silo ;;
248 *arcload-build) name=arcload ;;
249 *lilo-build) name=lilo ;;
[0170229]250 *) name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' -e 's@-build@@' ` ;;
251 esac
252
253 vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
254
255 #--------------------------------------------------------------------#
256 # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
257 #--------------------------------------------------------------------#
258 #
259 # Drop in the name of the target on a new line, and the previous target
260 # as a dependency. Also call the echo_message function.
[3e1c0e2]261 wrt_target "${this_script}" "$PREV"
[0170229]262 #
263 # If $vrs isn't empty, we've got a package...
264 # Insert instructions for unpacking the package and changing directories
265 #
[2fbc503]266 [[ "$vrs" != "" ]] && wrt_unpack "$name-$vrs.tar.*"
[c205656]267 [[ "$vrs" != "" ]] && [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
[0170229]268 #
269 # Select a script execution method
270 case $this_script in
271 *changingowner*) wrt_run_as_root "${this_script}" "${file}" ;;
272 *devices*) wrt_run_as_root "${this_script}" "${file}" ;;
273 *fstab*) if [[ -n "$FSTAB" ]]; then
274 wrt_copy_fstab "${this_script}"
275 else
[64cc345]276 wrt_run_as_su "${this_script}" "${file}"
[0170229]277 fi
278 ;;
[64cc345]279 *) wrt_run_as_su "${this_script}" "${file}" ;;
[0170229]280 esac
281 #
282 # Housekeeping...remove any build directory(ies) except if the package build fails.
283 [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
284 #
285 # Include a touch of the target name so make can check if it's already been made.
[9199a13]286 wrt_touch
[0170229]287 #
288 #--------------------------------------------------------------------#
289 # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
290 #--------------------------------------------------------------------#
291 #
292 # Keep the script file name for Makefile dependencies.
293 PREV=$this_script
294
295 done
296}
297
298
299#-----------------------------#
300chroot_Makefiles() { #
301#-----------------------------#
302 echo "${tab_}${GREEN}Processing... ${L_arrow}chroot${R_arrow}"
303
304 for file in chroot/* ; do
305 # Keep the script file name
306 this_script=`basename $file`
307 #
308 # Skipping scripts is done now and not included in the build tree.
[fd5cb46]309 case $this_script in
310 *chroot*) continue ;;
311 esac
[0170229]312
313 #
314 # First append each name of the script files to a list (this will become
315 # the names of the targets in the Makefile
316 chroottools="$chroottools $this_script"
317
318 # Grab the name of the target, strip id number, XXX-script
319 name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
320 vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
321
322 #--------------------------------------------------------------------#
323 # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
324 #--------------------------------------------------------------------#
325 #
326 # Drop in the name of the target on a new line, and the previous target
327 # as a dependency. Also call the echo_message function.
[3e1c0e2]328 wrt_target "${this_script}" "$PREV"
[0170229]329 #
330 # If $vrs isn't empty, we've got a package...
331 # Insert instructions for unpacking the package and changing directories
332 #
333 if [ "$vrs" != "" ] ; then
334 case $this_script in
[2fbc503]335 *util-linux) wrt_unpack "$name-$vrs.tar.*" ;;
336 *) wrt_unpack2 "$name-$vrs.tar.*" ;;
[0170229]337 esac
[c205656]338 [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
[0170229]339 fi
340 #
341 # Select a script execution method
342 case $this_script in
343 *kernfs) wrt_run_as_root "${this_script}" "${file}" ;;
[64cc345]344 *util-linux) wrt_run_as_su "${this_script}" "${file}" ;;
[0170229]345 *) wrt_run_as_chroot1 "${this_script}" "${file}" ;;
346 esac
347 #
348 # Housekeeping...remove the build directory(ies), except if the package build fails.
349 [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
350 #
351 # Include a touch of the target name so make can check if it's already been made.
[9199a13]352 wrt_touch
[0170229]353 #
354 #--------------------------------------------------------------------#
355 # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
356 #--------------------------------------------------------------------#
357 #
358 # Keep the script file name for Makefile dependencies.
359 PREV=$this_script
360
361 done # for file in...
362}
363
364
365#-----------------------------#
366testsuite_tools_Makefiles() { #
367#-----------------------------#
[afd0232]368 echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) testsuite tools${R_arrow}"
[0170229]369
370 for file in testsuite-tools/* ; do
371 # Keep the script file name
372 this_script=`basename $file`
373
374 # First append each name of the script files to a list (this will become
375 # the names of the targets in the Makefile
376 testsuitetools="$testsuitetools $this_script"
377
378 # Grab the name of the target, strip id number, XXX-script
379 name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'\
380 -e 's@-64bit@@' \
381 -e 's@-64@@' \
382 -e 's@64@@' \
383 -e 's@n32@@'`
384
385 vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
386
387 #--------------------------------------------------------------------#
388 # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
389 #--------------------------------------------------------------------#
390 #
391 # Drop in the name of the target on a new line, and the previous target
392 # as a dependency. Also call the echo_message function.
[3e1c0e2]393 wrt_target "${this_script}" "$PREV"
[0170229]394 #
395 case $name in
[c3c4e1d]396 tcl) wrt_unpack2 "$name$vrs-src.tar.*" ;;
397 *) wrt_unpack2 "$name-$vrs.tar.*" ;;
[0170229]398 esac
[c205656]399 [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
[0170229]400 #
401 wrt_run_as_chroot1 "${this_script}" "${file}"
402 #
403 wrt_remove_build_dirs "${name}"
404 #
405 # Include a touch of the target name so make can check if it's already been made.
[9199a13]406 wrt_touch
[0170229]407 #
408 #--------------------------------------------------------------------#
409 # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
410 #--------------------------------------------------------------------#
411 #
412 # Keep the script file name for Makefile dependencies.
413 PREV=$this_script
414
415 done
416}
417
418
419#--------------------------------#
420bm_testsuite_tools_Makefiles() { #
421#--------------------------------#
[afd0232]422 echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) testsuite tools${R_arrow}"
[0170229]423
424 for file in testsuite-tools/* ; do
425 # Keep the script file name
426 this_script=`basename $file`
427
428 # First append each name of the script files to a list (this will become
429 # the names of the targets in the Makefile
[39d4d5c]430 PREV=
[0170229]431 testsuitetools="$testsuitetools $this_script"
432
433 # Grab the name of the target, strip id number, XXX-script
434 name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'\
435 -e 's@-64bit@@' \
436 -e 's@-64@@' \
437 -e 's@64@@' \
438 -e 's@n32@@'`
439
440 vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
441
442 #--------------------------------------------------------------------#
443 # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
444 #--------------------------------------------------------------------#
445 #
446 # Drop in the name of the target on a new line, and the previous target
447 # as a dependency. Also call the echo_message function.
[3e1c0e2]448 wrt_target "${this_script}" "$PREV"
[0170229]449 #
450 case $name in
[c3c4e1d]451 tcl) wrt_unpack3 "$name$vrs-src.tar.*" ;;
452 *) wrt_unpack3 "$name-$vrs.tar.*" ;;
[0170229]453 esac
[c205656]454 [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
[0170229]455 #
456 wrt_run_as_root2 "${this_script}" "${file}"
457 #
458 wrt_remove_build_dirs2 "${name}"
459 #
460 # Include a touch of the target name so make can check if it's already been made.
[9199a13]461 wrt_touch
[0170229]462 #
463 #--------------------------------------------------------------------#
464 # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
465 #--------------------------------------------------------------------#
466 #
467 # Keep the script file name for Makefile dependencies.
468 PREV=$this_script
469
470 done
471}
472
473
474#-----------------------------#
475final_system_Makefiles() { #
476#-----------------------------#
[b12abe1]477 # Set envars and scripts for iteration targets
478 LOGS="" # Start with an empty global LOGS envar
479 if [[ -z "$1" ]] ; then
480 local N=""
481 else
482 local N=-build_$1
483 local basicsystem=""
484 mkdir final-system$N
485 cp final-system/* final-system$N
486 for script in final-system$N/* ; do
487 # Overwrite existing symlinks, files, and dirs
488 sed -e 's/ln -sv/&f/g' \
489 -e 's/mv -v/&f/g' \
490 -e 's/mkdir -v/&p/g' -i ${script}
491 done
492 # Remove Bzip2 binaries before make install
493 sed -e 's@make install@rm -vf /usr/bin/bz*\n&@' -i final-system$N/*-bzip2
494 # Delete *old Readline libraries just after make install
495 sed -e 's@make install@&\nrm -v /lib/lib{history,readline}*old@' -i final-system$N/*-readline
496 fi
497
498 echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) final system$N${R_arrow}"
[0170229]499
[b12abe1]500 for file in final-system$N/* ; do
[0170229]501 # Keep the script file name
502 this_script=`basename $file`
503
[b12abe1]504 # Test if the stripping phase must be skipped.
505 # Skip alsp temp-perl for iterative runs
[fd5cb46]506 case $this_script in
[b12abe1]507 *stripping*) [[ "$STRIP" = "0" ]] && continue ;;
508 *temp-perl*) [[ -n "$N" ]] && continue ;;
[fd5cb46]509 esac
[3fcd63e]510
[0170229]511 # Grab the name of the target, strip id number, XXX-script
512 name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' \
513 -e 's@temp-@@' \
514 -e 's@-64bit@@' \
515 -e 's@-64@@' \
516 -e 's@64@@' \
517 -e 's@n32@@'`
518
[b12abe1]519 # Find the version of the command files, if it corresponds with the building of
520 # a specific package. We need this here to can skip scripts not needed for
521 # iterations rebuilds
[0170229]522 vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
523
[b12abe1]524 if [[ "$vrs" = "" ]] && [[ -n "$N" ]] ; then
525 case "${this_script}" in
526 *stripping*) ;;
527 *) continue ;;
528 esac
529 fi
530
531 # Append each name of the script files to a list (this will become
532 # the names of the targets in the Makefile
533 basicsystem="$basicsystem ${this_script}${N}"
534
535 # Append each name of the script files to a list (this will become
536 # the names of the logs to be moved for each iteration)
537 LOGS="$LOGS ${this_script}"
538
[0170229]539 #--------------------------------------------------------------------#
540 # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
541 #--------------------------------------------------------------------#
542 #
543 # Drop in the name of the target on a new line, and the previous target
544 # as a dependency. Also call the echo_message function.
[b12abe1]545 wrt_target "${this_script}${N}" "$PREV"
[0170229]546
547 # If $vrs isn't empty, we've got a package...
548 if [ "$vrs" != "" ] ; then
[b12abe1]549 FILE="$name-$vrs.tar.*"
550 wrt_unpack2 "$FILE"
[e35e794]551 # If the testsuites must be run, initialize the log file
552 case $name in
553 binutils | gcc | glibc )
554 [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
555 ;;
556 * )
557 [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && wrt_test_log2 "${this_script}"
558 ;;
559 esac
560 # If using optimizations, write the instructions
[c205656]561 [[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
[0170229]562 fi
563 #
564 wrt_run_as_chroot1 "${this_script}" "${file}"
565 #
566 [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
567 #
568 # Include a touch of the target name so make can check if it's already been made.
[9199a13]569 wrt_touch
[0170229]570 #
571 #--------------------------------------------------------------------#
572 # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
573 #--------------------------------------------------------------------#
574 #
575 # Keep the script file name for Makefile dependencies.
[b12abe1]576 PREV=${this_script}${N}
577 # Set system_build envar for iteration targets
578 system_build=$basicsystem
[0170229]579 done # for file in final-system/* ...
580}
581
582
583#-----------------------------#
584bm_final_system_Makefiles() { #
585#-----------------------------#
[b12abe1]586 # Set envars and scripts for iteration targets
587 LOGS="" # Start with an empty global LOGS envar
588 if [[ -z "$1" ]] ; then
589 local N=""
590 # The makesys phase was initiated in bm_testsuite_tools_makefile
591 [[ "$TEST" = 0 ]] && PREV=""
592 else
593 local N=-build_$1
594 local basicsystem=""
595 mkdir final-system$N
596 cp final-system/* final-system$N
597 for script in final-system$N/* ; do
598 # Overwrite existing symlinks, files, and dirs
599 sed -e 's/ln -sv/&f/g' \
600 -e 's/mv -v/&f/g' \
601 -e 's/mkdir -v/&p/g' -i ${script}
602 done
603 # Remove Bzip2 binaries before make install
604 sed -e 's@make install@rm -vf /usr/bin/bz*\n&@' -i final-system$N/*-bzip2
605 # Delete *old Readline libraries just after make install
606 sed -e 's@make install@&\nrm -v /lib/lib{history,readline}*old@' -i final-system$N/*-readline
607 fi
[0170229]608
[b12abe1]609 echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) final system$N${R_arrow}"
[39d4d5c]610
[b12abe1]611 for file in final-system$N/* ; do
[0170229]612 # Keep the script file name
613 this_script=`basename $file`
614
[3fcd63e]615 # Test if the stripping phase must be skipped
[b12abe1]616 # Skip alsp temp-perl for iterative runs
[64cc345]617 case $this_script in
[b12abe1]618 *stripping*) [[ "$STRIP" = "0" ]] && continue ;;
619 *temp-perl*) [[ -n "$N" ]] && continue ;;
[fd5cb46]620 esac
[0170229]621
622 # Grab the name of the target, strip id number, XXX-script
623 name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' \
624 -e 's@temp-@@' \
625 -e 's@-64bit@@' \
626 -e 's@-64@@' \
627 -e 's@64@@' \
628 -e 's@n32@@'`
629
[b12abe1]630 # Find the version of the command files, if it corresponds with the building of
631 # a specific package. We need this here to can skip scripts not needed for
632 # iterations rebuilds
[0170229]633 vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
634
[b12abe1]635 if [[ "$vrs" = "" ]] && [[ -n "$N" ]] ; then
636 case "${this_script}" in
637 *stripping*) ;;
638 *) continue ;;
639 esac
640 fi
641
642 # Append each name of the script files to a list (this will become
643 # the names of the targets in the Makefile
644 basicsystem="$basicsystem ${this_script}${N}"
645
646 # Append each name of the script files to a list (this will become
647 # the names of the logs to be moved for each iteration)
648 LOGS="$LOGS ${this_script}"
649
[0170229]650 #--------------------------------------------------------------------#
651 # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
652 #--------------------------------------------------------------------#
653 #
654 # Drop in the name of the target on a new line, and the previous target
655 # as a dependency. Also call the echo_message function.
[b12abe1]656 wrt_target "${this_script}${N}" "$PREV"
[0170229]657
658 # If $vrs isn't empty, we've got a package...
659 if [ "$vrs" != "" ] ; then
[b12abe1]660 FILE="$name-$vrs.tar.*"
661 wrt_unpack3 "$FILE"
[e35e794]662 # If the testsuites must be run, initialize the log file
663 case $name in
664 binutils | gcc | glibc )
665 [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
666 ;;
667 * )
668 [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && wrt_test_log2 "${this_script}"
669 ;;
670 esac
671 # If using optimizations, write the instructions
[c205656]672 [[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
[0170229]673 fi
674 #
675 wrt_run_as_root2 "${this_script}" "${file}"
676 #
677 [[ "$vrs" != "" ]] && wrt_remove_build_dirs2 "${name}"
678 #
679 # Include a touch of the target name so make can check if it's already been made.
[9199a13]680 wrt_touch
[0170229]681 #
682 #--------------------------------------------------------------------#
683 # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
684 #--------------------------------------------------------------------#
685 #
686 # Keep the script file name for Makefile dependencies.
[b12abe1]687 PREV=${this_script}${N}
688 # Set system_build envar for iteration targets
689 system_build=$basicsystem
[0170229]690 done # for file in final-system/* ...
691}
692
693
694#-----------------------------#
695bootscripts_Makefiles() { #
696#-----------------------------#
[afd0232]697 echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) bootscripts${R_arrow}"
[0170229]698
699 for file in bootscripts/* ; do
700 # Keep the script file name
701 this_script=`basename $file`
702
703 case $this_script in
[eba62c0]704 *udev) continue ;; # This is not a script but a commentary, we want udev-rules
[0170229]705 *console*) continue ;; # Use the files that came with the bootscripts
706 *) ;;
707 esac
708
709 # First append each name of the script files to a list (this will become
710 # the names of the targets in the Makefile
711 bootscripttools="$bootscripttools $this_script"
712
713 # Grab the name of the target, strip id number, XXX-script
714 name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'\
715 -e 's@-64bit@@' \
716 -e 's@-64@@' \
717 -e 's@64@@' \
718 -e 's@n32@@'`
[fd5cb46]719 case $name in
[eba62c0]720 *bootscripts*) name=bootscripts-cross-lfs ;;
721 *udev-rules) name=udev-cross-lfs ;;
[fd5cb46]722 esac
[0170229]723 vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
724
725 #--------------------------------------------------------------------#
726 # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
727 #--------------------------------------------------------------------#
728 #
729 # Drop in the name of the target on a new line, and the previous target
730 # as a dependency. Also call the echo_message function.
[3e1c0e2]731 wrt_target "${this_script}" "$PREV"
[0170229]732 #
733 # If $vrs isn't empty, we've got a package...
734 #
735 [[ "$vrs" != "" ]] && wrt_unpack2 "$name-$vrs.tar.*"
736 #
737 wrt_run_as_chroot1 "${this_script}" "${file}"
738 #
739 [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
740 #
741 # Include a touch of the target name so make can check if it's already been made.
[9199a13]742 wrt_touch
[0170229]743 #
744 #--------------------------------------------------------------------#
745 # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
746 #--------------------------------------------------------------------#
747 #
748 # Keep the script file name for Makefile dependencies.
749 PREV=$this_script
750
751 done # for file in bootscripts/* ...
752
753}
754
755#-----------------------------#
756bm_bootscripts_Makefiles() { #
757#-----------------------------#
[afd0232]758 echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) bootscripts${R_arrow}"
[0170229]759
760 for file in bootscripts/* ; do
761 # Keep the script file name
762 this_script=`basename $file`
763
764 case $this_script in
765 *udev*) continue ;; # This is not a script but a commentary
766 *console*) continue ;; # Use the files that came with the bootscripts
767 *) ;;
768 esac
769
770 # First append each name of the script files to a list (this will become
771 # the names of the targets in the Makefile
772 bootscripttools="$bootscripttools $this_script"
773
774 # Grab the name of the target, strip id number, XXX-script
775 name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'\
776 -e 's@-64bit@@' \
777 -e 's@-64@@' \
778 -e 's@64@@' \
779 -e 's@n32@@'`
[fd5cb46]780 case $name in
781 *bootscripts*) name=bootscripts-cross-lfs
782 ;;
783 esac
[0170229]784 vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
785
786 #--------------------------------------------------------------------#
787 # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
788 #--------------------------------------------------------------------#
789 #
790 # Drop in the name of the target on a new line, and the previous target
791 # as a dependency. Also call the echo_message function.
[3e1c0e2]792 wrt_target "${this_script}" "$PREV"
[0170229]793 #
794 # If $vrs isn't empty, we've got a package...
795 #
[c3c4e1d]796 [[ "$vrs" != "" ]] && wrt_unpack3 "$name-$vrs.tar.*"
[0170229]797 #
798 wrt_run_as_root2 "${this_script}" "${file}"
799 #
800 [[ "$vrs" != "" ]] && wrt_remove_build_dirs2 "${name}"
801 #
802 # Include a touch of the target name so make can check if it's already been made.
[9199a13]803 wrt_touch
[0170229]804 #
805 #--------------------------------------------------------------------#
806 # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
807 #--------------------------------------------------------------------#
808 #
809 # Keep the script file name for Makefile dependencies.
810 PREV=$this_script
811
812 done # for file in bootscripts/* ...
813
814}
815
816
817
818#-----------------------------#
819bootable_Makefiles() { #
820#-----------------------------#
[afd0232]821 echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) make bootable${R_arrow}"
[0170229]822
[7f38b6d]823 for file in {bootable,the-end}/* ; do
[0170229]824 # Keep the script file name
825 this_script=`basename $file`
826
827 # A little housekeeping on the scripts
828 case $this_script in
[7f38b6d]829 *grub | *aboot | *colo | *silo | *arcload | *lilo | *reboot* ) continue ;;
[87b93b4]830 *kernel) # if there is no kernel config file do not build the kernel
[4845f38]831 [[ -z $CONFIG ]] && continue
[0271c0c]832 # Copy the config file to /sources with a standardized name
[1917cad]833 cp $CONFIG $BUILDDIR/sources/kernel-config
[87b93b4]834 ;;
[0170229]835 esac
836 #
837 # First append each name of the script files to a list (this will become
838 # the names of the targets in the Makefile
839 bootabletools="$bootabletools $this_script"
840 #
841 # Grab the name of the target, strip id number and misc words.
842 name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' -e 's@-build@@' `
[fd5cb46]843 case $this_script in
844 *kernel*) name=linux
845 ;;
846 esac
[0170229]847 vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
848
849 #--------------------------------------------------------------------#
850 # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
851 #--------------------------------------------------------------------#
852 #
853 # Drop in the name of the target on a new line, and the previous target
854 # as a dependency. Also call the echo_message function.
[3e1c0e2]855 wrt_target "${this_script}" "$PREV"
[0170229]856 #
857 # If $vrs isn't empty, we've got a package...
858 # Insert instructions for unpacking the package and changing directories
859 #
[b88d581]860 [[ "$vrs" != "" ]] && wrt_unpack2 "$name-$vrs.tar.*"
[0170229]861 #
862 # Select a script execution method
863 case $this_script in
864 *fstab*) if [[ -n "$FSTAB" ]]; then
865 wrt_copy_fstab "${this_script}"
866 else
[fcaf131]867 wrt_run_as_chroot1 "${this_script}" "${file}"
[0170229]868 fi
869 ;;
[fcaf131]870 *) wrt_run_as_chroot1 "${this_script}" "${file}" ;;
[0170229]871 esac
872 #
873 # Housekeeping...remove any build directory(ies) except if the package build fails.
874 [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
875 #
876 # Include a touch of the target name so make can check if it's already been made.
[9199a13]877 wrt_touch
[0170229]878 #
879 #--------------------------------------------------------------------#
880 # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
881 #--------------------------------------------------------------------#
882 #
883 # Keep the script file name for Makefile dependencies.
884 PREV=$this_script
885
886 done
887
[9e4b9a1]888 # Add SBU-disk_usage report target if required
889 if [[ "$REPORT" = "1" ]] ; then wrt_report ; fi
890
[0170229]891}
892
893
894
895#-----------------------------#
896bm_bootable_Makefiles() { #
897#-----------------------------#
[afd0232]898 echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) make bootable${R_arrow}"
[0170229]899
[7f38b6d]900 for file in {bootable,the-end}/* ; do
[0170229]901 # Keep the script file name
902 this_script=`basename $file`
903
904 # A little housekeeping on the scripts
905 case $this_script in
[7f38b6d]906 *grub | *aboot | *colo | *silo | *arcload | *lilo | *reboot* ) continue ;;
[b83baf6]907 *kernel) # if there is no kernel config file do not build the kernel
[4845f38]908 [[ -z $CONFIG ]] && continue
[0271c0c]909 # Copy the named config file to /sources with a standardized name
[62033d2]910 cp $CONFIG $BUILDDIR/sources/kernel-config
[0170229]911 ;;
912 esac
913 #
914 # First append each name of the script files to a list (this will become
915 # the names of the targets in the Makefile
916 bootabletools="$bootabletools $this_script"
917 #
918 # Grab the name of the target, strip id number and misc words.
919 case $this_script in
920 *kernel) name=linux
921 ;;
922 *) name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' -e 's@-build@@' ` ;;
923 esac
924
925 vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
926
927 #--------------------------------------------------------------------#
928 # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
929 #--------------------------------------------------------------------#
930 #
931 # Drop in the name of the target on a new line, and the previous target
932 # as a dependency. Also call the echo_message function.
[3e1c0e2]933 wrt_target "${this_script}" "$PREV"
[0170229]934 #
935 # If $vrs isn't empty, we've got a package...
936 # Insert instructions for unpacking the package and changing directories
937 #
[c3c4e1d]938 [[ "$vrs" != "" ]] && wrt_unpack3 "$name-$vrs.tar.*"
[0170229]939 #
940 # Select a script execution method
941 case $this_script in
942 *fstab*) if [[ -n "$FSTAB" ]]; then
[a9490ab]943 # Minimal boot mode has no access to original file, store in /sources
944 cp $FSTAB $BUILDDIR/sources/fstab
[0170229]945 wrt_copy_fstab2 "${this_script}"
946 else
947 wrt_run_as_root2 "${this_script}" "${file}"
948 fi
949 ;;
950 *) wrt_run_as_root2 "${this_script}" "${file}" ;;
951 esac
952 #
953 # Housekeeping...remove any build directory(ies) except if the package build fails.
954 [[ "$vrs" != "" ]] && wrt_remove_build_dirs2 "${name}"
955 #
956 # Include a touch of the target name so make can check if it's already been made.
[9199a13]957 wrt_touch
[0170229]958 #
959 #--------------------------------------------------------------------#
960 # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
961 #--------------------------------------------------------------------#
962 #
963 # Keep the script file name for Makefile dependencies.
964 PREV=$this_script
965
966 done
967
[9e4b9a1]968 # Add SBU-disk_usage report target if required
969 if [[ "$REPORT" = "1" ]] ; then wrt_report ; fi
970
[0170229]971}
972
973
974#-----------------------------#
975build_Makefile() { # Construct a Makefile from the book scripts
976#-----------------------------#
977 echo "Creating Makefile... ${BOLD}START${OFF}"
978
979 cd $JHALFSDIR/${PROGNAME}-commands
980 # Start with a clean Makefile.tmp file
981 >$MKFILE.tmp
982
983 host_prep_Makefiles
[d43a271]984 cross_tools_Makefiles # $cross_tools
985 temptools_Makefiles # $temptools
[afd0232]986 if [[ $METHOD = "chroot" ]]; then
[d43a271]987 chroot_Makefiles # $chroottools
[fa06e8e]988 if [[ ! $TEST = "0" ]]; then
[d43a271]989 testsuite_tools_Makefiles # $testsuitetools
[0170229]990 fi
[d43a271]991 final_system_Makefiles # $basicsystem
[b12abe1]992 # Add the iterations targets, if needed
993 [[ "$COMPARE" != "0" ]] && wrt_compare_targets
[d43a271]994 bootscripts_Makefiles # $bootscripttools
995 bootable_Makefiles # $bootabletools
[0170229]996 else
[d43a271]997 boot_Makefiles # $boottools
[fa06e8e]998 if [[ ! $TEST = "0" ]]; then
[d43a271]999 bm_testsuite_tools_Makefiles # $testsuitetools
[0170229]1000 fi
[d43a271]1001 bm_final_system_Makefiles # $basicsystem
[b12abe1]1002 # Add the iterations targets, if needed
1003 [[ "$COMPARE" != "0" ]] && wrt_compare_targets
[d43a271]1004 bm_bootscripts_Makefiles # $bootscipttools
1005 bm_bootable_Makefiles # $bootabletoosl
[0170229]1006 fi
[39d4d5c]1007# the_end_Makefiles
[0170229]1008
1009
1010 # Add a header, some variables and include the function file
1011 # to the top of the real Makefile.
1012(
1013 cat << EOF
1014$HEADER
1015
1016SRC= /sources
1017MOUNT_PT= $BUILDDIR
[460ea63]1018PKG_LST= $PKG_LST
[0170229]1019
1020include makefile-functions
1021
1022EOF
1023) > $MKFILE
1024
1025 # Add chroot commands
[e676ffa]1026 if [ "$METHOD" = "chroot" ] ; then
1027 chroot=`cat chroot/*chroot* | sed -e '/#!\/tools\/bin\/bash/d' \
[0170229]1028 -e '/^export/d' \
1029 -e '/^logout/d' \
1030 -e 's@ \\\@ @g' | tr -d '\n' | sed -e 's/ */ /g' \
1031 -e 's|\\$|&&|g' \
1032 -e 's|exit||g' \
1033 -e 's|$| -c|' \
1034 -e 's|"$$LFS"|$(MOUNT_PT)|'\
1035 -e 's|set -e||'`
[e676ffa]1036 echo -e "CHROOT1= $chroot\n" >> $MKFILE
1037 fi
[0170229]1038
1039 # Drop in the main target 'all:' and the chapter targets with each sub-target
1040 # as a dependency.
[39d4d5c]1041if [[ "${METHOD}" = "chroot" ]]; then
[0170229]1042(
1043 cat << EOF
[3a27393]1044all: chapter2 chapter3 chapter4 chapter5 chapter6 chapter7 chapter8 do-housekeeping
[0170229]1045 @\$(call echo_finished,$VERSION)
1046
1047chapter2: 023-creatingtoolsdir 024-creatingcrossdir 025-addinguser 026-settingenvironment
1048
1049chapter3: chapter2 $cross_tools
1050
1051chapter4: chapter3 $temptools
1052
[d43a271]1053chapter5: chapter4 $chroottools $testsuitetools
[0170229]1054
1055chapter6: chapter5 $basicsystem
1056
1057chapter7: chapter6 $bootscripttools
1058
1059chapter8: chapter7 $bootabletools
1060
1061clean-all: clean
[db187c74]1062 rm -rf ./{clfs-commands,logs,Makefile,*.xsl,makefile-functions,packages,patches}
[0170229]1063
1064clean: clean-chapter4 clean-chapter3 clean-chapter2
1065
1066clean-chapter2:
1067 -if [ ! -f user-lfs-exist ]; then \\
1068 userdel lfs; \\
1069 rm -rf /home/lfs; \\
1070 fi;
1071 rm -rf \$(MOUNT_PT)/tools
1072 rm -f /tools
1073 rm -rf \$(MOUNT_PT)/cross-tools
1074 rm -f /cross-tools
1075 rm -f envars user-lfs-exist
1076 rm -f 02* logs/02*.log
1077
1078clean-chapter3:
1079 rm -rf \$(MOUNT_PT)/tools/*
1080 rm -f $cross_tools restore-lfs-env sources-dir
1081 cd logs && rm -f $cross_tools && cd ..
1082
1083clean-chapter4:
1084 -umount \$(MOUNT_PT)/sys
1085 -umount \$(MOUNT_PT)/proc
1086 -umount \$(MOUNT_PT)/dev/shm
1087 -umount \$(MOUNT_PT)/dev/pts
1088 -umount \$(MOUNT_PT)/dev
1089 rm -rf \$(MOUNT_PT)/{bin,boot,dev,etc,home,lib,lib64,media,mnt,opt,proc,root,sbin,srv,sys,tmp,usr,var}
1090 rm -f $temptools
1091 cd logs && rm -f $temptools && cd ..
1092
1093
1094restore-lfs-env:
1095 @\$(call echo_message, Building)
1096 @if [ -f /home/lfs/.bashrc.XXX ]; then \\
[9199a13]1097 mv -f /home/lfs/.bashrc.XXX /home/lfs/.bashrc; \\
[0170229]1098 fi;
1099 @if [ -f /home/lfs/.bash_profile.XXX ]; then \\
[9199a13]1100 mv /home/lfs/.bash_profile.XXX /home/lfs/.bash_profile; \\
[0170229]1101 fi;
1102 @chown lfs:lfs /home/lfs/.bash* && \\
[9199a13]1103 touch \$@ && \\
1104 echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
1105 echo --------------------------------------------------------------------------------\$(WHITE)
[0170229]1106
[3a27393]1107do-housekeeping:
[9199a13]1108 @-umount \$(MOUNT_PT)/dev/pts
1109 @-umount \$(MOUNT_PT)/dev/shm
1110 @-umount \$(MOUNT_PT)/dev
1111 @-umount \$(MOUNT_PT)/sys
1112 @-umount \$(MOUNT_PT)/proc
1113 @-if [ ! -f user-lfs-exist ]; then \\
[3a27393]1114 userdel lfs; \\
1115 rm -rf /home/lfs; \\
1116 fi;
1117
[0170229]1118EOF
1119) >> $MKFILE
[39d4d5c]1120fi
1121
1122
1123if [[ "${METHOD}" = "boot" ]]; then
1124(
1125 cat << EOF
[64cc345]1126
[3e1c0e2]1127all: makeboot
[39d4d5c]1128
1129makeboot: 023-creatingtoolsdir 024-creatingcrossdir 025-addinguser 026-settingenvironment \
1130 $cross_tools\
1131 $temptools \
1132 $chroottools \
1133 $boottools
1134 @\$(call echo_boot_finished,$VERSION)
1135
[d43a271]1136makesys: $testsuitetools $basicsystem $bootscripttools $bootabletools
[39d4d5c]1137 @\$(call echo_finished,$VERSION)
1138
1139
1140clean-all: clean
[db187c74]1141 rm -rf ./{clfs-commands,logs,Makefile,*.xsl,makefile-functions,packages,patches}
[39d4d5c]1142
1143clean: clean-makesys clean-makeboot clean-jhalfs
1144
1145clean-jhalfs:
1146 -if [ ! -f user-lfs-exist ]; then \\
1147 userdel lfs; \\
1148 rm -rf /home/lfs; \\
1149 fi;
1150 rm -rf \$(MOUNT_PT)/tools
1151 rm -f /tools
1152 rm -rf \$(MOUNT_PT)/cross-tools
1153 rm -f /cross-tools
1154 rm -f envars user-lfs-exist
1155 rm -f 02* logs/02*.log
[0170229]1156
[39d4d5c]1157clean-makeboot:
1158 rm -rf /tools/*
[64cc345]1159 rm -f $cross_tools && rm -f $temptools && rm -f $chroottools && rm -f $boottools
[39d4d5c]1160 rm -f restore-lfs-env sources-dir
1161 cd logs && rm -f $cross_tools && rm -f $temptools && rm -f $chroottools && rm -f $boottools && cd ..
1162
1163clean-makesys:
1164 -umount \$(MOUNT_PT)/sys
1165 -umount \$(MOUNT_PT)/proc
1166 -umount \$(MOUNT_PT)/dev/shm
1167 -umount \$(MOUNT_PT)/dev/pts
1168 -umount \$(MOUNT_PT)/dev
1169 rm -rf \$(MOUNT_PT)/{bin,boot,dev,etc,home,lib,lib64,media,mnt,opt,proc,root,sbin,srv,sys,tmp,usr,var}
1170 rm -f $basicsystem
1171 rm -f $bootscripttools
1172 rm -f $bootabletools
1173 cd logs && rm -f $basicsystem && rm -f $bootscripttools && rm -f $bootabletools && cd ..
1174
1175
1176restore-lfs-env:
1177 @\$(call echo_message, Building)
1178 @if [ -f /home/lfs/.bashrc.XXX ]; then \\
1179 mv -fv /home/lfs/.bashrc.XXX /home/lfs/.bashrc; \\
1180 fi;
1181 @if [ -f /home/lfs/.bash_profile.XXX ]; then \\
1182 mv -v /home/lfs/.bash_profile.XXX /home/lfs/.bash_profile; \\
1183 fi;
1184 @chown lfs:lfs /home/lfs/.bash* && \\
[9199a13]1185 touch \$@ && \\
1186 echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
1187 echo --------------------------------------------------------------------------------\$(WHITE)
[39d4d5c]1188
[3a27393]1189
[39d4d5c]1190EOF
1191) >> $MKFILE
1192fi
[0170229]1193
1194 # Bring over the items from the Makefile.tmp
1195 cat $MKFILE.tmp >> $MKFILE
1196 rm $MKFILE.tmp
1197 echo "Creating Makefile... ${BOLD}DONE${OFF}"
1198
1199}
1200
Note: See TracBrowser for help on using the repository browser.