demistifying make *clean targets, fix some clean targets issues
authorWaldemar Brodkorb <mail@waldemar-brodkorb.de>
Sat, 19 Feb 2005 13:00:30 +0000 (13:00 +0000)
committerWaldemar Brodkorb <mail@waldemar-brodkorb.de>
Sat, 19 Feb 2005 13:00:30 +0000 (13:00 +0000)
SVN-Revision: 272

openwrt/Makefile
openwrt/README [new file with mode: 0644]
openwrt/package/linux/linux.config
openwrt/package/linux/linux.mk
openwrt/package/sed/sed.mk
openwrt/target/Makefile.in
openwrt/toolchain/binutils/binutils.mk
openwrt/toolchain/ccache/ccache.mk
openwrt/toolchain/gcc/gcc-uclibc-3.x.mk
openwrt/toolchain/kernel-headers/kernel-headers.mk
openwrt/toolchain/uClibc/uclibc.mk

index 17507b9f8eaf7807628b590dbeb8d1b97f3abffd..43ee3ddba5012fc1a618c90b72ee1cbf093716b6 100644 (file)
@@ -27,8 +27,7 @@ CONFIG_DEFCONFIG = .defconfig
 CONFIG = package/config
 
 noconfig_targets := menuconfig config oldconfig randconfig \
-       defconfig allyesconfig allnoconfig clean distclean \
-       release tags
+       defconfig allyesconfig allnoconfig release tags
 
 # Pull in the user's configuration file
 ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
@@ -127,17 +126,17 @@ source: $(TARGETS_SOURCE)
 # Cleanup and misc junk
 #
 #############################################################
-clean: $(TARGETS_CLEAN)
-       rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE)
+clean: 
+       rm -rf $(TARGET_DIR) $(IMAGE).*
+       $(MAKE) $(DIST)-image-clean
 
 dirclean: $(TARGETS_DIRCLEAN)
-       rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE)
-
-distclean:
-       rm -rf $(DL_DIR) $(BUILD_DIR) $(LINUX_KERNEL) $(IMAGE)
+       rm -rf $(TARGET_DIR) $(IMAGE).*
+       $(MAKE) $(DIST)-image-clean
 
-cleanall:
-       rm -rf $(DL_DIR) $(BUILD_DIR) $(LINUX_KERNEL) $(IMAGE) $(TOOL_BUILD_DIR)
+distclean: clean
+       rm -rf $(DL_DIR) $(BUILD_DIR) $(TOOL_BUILD_DIR) 
+       rm .config* .tmpconfig.h
 
 sourceball:
        rm -rf $(BUILD_DIR)
@@ -194,8 +193,8 @@ defconfig: $(CONFIG)/conf
 # Cleanup and misc junk
 #
 #############################################################
-clean: 
-       $(MAKE) -C $(CONFIG) clean
+clean:
+       @$(MAKE) -C $(CONFIG) clean
 
 distclean: clean
 
@@ -204,4 +203,3 @@ endif # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
 .PHONY: dummy subdirs release distclean clean config oldconfig \
        menuconfig tags check test depend
 
-
diff --git a/openwrt/README b/openwrt/README
new file mode 100644 (file)
index 0000000..d718e59
--- /dev/null
@@ -0,0 +1,29 @@
+This is the buildsystem for the OpenWrt Linux Distribution
+It is a modified uClibc buildroot2.
+
+Please use "make menuconfig" to configure your appreciated
+configuration for the toolchain and firmware.
+
+Simply running 'make' will build your firmware and a tarball
+of kernel modules. It will download all sources, build the 
+cross-compile toolchain, the kernel and all choosen applications.
+
+You can use flash.sh for remotely updating your embedded system
+via tftp.
+
+
+There are some cleanup targets we would like to explain.
+"make clean" will only clean the firmware images and the root
+filesystem. "make dirclean" will remove the extracted kernel source
+and all exctracted software. (busybox,bridge-utils,..), but will
+preserve your toolchain. (compiler,linker,..)
+"make distclean" will remove everything, including the toolchain, 
+all downloaded source code archives and your firmware configuration. 
+You can cleanup separate directories by using "make application-dirclean" 
+and rebuild the firmware with "make".
+
+Be happy..
+       Your OpenWRT Project
+       http://www.openwrt.org
+
+
index aef2c2888e95c53764983748063bd8e91961f6c7..423fd8ce43fec793bc33a53e533ad1eecaba7a9d 100644 (file)
@@ -86,7 +86,7 @@ CONFIG_BCM4704=y
 # CONFIG_HIGHMEM is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
