source: common/makefile-functions@ 1330ebc

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

Ported CUSTOM_TOOLS support to all books.

  • Property mode set to 100644
File size: 7.1 KB
Line 
1
2# $Id$
3
4BOLD = "[0;1m"
5RED = "[1;31m"
6GREEN = "[0;32m"
7ORANGE = "[0;33m"
8BLUE = "[1;34m"
9WHITE = "[00m"
10YELLOW = "[1;33m"
11
12OFF = "[0m"
13REVERSE = "[7m"
14
15tab_ = " "
16nl_ = ""
17
18#==== BUILD MESSAGES ===
19
20define echo_PHASE
21 @echo $(BOLD)--------------------------------------------------------------------------------
22 @echo $(tab_)$(tab_)Executing $(BLUE)$(1)$(WHITE) scripts
23 @echo $(BOLD)--------------------------------------------------------------------------------
24 #echo $(WHITE)
25endef
26
27define echo_SU_request
28 @echo $(BOLD)--------------------------------------------------------------------------------
29 @echo $(BLUE)$@
30 @echo $(WHITE)ROOT privilege is required to perform a number commands
31 @echo sudo will request a password to all high privilege cmds to execute correctly
32endef
33
34define echo_SULUSER_request
35 @echo $(BOLD)--------------------------------------------------------------------------------
36 @echo $(BOLD)$(BLUE)$@
37 @echo $(WHITE)You are going to log into the user account $(BOLD)$(YELLOW)$(LUSER)$(OFF)
38 @echo sudo requires a password
39endef
40
41define echo_CHROOT_request
42 @echo $(BOLD)--------------------------------------------------------------------------------
43 @echo $(BOLD)$(BLUE)$@
44 @echo $(WHITE)You are going to CHROOT into $(MOUNT_PT) $(BOLD)$(YELLOW)$(LUSER)$(OFF)
45 @echo a password is required
46endef
47
48define echo_message
49 @echo $(BOLD)--------------------------------------------------------------------------------
50 @echo $(BOLD)$(1) target $(BLUE)$@$(BOLD)$(WHITE)
51endef
52
53#=======================
54
55
56#=== BUILD FUNCTIONS ===
57
58define remove_existing_dirs
59 @PKG_PATH=`ls -t $(SRCSDIR)/$(1) | head -n1` && \
60 ROOT=`tar -tf $$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'` && \
61 rm -rf $(SRCSDIR)/$$ROOT && \
62 rm -rf $(SRCSDIR)/$${ROOT%-*}-build
63endef
64
65define remove_existing_dirs2
66 @PKG_PATH=`ls -t $(SRC)/$(1) | head -n1` && \
67 ROOT=`tar -tf $$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'` && \
68 rm -rf $(SRC)/$$ROOT && \
69 rm -rf $(SRC)/$${ROOT%-*}-build
70endef
71
72#==#
73
74define unpack
75 @cd $(SRCSDIR) && \
76 tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
77endef
78
79define unpack2
80 @cd $(SRC) && \
81 tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
82endef
83
84#==#
85
86define get_pkg_root
87 @ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
88 if [ "$(1)" != "nouser" ]; then \
89 echo "export PKGDIR=$(SRCSDIR)/$$ROOT" > envars; \
90 chown -R $(LUSER) $(SRCSDIR)/$$ROOT; \
91 else \
92 echo "export PKGDIR=$(crSRCSDIR)/$$ROOT" > envars; \
93 fi;
94endef
95
96define get_pkg_root2
97 @ROOT=`head -n1 $(SRC)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
98 echo "export PKGDIR=$(SRC)/$$ROOT" > envars
99endef
100
101define get_pkg_root_LUSER
102 @ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
103 echo "export PKGDIR=$(SRCSDIR)/$$ROOT" > envars
104endef
105
106#==#
107
108define remove_build_dirs
109 @ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
110 rm -rf $(SRCSDIR)/$$ROOT && \
111 rm -rf $(SRCSDIR)/$(1)-build
112endef
113
114define remove_build_dirs2
115 @ROOT=`head -n1 $(SRC)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
116 rm -rf $(SRC)/$$ROOT && \
117 rm -rf $(SRC)/$(1)-build
118endef
119
120#==#
121
122define housekeeping
123 @touch $@ && \
124 sleep .25 && \
125 echo -e "\n" $(BOLD)Target $(BLUE)$@ $(WHITE)$(BOLD)OK && \
126 echo --------------------------------------------------------------------------------$(WHITE)
127
128endef
129
130#=======================
131
132
133#==== FINAL MESSAGES ===
134
135define echo_report
136 @echo; \
137 echo $(BOLD) The report file $(BLUE)$(1)$(BOLD) has been created; \
138 echo; \
139 echo $(WHITE)Please send the $(BOLD)$(MOUNT_PT)/jhalfs/$(1)$(WHITE); \
140 echo file to $(BOLD)manuel@linuxfromscratch.org$(WHITE); \
141 echo; \
142 echo That will help us to keep more accurate SBU and; \
143 echo disk usage values into the book. Thanks.
144endef
145
146define echo_finished
147 @echo $(BOLD)
148 @echo --------------------------------------------------------------------------------
149 @echo $(BOLD) Finished the build of $(BLUE)$(1)$(BOLD)
150 @echo --------------------------------------------------------------------------------
151 @echo $(tab_)$(tab_)$(RED)W A R N I N G$(BOLD)
152 @echo --------------------------------------------------------------------------------
153 @echo
154 @echo To be able to boot your new system you need to follow
155 @echo the next steps:$(WHITE)
156 @echo
157 @echo $(tab_)- Enter to the chroot using the command found
158 @echo $(tab_)in the section -Entering the Chroot Environment-
159 @echo $(tab_)except if building CLFS with METHOD=boot.
160 @echo
161 @echo $(tab_)- Set a password for the root user.
162 @echo
163 @echo $(tab_)- Edit or create /etc/fstab, /etc/hosts, /etc/sysconfig/clock,
164 @echo $(tab_)/etc/sysconfig/console, /etc/sysconfig/network,
165 @echo $(tab_)/etc/sysconfig//network-devices/ifconfig.eth0/ipv4 and
166 @echo $(tab_)any other configuration file required to suit your needs.
167 @echo
168 @echo $(tab_)- Exit from the chroot.
169 @echo
170 @echo $(tab_)- Set-up the boot loader, except if building CLFS with METHOD=boot.
171 @echo $(tab_)You can set-up the host bootloader or the new boot-loader
172 @echo $(tab_)installed on the new system.
173 @echo $(tab_)If the last, you must to mount the virtual filesystems, re-enter
174 @echo $(tab_)the chroot and be sure that /dev is populated with the
175 @echo $(tab_)required devices before configure the boot-loader. When ready,
176 @echo $(tab_)exit from the chroot and umount the filesystems
177 @echo
178 @echo If you are an experienced LFS user, several of those steps can be
179 @echo skipped or done in a different way. But then, that is something
180 @echo that you already know and there is no need to discuss it here.
181 @echo $(BOLD)
182 @echo --------------------------------------------------------------------------------
183 @echo $(tab_)$(tab_)$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD)
184 @echo --------------------------------------------------------------------------------$(WHITE)
185endef
186
187define echo_boot_finished
188 @echo $(BOLD)
189 @echo --------------------------------------------------------------------------------
190 @echo $(BOLD) Finished building a minimal boot system for $(BLUE)$(1)$(BOLD)
191 @echo --------------------------------------------------------------------------------
192 @echo $(tab_)$(tab_)$(RED)W A R N I N G$(BOLD)
193 @echo --------------------------------------------------------------------------------
194 @echo
195 @echo The build is not complete. Follow the next steps:$(WHITE)
196 @echo
197 @echo $(tab_)- Edit or create $(MOUNT_PT)/etc/fstab
198 @echo $(tab_) and any other configuration file required to suit your needs.
199 @echo $(BOLD)
200 @echo $(BOLD)$(YELLOW)
201 @echo 1.If it is necessary, transfer the newly created partition to the target machine
202 @echo 2.Boot the new partition.
203 @echo 3.Once you are logged in issue the following commands
204 @echo $(tab_) $(BOLD)cd /jhalfs
205 @echo $(tab_) $(BOLD)make makesys
206 @echo The build process should resume. Follow any instructions that appear.
207 @echo --------------------------------------------------------------------------------
208 @echo $(tab_)$(tab_)$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD)
209 @echo --------------------------------------------------------------------------------$(WHITE)
210endef
Note: See TracBrowser for help on using the repository browser.