r356 - in x86/trunk: packages/binutils packages/template scripts

jhuntwork at linuxfromscratch.org jhuntwork at linuxfromscratch.org
Sun Jul 17 20:13:32 PDT 2005


Author: jhuntwork
Date: 2005-07-17 21:13:31 -0600 (Sun, 17 Jul 2005)
New Revision: 356

Modified:
   x86/trunk/packages/binutils/Makefile
   x86/trunk/packages/template/Makefile
   x86/trunk/scripts/functions
Log:
Slight tweak to template file and updated binutils to new layout

Modified: x86/trunk/packages/binutils/Makefile
===================================================================
--- x86/trunk/packages/binutils/Makefile	2005-07-18 02:32:26 UTC (rev 355)
+++ x86/trunk/packages/binutils/Makefile	2005-07-18 03:13:31 UTC (rev 356)
@@ -1,81 +1,168 @@
 # Binutils Makefile
+#==============================================================================
 
-# Package versions
 NM= binutils
-VRS= 2.15.94.0.2.2
+VRS= 2.16.1
 DIR= $(NM)-$(VRS)
 FILE= $(DIR).tar.bz2
 URL= $(HTTP)/$(NM)/$(FILE)
 
-# RULES
+# Targets
+# =============================================================================
 
-.PHONY: pass1 pass2 chroot-re-adjust-toolchain clean chroot stage2
+include $(ROOT)/scripts/functions
 
-pass1:
-	@echo ""
-	@echo "=====> Building $(NM) Pass 1"
-	@echo ""
-	@if [ ! -f $(SRC)/$(FILE) ] ; then $(WGET) $(URL) && \
-	 mv $(FILE) $(SRC) ; fi
-	@if [ ! -f $(WD)/bin/ld ] ; then unpack $(SRC)/$(FILE) && cd $(DIR) && \
-	 mkdir ../$(NM)-build && cd ../$(NM)-build && \
-	 ../$(DIR)/configure --prefix=$(WD) --disable-nls && make && \
-	make install && \
-	make -C ld clean && \
-	make -j3 -C ld LDFLAGS="-all-static" LIB_PATH=/tools/lib ; fi
+$(FILE):
+	@cd $(SRC) ; $(WGET) $(FILE)
+	@ln -s $(SRC)/$(FILE) .
 
+pass1: Makefile $(FILE)
+	@unpack $(FILE)
+	@make -C $(DIR) -f ../Makefile compile-$@
+	@cp $(SRC)/$(FILE) $(LFSSRC)
+	@touch $@
+
+compile-pass1:
+	@$(call echo_message, Configuring)
+#==============================================================================
+# Configure commands below \/
+#==============================================================================
+	@$(sep_dir)
+	@../$(DIR)/configure --prefix=$(WD) --disable-nls >../$(DIR)-$@.log
+#
+#==Status Messages==========================================
+#
+	@$(OK)
+	@$(call echo_message, Making)
+#==============================================================================
+# Make commands below \/
+#==============================================================================
+	@make $(PM) >>../$(DIR)-$@.log
+#
+#==Status Messages==========================================
+#
+	@$(OK)
+	@$(call echo_message, Installing)
+#==============================================================================
+# Install commands below \/
+#==============================================================================
+	@make install >>../$(DIR)-$@.log
+	@make -C ld clean >>../$(DIR)-$@.log
+	@make -C ld LIB_PATH=$(WD)/lib >>../$(DIR)-$@.log
+#
+#==Status Messages==========================================
+#
+	@$(OK)
+
 adjust-toolchain:
-	@echo 'main(){}' > dummy.c && cc dummy.c && readelf -l a.out > .specstest
+	@echo 'main(){}' > dummy.c && cc dummy.c && \
+	 readelf -l a.out > .specstest
 	@if ! cat .specstest | grep -q $(WD) ; then cd $(NM)-build && \
 	 make -C ld install && SPECFILE=`gcc --print-file specs` && \
