source: common/makefile-functions@ 0306777

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

Ported Makefile clean-up and 0/1 to n/y migration code from experimental.
There is no obvious bugs, let users to find hidden bugs.

  • Property mode set to 100644
File size: 5.6 KB
Line 
1
2# $Id$
3
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)
15 @echo $(WHITE)
16endef
17
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
67define unpack
68 @cd $(SRCSDIR) && \
69 tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
70endef
71
72define unpack2
73 @cd $(SRCSDIR) && \
74 /tools/bin/tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
75endef
76
77define unpack3
78 @cd $(SRC) && \
79 tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
80endef
81
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
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
101 @echo To be able to boot your new system you need to follow
102 @echo the next steps:$(WHITE)
103 @echo
104 @echo -e \\t- Enter to the chroot using the command found
105 @echo -e \\tin the section -Entering the Chroot Environment-
106 @echo -e \\texcept if building CLFS with METHOD=boot.
107 @echo
108 @echo -e \\t- Set a password for the root user.
109 @echo
110 @echo -e \\t- Edit or create /etc/fstab, /etc/hosts, /etc/sysconfig/clock,
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
115 @echo -e \\t- Exit from the chroot.
116 @echo
117 @echo -e \\t- Set-up the boot loader, except if building CLFS with METHOD=boot.
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
121 @echo -e \\tthe chroot and be sure that /dev is populated with the
122 @echo -e \\trequired devices before configure the boot-loader. When ready,
123 @echo -e \\texit from the chroot and umount the filesystems
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
144 @echo -e \\t- Edit or create $(MOUNT_PT)/etc/fstab
145 @echo -e \\t and any other configuration file required to suit your needs.
146 @echo $(BOLD)
147 @echo $(BOLD)$(YELLOW)
148 @echo 1.If it is necessary, transfer the newly created partition to the target machine
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
152 @echo -e \\t $(BOLD)make makesys
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.