-CONFIG_CMDLINE="root=/dev/mtdblock2 rootfstype=squashfs init=/etc/preinit noinitrd console=ttyS0,115200"
+CONFIG_CMDLINE="root=/dev/mtdblock2 rootfstype=jffs2 init=/etc/preinit noinitrd console=ttyS0,115200"
 CONFIG_PCI=y
 CONFIG_NONCOHERENT_IO=y
 CONFIG_NEW_TIME_C=y
index 6d4545b3c4651c346329678fb87583c2172935b0..bead2226a6af5b8d5a26c81d80008f582bf43254 100644 (file)
@@ -57,6 +57,12 @@ endif
 
 $(LINUX_DIR)/.configured:  $(LINUX_DIR)/.patched
        -cp $(LINUX_KCONFIG) $(LINUX_DIR)/.config
+ifeq ($(BR2_TARGET_ROOTFS_SQUASHFS_LZMA),y)
+       $(SED) "s,rootfstype=jffs2,rootfstype=squashfs," $(LINUX_DIR)/.config
+endif
+ifeq ($(BR2_TARGET_ROOTFS_SQUASHFS),y)
+       $(SED) "s,rootfstype=jffs2,rootfstype=squashfs," $(LINUX_DIR)/.config
+endif
        $(SED) "s,^CROSS_COMPILE.*,CROSS_COMPILE=$(KERNEL_CROSS),g;" $(LINUX_DIR)/Makefile
        $(SED) "s,^CROSS_COMPILE.*,CROSS_COMPILE=$(KERNEL_CROSS),g;" $(LINUX_DIR)/arch/mips/Makefile
        $(SED) "s,\-mcpu=,\-mtune=,g;" $(LINUX_DIR)/arch/mips/Makefile
index 637768920cb628c72d0f67dc0a83a76f4061469f..8de0ea64cd1d6406244961a6475aed89aacba479 100644 (file)
@@ -69,7 +69,6 @@ use-sed-host-binary:
 host-sed: $(HOST_SED_TARGET)
 
 host-sed-clean:
-       $(MAKE) DESTDIR=$(STAGING_DIR) -C $(SED_DIR1) uninstall
        -$(MAKE) -C $(SED_DIR1) clean
 
 host-sed-dirclean:
@@ -127,7 +126,6 @@ sed-target_binary: $(SED_DIR2)/$(SED_BINARY)
 sed: uclibc sed-target_binary
 
 sed-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(SED_DIR2) uninstall
        -$(MAKE) -C $(SED_DIR2) clean
 
 sed-dirclean:
index 2d23d8336af3fea4bbcde6000d05dab18b2c5814..40c9a0578bb1aa509d67ff36aad2171c02472d68 100644 (file)
@@ -1,17 +1,20 @@
 # Default target skeleton stuff, may be overridden
+DIST=openwrt
 TARGET_SKELETON=target/default/skel.tar.gz
 TARGET_SKEL_DIR=target/default/target_skeleton
 
 include target/device/Makefile.in
 
-openwrt-linux.trx: openwrt-trx
-       PATH=$(TARGET_PATH) trx -o openwrt-linux.trx $(LINUX_DIR)/$(LINUX_BINLOC) $(IMAGE).$(ROOTFS)
+$(DIST)-linux.trx: openwrt-trx
+       PATH=$(TARGET_PATH) trx -o $(DIST)-linux.trx $(LINUX_DIR)/$(LINUX_BINLOC) $(IMAGE).$(ROOTFS)
 
-openwrt-gs-code.bin: openwrt-addpattern openwrt-linux.trx
-       PATH=$(TARGET_PATH) addpattern -2 -i  openwrt-linux.trx -o openwrt-gs-code.bin -g
+$(DIST)-gs-code.bin: openwrt-addpattern $(DIST)-linux.trx
+       PATH=$(TARGET_PATH) addpattern -2 -i  $(DIST)-linux.trx -o $(DIST)-gs-code.bin -g
 
