Author: sparky
Date: Fri Jan  6 23:51:49 2006
New Revision: 6753

Modified:
   ppcrcd/trunk/Makefile
Log:
- many fixes: set 2 (it's not good idea use to so many variables)


Modified: ppcrcd/trunk/Makefile
==============================================================================
--- ppcrcd/trunk/Makefile       (original)
+++ ppcrcd/trunk/Makefile       Fri Jan  6 23:51:49 2006
@@ -9,30 +9,27 @@
 
 INITRDMODULES = cdrom ide-cd isofs nls_base
 
-OUT = out
-S = $(OUT)/rpm/SPECS
-R = $(OUT)/rpm/rpms
-P = $(OUT)/rpm/prep
+R = out/rpm/rpms
+P = out/rpm/prep
 
-all:   $(OUT)/ppcrcd.iso
+all:   out/ppcrcd.iso
        
 include base.pkgs
 #include add.pkgs
 
-installed_dir = $(OUT)/rpm/installed
-ppcrcd_iso = $(OUT)/ppcrcd.iso
-cdroot = $(OUT)/cdroot
-boot = $(OUT)/boot
-ppcrcd_sqf = $(OUT)/images/ppcrcd.sqf
-root_stripped = $(OUT)/root/stripped
-touch = $(OUT)/touch
-initrd_sqf = $(OUT)/images/initrd.sqf
-root_initrd = $(OUT)/root/initrd
-root_installed = $(OUT)/root/installed
-root_inst = $(OUT)/root/inst
-sources = $(OUT)/rpm/sources
+ppcrcd_iso = out/ppcrcd.iso
+cdroot = out/cdroot
+boot = out/boot
+ppcrcd_sqf = out/images/ppcrcd.sqf
+root_stripped = out/root/stripped
+touch = out/touch
+initrd_sqf = out/images/initrd.sqf
+root_initrd = out/root/initrd
+root_installed = out/root/installed
+root_inst = out/root/inst
+sources = out/rpm/sources
 
-INSTALL = $(addprefix $(installed_dir)/,$(I))
+INSTALL = $(addprefix out/rpm/installed/,$(I))
 STOP = $(addprefix $(touch)/stop/,$(S))
 
 $(ppcrcd_iso): $(cdroot) $(boot)/hfs.map files.sort
@@ -103,7 +100,7 @@
 
 $(touch)/stop/%:       $(root_stripped)
        $(SU) chroot $(root_stripped) chkconfig --level 2345 \
-               $(@:$(OUT)/touch/stop/%=%) off
+               $(@:out/touch/stop/%=%) off
        @touch $@
 
 $(boot):       $(root_installed) $(initrd_sqf) yaboot/yaboot boot.dir
@@ -114,7 +111,7 @@
        sed -e 's/"@_VERSION_@"/$(VER13)/g'     \
                -i [EMAIL PROTECTED]/boot.msg           \
                -i [EMAIL PROTECTED]/boot.msg.net
-       cp $(OUT)/root/boot/vmlinux-* [EMAIL PROTECTED]/vmlinux
+       cp out/root/boot/vmlinux-* [EMAIL PROTECTED]/vmlinux
        strip [EMAIL PROTECTED]/vmlinux
        strip -R.comment [EMAIL PROTECTED]/vmlinux
        gzip -9 [EMAIL PROTECTED]/vmlinux
@@ -172,21 +169,21 @@
        mkdir $@
        $(SU) rpm --root=$@ --initdb
 
-$(installed_dir)/%:    $(R)/% $(root_inst)
-       @$(SU) rpm -Uhv --root=$(root_inst) `cat $(firstword $^)`       \
+out/rpm/installed/%:   out/rpm/rpms/% $(root_inst)
+       @$(SU) rpm -Uhv --root=$(PWD)/$(root_inst) `cat $(firstword $^)`  \
                $(INSTOPTS-$(notdir $@)) --define="_install_langs %{nil}"
        @touch $@
 
-$(R)/%:
+out/rpm/rpms/%:
        @#XXX every package neads something like: $(R)/setup: $(P)/setup
        #######################################################################
        ###     Building $(notdir $@)
        #######################################################################
-       cd $(OUT)/rpm/SPECS && ( rpmbuild -bb   \
-               --define="_topdir $(OUT)/rpm"   \
-               $(firstword $^)                 \
-               $(BCOND-$(notdir $@)) $(BCOND)  \
-               --define="rpmcflags $(CFLAGS)"; \
+       cd out/rpm/SPECS && ( rpmbuild -bb      \
+               --define="_topdir $(PWD)/out/rpm"       \
+               $(notdir $(firstword $^)).spec          \
+               $(BCOND-$(notdir $@)) $(BCOND)          \
+               --define="rpmcflags $(CFLAGS)";         \
                echo $$? > $(PWD)/EXIT) | tee $(PWD)/buildout;
        [ `cat EXIT` == 0 ] || exit `cat EXIT`
        for RPM in `sed -n '/^Wrote:/s/Wrote: // p' buildout`; do       \
@@ -196,33 +193,34 @@
        rm buildout EXIT
        touch $@
 
-$(P)/%:        $(sources)/%
+out/rpm/prep/%:        out/rpm/sources/%
        touch $@
 
-$(sources)/%:  $(OUT)/rpm/SPECS/%.spec
+out/rpm/sources/%:     out/rpm/SPECS/%.spec
        #######################################################################
        ###     Getting $(notdir $@) source
        #######################################################################
-       cd $(OUT)/rpm/SPECS && ./builder -g $(firstword $^)     \
+       cd out/rpm/SPECS && ./builder -g $(notdir $(firstword $^))      \
                $(if $(REV-$(notdir $@)),-r $(REV-$(notdir $@)),) \
-               --define _topdir $(OUT)/rpm     \
+               --define _topdir $(PWD)/out/rpm \
                $(BCOND-$(notdir $@)) $(BCOND)
        touch $@
 
-$(OUT)/rpm/SPECS/%.spec: $(touch)/builder_prepared
-       cd $(dir $@) && cvs up $(if $(REV-$(@:$(S)/%.spec=%)),-r \
-               $(REV-$(@:$(S)/%.spec=%)),-A) $(notdir $@)
-
-$(touch)/builder_prepared:
-       rm -rf $(OUT)/rpm/SPECS
-       mkdir -p $(OUT)/rpm/{SPECS,SOURCES,RPMS,SRPMS,BUILD,rpms,sources,prep}
-       mkdir -p $(OUT)/{touch/stop,root,images}
-       cd $(OUT)/rpm && cvs -d ":pserver:[EMAIL PROTECTED]:/cvsroot" get \
+out/rpm/SPECS/%.spec: out/touch/builder_prepared
+       cd $(dir $@) && cvs up $(if $(REV-$(@:out/rpm/SPECS/%.spec=%)),-r \
+               $(REV-$(@:out/rpm/SPECS/%.spec=%)),-A) $(notdir $@)
+       touch $@
+
+out/touch/builder_prepared:
+       rm -rf out/rpm/SPECS
+       mkdir -p 
out/rpm/{SPECS,SOURCES,RPMS,SRPMS,BUILD,rpms,sources,prep,installed}
+       mkdir -p out/{touch/stop,root,images}
+       cd out/rpm && cvs -d ":pserver:[EMAIL PROTECTED]:/cvsroot" get \
                SPECS/builder SOURCES/kernel-ppc.config
-       sed -e '/SOURCE_DIR=/[EMAIL PROTECTED]@="$(OUT)/rpm/SOURCES"@'  \
-               -e '/SPECS_DIR=/[EMAIL PROTECTED]@="$(OUT)/rpm/SPECS"@' \
-               -e '/rpmbuild --nodig/[EMAIL PROTECTED]@rpmbuild 
--define="_topdir $(OUT)/rpm"@' \
-               -i $(OUT)/rpm/SPECS/builder
+       sed -e '/SOURCE_DIR=/[EMAIL PROTECTED]@="$(PWD)/out/rpm/SOURCES"@'      
\
+               -e '/SPECS_DIR=/[EMAIL PROTECTED]@="$(PWD)/out/rpm/SPECS"@'     
\
+               -e '/rpmbuild --nodig/[EMAIL PROTECTED]@rpmbuild 
--define="_topdir $(PWD)/out/rpm"@' \
+               -i out/rpm/SPECS/builder
        touch $@
 
 info:
@@ -258,6 +256,7 @@
 clean-yaboot:
        make -C yaboot clean
 
+# don't delete anything
 .SECONDARY:
 
 .DELETE_ON_ERROR: $(ppcrcd_iso) $(ppcrcd_sqf) $(initrd_sqf)
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to