Bug in new Makefiles

Alexander E. Patrakov patrakov at ums.usu.ru
Mon Jul 18 06:31:31 PDT 2005


Jeremy Huntwork wrote:
> Of course, make cd's into the directory but then returns to the main 
> directory when that command is finished, because it's not connected to 
> the next one...
> 
> Looking forward to what you come up with there...

For pass1, one of the possible solutions is attached as a diff.

-- 
Alexander E. Patrakov
-------------- next part --------------
Index: scripts/functions
===================================================================
--- scripts/functions	(revision 370)
+++ scripts/functions	(working copy)
@@ -22,9 +22,13 @@
         @touch $@
 endef
 
-define sep_dir
-	@if [ -d ../$(NM)-build ] ; then rm -rf ../$(NM)-build ; fi
-	@mkdir ../$(NM)-build && cd ../$(NM)-build
+define sep_dir_build
+	@unpack $(FILE)
+	@rm -rf $(NM)-build
+	@mkdir $(NM)-build
+	@$(MAKE) -C $(NM)-build -f ../Makefile compile-$@
+	@$(MAKE) clean
+	@touch $@
 endef
 
 # This takes the form of 'download [filename] [url] [sha1sum]'
@@ -37,3 +41,6 @@
 	 else echo $(BRW)sha1sum check on $(SRC)/$(1): $(RED)[ FAILED ]$(WHITE); fi
 	@ln -s $(SRC)/$(1) .
 endef
+
+%.gz %.bz2 %.zip %.patch:
+	$(call download,$@,$(URL-$@),$(SHA-$@))
Index: packages/binutils/Makefile
===================================================================
--- packages/binutils/Makefile	(revision 370)
+++ packages/binutils/Makefile	(working copy)
@@ -17,17 +17,14 @@
 	@$(call download,$(FILE),$(URL),$(SHA))
 
 pass1: Makefile $(FILE)
-	@unpack $(FILE)
-	@make -C $(DIR) -f ../Makefile compile-$@
+	@$(sep_dir_build)
 	@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==========================================
@@ -164,5 +161,6 @@
 	
 clean:
 	@-rm -rf $(DIR)
+	@-rm -rf $(NM)-build
 
 .PHONY: compile-pass1 clean chroot compile-pass2 compile-stage2


More information about the livecd mailing list