source: common/makefile-functions@ dd529e9

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

Revising makefile-functions

  • Property mode set to 100644
File size: 6.7 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 \
86 -printf "%p\t%s\t%u:%g\t%m\t%l\n" | sort > $(crFILELOGDIR)/$(1)
[0170229]87endef
88
[9c9775f]89define log_new_files_LUSER
90 @find $(BASEDIR) -xdev ! -path "$(BASEDIR)/$(SCRIPT_ROOT)/*" ! -path "$(BASEDIR)/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 > $(BASEDIR)$(crFILELOGDIR)/$(1)
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 ; \
104 echo $(WHITE)Please send the $(BOLD)$(MOUNT_PT)/jhalfs/$(1)$(WHITE) ; \
105 echo file to $(BOLD)manuel@linuxfromscratch.org$(WHITE) ; \
106 echo ; \
107 echo That will help us to keep more accurate SBU and ; \
108 echo disk usage values into the book. Thanks. ; \
109 echo $(BOLD)--------------------------------------------------------------------------------$(WHITE)
[9e4b9a1]110endef
111
[0170229]112define echo_finished
113 @echo $(BOLD)
114 @echo --------------------------------------------------------------------------------
115 @echo $(BOLD) Finished the build of $(BLUE)$(1)$(BOLD)
116 @echo --------------------------------------------------------------------------------
[9c9775f]117 @echo $(tab_)$(tab_)$(RED)W A R N I N G$(BOLD)
[0170229]118 @echo --------------------------------------------------------------------------------
119 @echo
[769a219]120 @echo To be able to boot your new system you need to follow
[0170229]121 @echo the next steps:$(WHITE)
122 @echo
[9c9775f]123 @echo $(tab_)- Enter to the chroot using the command found
124 @echo $(tab_)in the section -Entering the Chroot Environment-
125 @echo $(tab_)except if building CLFS with METHOD=boot.
[0170229]126 @echo
[9c9775f]127 @echo $(tab_)- Set a password for the root user.
[0170229]128 @echo
[9c9775f]129 @echo $(tab_)- Edit or create /etc/fstab, /etc/hosts, /etc/sysconfig/clock,
130 @echo $(tab_)/etc/sysconfig/console, /etc/sysconfig/network,
131 @echo $(tab_)/etc/sysconfig//network-devices/ifconfig.eth0/ipv4 and
132 @echo $(tab_)any other configuration file required to suit your needs.
[0170229]133 @echo
[9c9775f]134 @echo $(tab_)- Exit from the chroot.
[0170229]135 @echo
[9c9775f]136 @echo $(tab_)- Set-up the boot loader, except if building CLFS with METHOD=boot.
137 @echo $(tab_)You can set-up the host bootloader or the new boot-loader
138 @echo $(tab_)installed on the new system.
139 @echo $(tab_)If the last, you must to mount the virtual filesystems, re-enter
140 @echo $(tab_)the chroot and be sure that /dev is populated with the
141 @echo $(tab_)required devices before configure the boot-loader. When ready,
142 @echo $(tab_)exit from the chroot and umount the filesystems
[0170229]143 @echo
144 @echo If you are an experienced LFS user, several of those steps can be
145 @echo skipped or done in a different way. But then, that is something
146 @echo that you already know and there is no need to discuss it here.
147 @echo $(BOLD)
148 @echo --------------------------------------------------------------------------------
[9c9775f]149 @echo $(tab_)$(tab_)$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD)
[0170229]150 @echo --------------------------------------------------------------------------------$(WHITE)
151endef
152
153define echo_boot_finished
154 @echo $(BOLD)
155 @echo --------------------------------------------------------------------------------
156 @echo $(BOLD) Finished building a minimal boot system for $(BLUE)$(1)$(BOLD)
157 @echo --------------------------------------------------------------------------------
[9c9775f]158 @echo $(tab_)$(tab_)$(RED)W A R N I N G$(BOLD)
[0170229]159 @echo --------------------------------------------------------------------------------
160 @echo
161 @echo The build is not complete. Follow the next steps:$(WHITE)
162 @echo
[9c9775f]163 @echo $(tab_)- Edit or create $(MOUNT_PT)/etc/fstab
164 @echo $(tab_) and any other configuration file required to suit your needs.
[0170229]165 @echo $(BOLD)
166 @echo $(BOLD)$(YELLOW)
[623c323]167 @echo 1.If it is necessary, transfer the newly created partition to the target machine
[769a219]168 @echo 2.Boot the new partition.
169 @echo 3.Once you are logged in issue the following commands
[9c9775f]170 @echo $(tab_) $(BOLD)cd /jhalfs
171 @echo $(tab_) $(BOLD)make makesys
[0170229]172 @echo The build process should resume. Follow any instructions that appear.
173 @echo --------------------------------------------------------------------------------
[9c9775f]174 @echo $(tab_)$(tab_)$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD)
[0170229]175 @echo --------------------------------------------------------------------------------$(WHITE)
176endef
Note: See TracBrowser for help on using the repository browser.