source: common/makefile-functions@ fc6076c

2.3 2.3.x 2.4 ablfs ablfs-more legacy new_features trunk
Last change on this file since fc6076c was fc6076c, checked in by George Boudreau <georgeb@…>, 18 years ago

Who knew make would not like embedded control codes in its strings. For now tab_ works but nl_ doesn't

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