-	 sed 's@ /lib/ld-linux.so.2@ $(WD)/lib/ld-linux.so.2 at g' $$SPECFILE > tempspecfile && \
-	 mv -f tempspecfile $$SPECFILE && unset SPECFILE && \
-	 rm -f $(WD)/lib/gcc/*/*/include/{pthread.h,bits/sigthread.h} && cd .. && make clean ; fi
-	@touch adjust-toolchain
+         sed 's@ /lib/ld-linux.so.2@ $(WD)/lib/ld-linux.so.2 at g' \
+	 $$SPECFILE > tempspecfile && \
+         mv -f tempspecfile $$SPECFILE && unset SPECFILE && \
+         rm -f $(WD)/lib/gcc/*/*/include/{pthread.h,bits/sigthread.h} && \
+	 cd .. && make clean ; fi
+	@touch $@
 
-pass2:
-	@echo ""
-	@echo "=====> Building $(NM) Pass 2"
-	@echo ""
-	@if [ ! -f $(SRC)/$(FILE) ] ; then $(WGET) $(URL) && \
-	 mv $(FILE) $(SRC) ; fi
-	@if [ ! -f .pass2 ] ; then unpack $(SRC)/$(FILE) && cd $(DIR) && \
-	 mkdir ../$(NM)-build && cd ../$(NM)-build && \
-	 ../$(DIR)/configure --prefix=$(WD) --disable-nls \
-	 --enable-shared --with-lib-path=$(WD)/lib && \
-	 make -j3 && \
-	 make install && \
-	 make -C ld clean && make -C ld LIB_PATH=/usr/lib:/lib ; fi
-	@touch .pass2
 
+pass2: Makefile $(FILE)
+	@unpack $(FILE)
+	@make -C $(DIR) -f ../Makefile compile-$@
+	@touch $@
+
+
+compile-pass2:
+	@$(call echo_message, Configuring)
+#==============================================================================
+# Configure commands below \/
+#==============================================================================
+	@$(sep_dir)
+	@./configure --prefix=$(WD) --disable-nls \
+	 --enable-shared --with-lib-path=$(WD)/lib >../$(DIR)-$@.log
+#
+#==Status Messages==========================================
+#
+	@$(OK)
+	@$(call echo_message, Making)
+#==============================================================================
+# Make commands below \/
+#==============================================================================
+	@make $(PM) >>../$(DIR)-$@.log
+#
+#==Status Messages===========================================
+#
+	@$(OK)
+	@$(call echo_message, Installing)
+#==============================================================================
+# Install commands below \/
+#==============================================================================
+	@make install >>../$(DIR)-$@.log
+	@make -C ld clean >>../$(DIR)-$@.log
+	@make -C ld LIB_PATH=/usr/lib:/lib >>../$(DIR)-$@.log
+
+#
+#==Status Messages===========================================
+#
+	@$(OK)
+
 chroot-re-adjust-toolchain:
-	@chroot "$(MP)" $(chenv1) 'cd $(ROOT) && make ch-re-adjust-toolchain $(chbash1)'
+	@chroot "$(MP)" $(chenv-pre-bash) \
+	'cd $(ROOT) && make ch-re-adjust-toolchain $(chbash-pre-bash)'
 
 re-adjust-toolchain:
-	@echo 'main(){}' > dummy.c && cc dummy.c && readelf -l a.out > .specstest
-	@if cat .specstest | grep -q $(WD) ; then cd $(NM)-build && make -C ld INSTALL=$(WD)/bin/install install && \
-	 perl -pi -e 's@ $(WD)/lib/ld-linux.so.2@ /lib/ld-linux.so.2 at g;' -e 's@\*startfile_prefix_spec:\n@$$_/usr/lib/@g;' `gcc --print-file specs` ; fi
-	@touch re-adjust-toolchain
+	@echo 'main(){}' > dummy.c && cc dummy.c && \
+	 readelf -l a.out > .specstest
+	@if cat .specstest | grep -q $(WD) ; then cd $(NM)-build && \
+	 make -C ld INSTALL=$(WD)/bin/install install && \
+         perl -pi -e 's@ $(WD)/lib/ld-linux.so.2@ /lib/ld-linux.so.2 at g;' \
+	 -e 's@\*startfile_prefix_spec:\n@$$_/usr/lib/@g;' \
+	 `gcc --print-file specs` ; fi
 	@make clean
