source: common/makefile-functions@ f1f871c

experimental
Last change on this file since f1f871c 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
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"
13REVERSE = "[7m"
14
[9c9775f]15tab_ = " "
16nl_ = ""
17
18#==== BUILD MESSAGES ===
[50fb011]19
[d14903f]20define echo_PHASE
21 @echo $(BOLD)--------------------------------------------------------------------------------
[9c9775f]22 @echo $(tab_)$(tab_)Executing $(BLUE)$(1)$(WHITE) scripts
[d14903f]23 @echo $(BOLD)--------------------------------------------------------------------------------
[9c9775f]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)
[d14903f]31endef
32
[50fb011]33define echo_SU_request
34 @echo $(BOLD)--------------------------------------------------------------------------------
35 @echo $(BLUE)$@
36 @echo $(WHITE)ROOT privilege is required to perform a number commands
[7d4cc81]37 @echo sudo will request a password to all high privilege cmds to execute correctly
[50fb011]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)
[9c9775f]44 @echo sudo requires a password
[50fb011]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
[0170229]53
54define echo_message
[50fb011]55 @echo $(BOLD)--------------------------------------------------------------------------------
56 @echo $(BOLD)$(1) target $(BLUE)$@$(BOLD)$(WHITE)
[0170229]57endef
58
[f11a672]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
[398a037]68endef
69
[f11a672]70#=======================
[398a037]71
[50fb011]72
[f11a672]73#=== INSTALL_LOG FUNCTIONS ===
[9c9775f]74
75define touch_timestamp
76 @touch $(SRC)/timestamp-marker && sleep 1
[0170229]77endef
78
[9c9775f]79define touch_timestamp_LUSER
80 @touch $(SRCSDIR)/timestamp-marker && sleep 1
[0170229]81endef
82
[9c9775f]83define log_new_files
84 @find / -xdev ! -path "/$(SCRIPT_ROOT)/*" ! -path "/tmp/*" ! -path "$(SRC)/*" \
85 -newer $(SRC)/timestamp-marker -not -type d \
[aafcfa9]86 -printf "%p\t%s\t%u:%g\t%m\t%l\n" | sort > $(FILELOGDIR)/$(1)
[0170229]87endef
88
[9c9775f]89define log_new_files_LUSER
[aafcfa9]90 @find $(MOUNT_PT) -xdev ! -path "$(MOUNT_PT)/$(SCRIPT_ROOT)/*" ! -path "$(MOUNT_PT)/tmp/*" ! -path "$(SRCSDIR)/*" \
[9c9775f]91 -newer $(SRCSDIR)/timestamp-marker -not -type d \
[aafcfa9]92 -printf "%p\t%s\t%u:%g\t%m\t%l\n" | sort > $(MOUNT_PT)$(FILELOGDIR)/$(1)
[9c9775f]93endef
94
95#=======================
96
97
98#==== FINAL MESSAGES ===
99
[9e4b9a1]100define echo_report
[9c9775f]101 echo ; \
102 echo $(BOLD) The report file $(BLUE)$(1)$(BOLD) has been created ; \
103 echo ; \
[aafcfa9]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) ; \
[9c9775f]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)
[9e4b9a1]111endef
112
[0170229]113define echo_finished
114 @echo $(BOLD)
115 @echo --------------------------------------------------------------------------------
116 @echo $(BOLD) Finished the build of $(BLUE)$(1)$(BOLD)
117 @echo --------------------------------------------------------------------------------
[9c9775f]118 @echo $(tab_)$(tab_)$(RED)W A R N I N G$(BOLD)
[0170229]119 @echo --------------------------------------------------------------------------------
120 @echo
[769a219]121 @echo To be able to boot your new system you need to follow
[0170229]122 @echo the next steps:$(WHITE)
123 @echo
[9c9775f]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.
[0170229]127 @echo
[9c9775f]128 @echo $(tab_)- Set a password for the root user.
[0170229]129 @echo
[9c9775f]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.
[0170229]134 @echo
[9c9775f]135 @echo $(tab_)- Exit from the chroot.
[0170229]136 @echo
[9c9775f]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
[0170229]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 --------------------------------------------------------------------------------
[9c9775f]150 @echo $(tab_)$(tab_)$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD)
[0170229]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 --------------------------------------------------------------------------------
[9c9775f]159 @echo $(tab_)$(tab_)$(RED)W A R N I N G$(BOLD)
[0170229]160 @echo --------------------------------------------------------------------------------
161 @echo
162 @echo The build is not complete. Follow the next steps:$(WHITE)
163 @echo
[9c9775f]164 @echo $(tab_)- Edit or create $(MOUNT_PT)/etc/fstab
165 @echo $(tab_) and any other configuration file required to suit your needs.
[0170229]166 @echo $(BOLD)
167 @echo $(BOLD)$(YELLOW)
[623c323]168 @echo 1.If it is necessary, transfer the newly created partition to the target machine
[769a219]169 @echo 2.Boot the new partition.
170 @echo 3.Once you are logged in issue the following commands
[aafcfa9]171 @echo $(tab_) $(BOLD)cd /$(SCRIPT_ROOT)
[9c9775f]172 @echo $(tab_) $(BOLD)make makesys
[0170229]173 @echo The build process should resume. Follow any instructions that appear.
174 @echo --------------------------------------------------------------------------------
[9c9775f]175 @echo $(tab_)$(tab_)$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD)
[0170229]176 @echo --------------------------------------------------------------------------------$(WHITE)
177endef
Note: See TracBrowser for help on using the repository browser.