source: CLFS/master.sh@ 2eb1f44

1.0 2.3 2.3.x 2.4 ablfs ablfs-more legacy new_features trunk
Last change on this file since 2eb1f44 was 2eb1f44, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Dirty hack to fix CLFS bootscripts unpacking.
Fixed also udev-rules installation when METHOD=boot.

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