+	@touch $@
 
 chroot:
-	@chroot "$(MP)" $(chenv1) 'cd $(ROOT) && make ch-binutils $(chbash1)'
+	@chroot "$(MP)" $(chenv-pre-bash) \
+	'cd $(ROOT) && make ch-$(NM) $(chbash-pre-bash)'
 
-stage2:
-	@echo ""
-	@echo "=====> Building $(NM) in chroot"
-	@echo ""
-	@if [ ! -f $(SRC)/$(FILE) ] ; then $(WGET) $(URL) && \
-	 mv $(FILE) $(SRC) ; fi
-	@if [ ! -f /usr/bin/ld ] ; then unpack $(SRC)/$(FILE) && cd $(DIR) && \
-	 mkdir ../$(NM)-build && cd ../$(NM)-build && \
-	 ../$(DIR)/configure --prefix=/usr --enable-shared && \
-	 make -j3 tooldir=/usr && \
-	 make tooldir=/usr install && \
-	 cp ../$(DIR)/include/libiberty.h /usr/include ; fi
-	@make clean
+stage2: Makefile $(FILE)
+	$(std_build)
 
+compile-stage2:
+	$(call echo_message, Configuring)
+#==============================================================================
+# Configure commands below \/
+#==============================================================================
+	@$(sep_dir)
+	@./configure --prefix=/usr --enable-shared >../$(DIR)-$@.log
+#
+#==Status Messages==========================================
+#
+	@$(OK)
+	@$(call echo_message, Making)
+#==============================================================================
+# Make commands below \/
+#==============================================================================
+	@make $(PM) tooldir=/usr >>../$(DIR)-$@.log
+#
+#==Status Messages===========================================
+#
+	@$(OK)
+	@$(call echo_message, Installing)
+#==============================================================================
+# Install commands below \/
+#==============================================================================
+	@make tooldir=/usr install >>../$(DIR)-$@.log
+	@cp ../$(DIR)/include/libiberty.h /usr/include
+
+#
+#==Status Messages===========================================
+#
+	@$(OK)
+
+	
 clean:
 	@-rm -rf $(DIR)
-	@-rm -rf $(NM)-build
-	@-rm -rf dummy.c a.out .specstest
+
+.PHONY: compile-pass1 clean chroot compile-pass2 compile-stage2

Modified: x86/trunk/packages/template/Makefile
===================================================================
--- x86/trunk/packages/template/Makefile	2005-07-18 02:32:26 UTC (rev 355)
+++ x86/trunk/packages/template/Makefile	2005-07-18 03:13:31 UTC (rev 356)
@@ -4,7 +4,7 @@
 NM= [package-name]
 VRS= [version-number]
 DIR= $(NM)-$(VRS)
-FILE= $(DIR).tar.gz
+FILE= $(DIR).tar.bz2 # Use bz2 files wherever possible, especially for lfs-base
 URL= $(HTTP)/$(NM)/$(FILE)
 PATCH= $(DIR)-some-1.patch
 PATCHURL= http://www.linuxfromscratch.org/patches/downloads/$(NM)/$(PATCH)

Modified: x86/trunk/scripts/functions
===================================================================
--- x86/trunk/scripts/functions	2005-07-18 02:32:26 UTC (rev 355)
+++ x86/trunk/scripts/functions	2005-07-18 03:13:31 UTC (rev 356)
@@ -21,3 +21,7 @@
         @make clean
         @touch $@
 endef
+
+define sep_dir
+	@mkdir ../$(NM)-build && cd ../$(NM)-build
+endef




More information about the livecd mailing list