source: common/makefile-functions@ 0208570

experimental
Last change on this file since 0208570 was 398a037, checked in by George Boudreau <georgeb@…>, 18 years ago

Mods to most files to allow for reduction of internal functions and reduction in the size of the generated makefile

  • Property mode set to 100644
File size: 5.6 KB
RevLine 
[c3c4e1d]1
2# $Id$
3
[0170229]4BOLD= "[0;1m"
5RED= "[1;31m"
6GREEN= "[0;32m"
7ORANGE= "[0;33m"
8BLUE= "[1;34m"
9WHITE= "[00m"
10
11define echo_message
12 @echo $(BOLD)
13 @echo --------------------------------------------------------------------------------
14 @echo $(BOLD)$(1) target $(BLUE)$@$(BOLD)
[9199a13]15 @echo $(WHITE)
[0170229]16endef
17
[398a037]18define remove_existing_dirs
19 @PKG_PATH=`ls -t $(SRCSDIR)/$(1) | head -n1` && \
20 ROOT=`tar -tf $$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'` && \
21 rm -rf $(SRCSDIR)/$$ROOT && \
22 rm -rf $(SRCSDIR)/$${ROOT%-*}-build
23endef
24
25define remove_existing_dirs2
26 @PKG_PATH=\`ls -t $(SRC)/$(1) | head -n1\` && \
27 ROOT=`tar -tf $$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'` && \
28 rm -rf $(SRC)/$$ROOT && \
29 rm -rf $(SRC)/$${ROOT-*}-build
30endef
31
32define remove_build_dirs
33 @ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
34 rm -rf $(SRCSDIR)/$$ROOT && \
35 rm -rf $(SRCSDIR)/$(1)-build
36endef
37
38define remove_build_dirs2
39 @ROOT=`head -n1 $(SRC)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
40 rm -rf $(SRC)/$$ROOT && \
41 rm -rf $(SRC)/$(1)-build
42endef
43
44define housekeeping
45 @touch $@ && \
46 sleep .25 && \
47 echo -e "\n\n "$(BOLD)Target $(BLUE)$@ $(BOLD)OK && \
48 echo --------------------------------------------------------------------------------$(WHITE)
49
50endef
51
52define get_pkg_root
53 @ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
54 if [ "$(1)" != "nouser" ]; then \
55 echo "export PKGDIR=$(SRCSDIR)/$$ROOT" > envars; \
56 chown -R $(LUSER) $(SRCSDIR)/$$ROOT; \
57 else \
58 echo "export PKGDIR=$(crSRCSDIR)/$$ROOT" > envars; \
59 fi;
60endef
61
62define get_pkg_root2
63 @ROOT=`head -n1 $(SRC)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
64 echo "export PKGDIR=$(SRC)/$$ROOT" > envars
65endef
66
[0170229]67define unpack
[398a037]68 @cd $(SRCSDIR) && \
[460ea63]69 tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
[0170229]70endef
71
72define unpack2
[398a037]73 @cd $(SRCSDIR) && \
[460ea63]74 /tools/bin/tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
[0170229]75endef
76
77define unpack3
[c3c4e1d]78 @cd $(SRC) && \
[460ea63]79 tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
[0170229]80endef
81
[9e4b9a1]82define echo_report
83 @echo
84 @echo $(BOLD) The report file $(BLUE)$(1)$(BOLD) has been created
85 @echo
86 @echo ${WHITE}Please send the $(BOLD)$(MOUNT_PT)/jhalfs/$(1)$(WHITE)
87 @echo file to $(BOLD)manuel@linuxfromscratch.org$(WHITE)
88 @echo
89 @echo That will help us to keep more accurate SBU and
90 @echo disk usage values into the book. Thanks.
91endef
92
[0170229]93define echo_finished
94 @echo $(BOLD)
95 @echo --------------------------------------------------------------------------------
96 @echo $(BOLD) Finished the build of $(BLUE)$(1)$(BOLD)
97 @echo --------------------------------------------------------------------------------
98 @echo -e \\t\\t$(RED)W A R N I N G$(BOLD)
99 @echo --------------------------------------------------------------------------------
100 @echo
[769a219]101 @echo To be able to boot your new system you need to follow
[0170229]102 @echo the next steps:$(WHITE)
103 @echo
104 @echo -e \\t- Enter to the chroot using the command found
[67e3bc3]105 @echo -e \\tin the section -Entering the Chroot Environment-
[3b63c8c]106 @echo -e \\texcept if building CLFS with METHOD=boot.
[0170229]107 @echo
[9199a13]108 @echo -e \\t- Set a password for the root user.
[0170229]109 @echo
[3b63c8c]110 @echo -e \\t- Edit or create /etc/fstab, /etc/hosts, /etc/sysconfig/clock,
[0170229]111 @echo -e \\t/etc/sysconfig/console, /etc/sysconfig/network,
112 @echo -e \\t/etc/sysconfig//network-devices/ifconfig.eth0/ipv4 and
113 @echo -e \\tany other configuration file required to suit your needs.
114 @echo
[9199a13]115 @echo -e \\t- Exit from the chroot.
[0170229]116 @echo
[3b63c8c]117 @echo -e \\t- Set-up the boot loader, except if building CLFS with METHOD=boot.
[9199a13]118 @echo -e \\tYou can set-up the host bootloader or the new boot-loader
119 @echo -e \\tinstalled on the new system.
120 @echo -e \\tIf the last, you must to mount the virtual filesystems, re-enter
[3b63c8c]121 @echo -e \\tthe chroot and be sure that /dev is populated with the
[9199a13]122 @echo -e \\trequired devices before configure the boot-loader. When ready,
123 @echo -e \\texit from the chroot and umount the filesystems
[0170229]124 @echo
125 @echo If you are an experienced LFS user, several of those steps can be
126 @echo skipped or done in a different way. But then, that is something
127 @echo that you already know and there is no need to discuss it here.
128 @echo $(BOLD)
129 @echo --------------------------------------------------------------------------------
130 @echo -e \\t\\t$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD)
131 @echo --------------------------------------------------------------------------------$(WHITE)
132endef
133
134define echo_boot_finished
135 @echo $(BOLD)
136 @echo --------------------------------------------------------------------------------
137 @echo $(BOLD) Finished building a minimal boot system for $(BLUE)$(1)$(BOLD)
138 @echo --------------------------------------------------------------------------------
139 @echo -e \\t\\t$(RED)W A R N I N G$(BOLD)
140 @echo --------------------------------------------------------------------------------
141 @echo
142 @echo The build is not complete. Follow the next steps:$(WHITE)
143 @echo
[3b63c8c]144 @echo -e \\t- Edit or create $(MOUNT_PT)/etc/fstab
[f80c1e0]145 @echo -e \\t and any other configuration file required to suit your needs.
[0170229]146 @echo $(BOLD)
147 @echo $(BOLD)$(YELLOW)
[623c323]148 @echo 1.If it is necessary, transfer the newly created partition to the target machine
[769a219]149 @echo 2.Boot the new partition.
150 @echo 3.Once you are logged in issue the following commands
151 @echo -e \\t $(BOLD})cd /jhalfs
[f80c1e0]152 @echo -e \\t $(BOLD)make makesys
[0170229]153 @echo The build process should resume. Follow any instructions that appear.
154 @echo --------------------------------------------------------------------------------
155 @echo -e \\t\\t$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD)
156 @echo --------------------------------------------------------------------------------$(WHITE)
157endef
Note: See TracBrowser for help on using the repository browser.