-openwrt-g-code.bin: openwrt-gs-code.bin
-       sed -e "1s,^W54S,W54G," < openwrt-gs-code.bin > openwrt-g-code.bin
+$(DIST)-g-code.bin: $(DIST)-gs-code.bin
+       sed -e "1s,^W54S,W54G," < $(DIST)-gs-code.bin > $(DIST)-g-code.bin
 
-openwrt-image: openwrt openwrt-g-code.bin
+openwrt-image: openwrt $(DIST)-g-code.bin
 
+$(DIST)-image-clean:
+       @-rm $(DIST)-* 2>/dev/null
index ef9c3dc0a2ac69b31bfb3b5200cde81706d63c0d..3097a4bf211be93beda792f2caa0e8e015bcd6a3 100644 (file)
@@ -79,7 +79,7 @@ binutils-clean:
        rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
        -$(MAKE) -C $(BINUTILS_DIR1) clean
 
-binutils-dirclean:
+binutils-toolclean:
        rm -rf $(BINUTILS_DIR1)
 
 
@@ -130,5 +130,5 @@ binutils_target-clean:
        rm -f $(TARGET_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
        -$(MAKE) -C $(BINUTILS_DIR2) clean
 
-binutils_target-dirclean:
+binutils_target-toolclean:
        rm -rf $(BINUTILS_DIR2)
index e2fdd71cc16eaf732ec9ae49c111f8c61bb6ed17..cafdcd3d5d1f2191528d86c92ba22ac56f3e6927 100644 (file)
@@ -83,7 +83,7 @@ ccache-clean:
        $(MAKE) -C $(CCACHE_DIR1) uninstall
        -$(MAKE) -C $(CCACHE_DIR1) clean
 
-ccache-dirclean:
+ccache-toolclean:
        rm -rf $(CCACHE_DIR1)
 
 
@@ -147,5 +147,5 @@ ccache_target-clean:
        rm -f $(TARGET_DIR)/$(CCACHE_TARGET_BINARY)
        -$(MAKE) -C $(CCACHE_DIR2) clean
 
-ccache_target-dirclean:
+ccache_target-toolclean:
        rm -rf $(CCACHE_DIR2)
index 3457b4a69bf06d7fca33cd918881dbc11d423b1d..d1d372ecfb2f4ffe9a5bf2071ac78351b4a1637d 100644 (file)
@@ -127,7 +127,7 @@ gcc_initial-clean:
        rm -rf $(GCC_BUILD_DIR1)
        rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
 
-gcc_initial-dirclean:
+gcc_initial-toolclean:
        rm -rf $(GCC_BUILD_DIR1)
 
 #############################################################
@@ -225,7 +225,7 @@ gcc-clean:
        rm -rf $(GCC_BUILD_DIR2)
        rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
 
-gcc-dirclean:
+gcc-toolclean:
        rm -rf $(GCC_BUILD_DIR2)
 
 #############################################################
@@ -315,7 +315,7 @@ gcc_target-clean:
        rm -rf $(GCC_BUILD_DIR3)
        rm -f $(TARGET_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)*
 
-gcc_target-dirclean:
+gcc_target-toolclean:
        rm -rf $(GCC_BUILD_DIR3)
 
 endif
index 7335e24a351a719a9d6d0fb8381460e690ee6ec6..9edf1a0f1b1c4d584ecfee0d08e58994ba1e0d3a 100644 (file)
@@ -40,5 +40,5 @@ kernel-headers-source: $(DL_DIR)/$(LINUX_HEADERS_SOURCE)
 kernel-headers-clean: clean
        rm -rf $(LINUX_HEADERS_DIR)
 
-kernel-headers-dirclean:
+kernel-headers-toolclean:
        rm -rf $(LINUX_HEADERS_DIR)
index d104ce145cbac448011a61ac3a96b6d9689994c6..15cf6b2793d8d6bb0b47df901b1905016f9d710d 100644 (file)
@@ -137,7 +137,7 @@ uclibc-clean:
        -$(MAKE1) -C $(UCLIBC_DIR) clean
        rm -f $(UCLIBC_DIR)/.config
 
-uclibc-dirclean:
+uclibc-toolclean:
        rm -rf $(UCLIBC_DIR)
 
 uclibc-target-utils: $(TARGET_DIR)/usr/bin/ldd