source: common/makefile-functions@ 5a9b043

experimental
Last change on this file since 5a9b043 was aafcfa9, checked in by Manuel Canales Esparcia <manuel@…>, 17 years ago

Makefile envars and fuctions revised.

  • Property mode set to 100644
File size: 6.8 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 sh_echo_PHASE
28 echo $(BOLD)--------------------------------------------------------------------------------;\
29 echo $(tab_)$(tab_)Executing $(BLUE)$(1)$(WHITE) scripts; \
30 echo $(BOLD)--------------------------------------------------------------------------------echo $(WHITE)
31endef
32
33define echo_SU_request
34 @echo $(BOLD)--------------------------------------------------------------------------------
35 @echo $(BLUE)$@
36 @echo $(WHITE)ROOT privilege is required to perform a number commands
37 @echo sudo will request a password to all high privilege cmds to execute correctly
38endef
39
40define echo_SULUSER_request
41 @echo $(BOLD)--------------------------------------------------------------------------------
42 @echo $(BOLD)$(BLUE)$@
43 @echo $(WHITE)You are going to log into the user account $(BOLD)$(YELLOW)$(LUSER)$(OFF)
44 @echo sudo requires a password
45endef
46
47define echo_CHROOT_request
48 @echo $(BOLD)--------------------------------------------------------------------------------
49 @echo $(BOLD)$(BLUE)$@
50 @echo $(WHITE)You are going to CHROOT into $(MOUNT_PT) $(BOLD)$(YELLOW)$(LUSER)$(OFF)
51 @echo a password is required
52endef
53
54define echo_message
55 @echo $(BOLD)--------------------------------------------------------------------------------
56 @echo $(BOLD)$(1) target $(BLUE)$@$(BOLD)$(WHITE)
57endef
58
59define housekeeping
60 @touch $@ && \
61 sleep .25 && \
62 echo -e "\n" $(BOLD)Target $(BLUE)$@ $(WHITE)$(BOLD)OK && \
63 echo --------------------------------------------------------------------------------$(WHITE) && \
64 if [ "$(BREAKPOINT)" = "$@" ] ; then \
65 echo $(tab_)$(RED)The build has been stopped at $(BLUE)$@ $(RED)as requested$(WHITE) ; \
66 false ; \
67 fi
68endef
69
70#=======================
71
72
73#=== INSTALL_LOG FUNCTIONS ===
74
75define touch_timestamp
76 @touch $(SRC)/timestamp-marker && sleep 1
77endef
78
79define touch_timestamp_LUSER
80 @touch $(SRCSDIR)/timestamp-marker && sleep 1
81endef
82
83define log_new_files
84 @find / -xdev ! -path "/$(SCRIPT_ROOT)/*" ! -path "/tmp/*" ! -path "$(SRC)/*" \
85 -newer $(SRC)/timestamp-marker -not -type d \
86 -printf "%p\t%s\t%u:%g\t%m\t%l\n" | sort > $(FILELOGDIR)/$(1)
87endef
88
89define log_new_files_LUSER
90 @find $(MOUNT_PT) -xdev ! -path "$(MOUNT_PT)/$(SCRIPT_ROOT)/*" ! -path "$(MOUNT_PT)/tmp/*" ! -path "$(SRCSDIR)/*" \
91 -newer $(SRCSDIR)/timestamp-marker -not -type d \
92 -printf "%p\t%s\t%u:%g\t%m\t%l\n" | sort > $(MOUNT_PT)$(FILELOGDIR)/$(1)
93endef
94
95#=======================
96
97
98#==== FINAL MESSAGES ===
99
100define echo_report
101 echo ; \
102 echo $(BOLD) The report file $(BLUE)$(1)$(BOLD) has been created ; \
103 echo ; \
104 echo $(WHITE)If this is a development book build, please send the ; \
105 echo $(BOLD)$(MOUNT_PT)/$(SCRIPT_ROOT)/$(1)$(WHITE) file to ; \
106 echo $(BOLD)manuel@linuxfromscratch.org$(WHITE) ; \
107 echo ; \
108 echo That will help us to keep more accurate SBU and ; \
109 echo disk usage values into the book. Thanks. ; \
110 echo $(BOLD)--------------------------------------------------------------------------------$(WHITE)
111endef
112
113define echo_finished
114 @echo $(BOLD)
115 @echo --------------------------------------------------------------------------------
116 @echo $(BOLD) Finished the build of $(BLUE)$(1)$(BOLD)
117 @echo --------------------------------------------------------------------------------
118 @echo $(tab_)$(tab_)$(RED)W A R N I N G$(BOLD)
119 @echo --------------------------------------------------------------------------------
120 @echo
121 @echo To be able to boot your new system you need to follow
122 @echo the next steps:$(WHITE)
123 @echo
124 @echo $(tab_)- Enter to the chroot using the command found
125 @echo $(tab_)in the section -Entering the Chroot Environment-
126 @echo $(tab_)except if building CLFS with METHOD=boot.
127 @echo
128 @echo $(tab_)- Set a password for the root user.
129 @echo
130 @echo $(tab_)- Edit or create /etc/fstab, /etc/hosts, /etc/sysconfig/clock,
131 @echo $(tab_)/etc/sysconfig/console, /etc/sysconfig/network,
132 @echo $(tab_)/etc/sysconfig//network-devices/ifconfig.eth0/ipv4 and
133 @echo $(tab_)any other configuration file required to suit your needs.
134 @echo
135 @echo $(tab_)- Exit from the chroot.
136 @echo
137 @echo $(tab_)- Set-up the boot loader, except if building CLFS with METHOD=boot.
138 @echo $(tab_)You can set-up the host bootloader or the new boot-loader
139 @echo $(tab_)installed on the new system.
140 @echo $(tab_)If the last, you must to mount the virtual filesystems, re-enter
141 @echo $(tab_)the chroot and be sure that /dev is populated with the
142 @echo $(tab_)required devices before configure the boot-loader. When ready,
143 @echo $(tab_)exit from the chroot and umount the filesystems
144 @echo
145 @echo If you are an experienced LFS user, several of those steps can be
146 @echo skipped or done in a different way. But then, that is something
147 @echo that you already know and there is no need to discuss it here.
148 @echo $(BOLD)
149 @echo --------------------------------------------------------------------------------
150 @echo $(tab_)$(tab_)$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD)
151 @echo --------------------------------------------------------------------------------$(WHITE)
152endef
153
154define echo_boot_finished
155 @echo $(BOLD)
156 @echo --------------------------------------------------------------------------------
157 @echo $(BOLD) Finished building a minimal boot system for $(BLUE)$(1)$(BOLD)
158 @echo --------------------------------------------------------------------------------
159 @echo $(tab_)$(tab_)$(RED)W A R N I N G$(BOLD)
160 @echo --------------------------------------------------------------------------------
161 @echo
162 @echo The build is not complete. Follow the next steps:$(WHITE)
163 @echo
164 @echo $(tab_)- Edit or create $(MOUNT_PT)/etc/fstab
165 @echo $(tab_) and any other configuration file required to suit your needs.
166 @echo $(BOLD)
167 @echo $(BOLD)$(YELLOW)
168 @echo 1.If it is necessary, transfer the newly created partition to the target machine
169 @echo 2.Boot the new partition.
170 @echo 3.Once you are logged in issue the following commands
171 @echo $(tab_) $(BOLD)cd /$(SCRIPT_ROOT)
172 @echo $(tab_) $(BOLD)make makesys
173 @echo The build process should resume. Follow any instructions that appear.
174 @echo --------------------------------------------------------------------------------
175 @echo $(tab_)$(tab_)$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD)
176 @echo --------------------------------------------------------------------------------$(WHITE)
177endef
Note: See TracBrowser for help on using the repository browser.