source: common/makefile-functions@ e9642b9

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

First commit of CLFS changes to new Makefile scheme.. work still to be done on optimize function and ICA/farce tools

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