source: common/makefile-functions@ 1f81129

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

Reordered makefile_functions.

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