清理linux内核源码arch中不相关的目录

linux源码 2.6.30.4

TQ2440

1.解压源码包

2.添加用于清理垃圾的make目标

    在顶层Makefile中help目标完了后,增加下面的处理
        #garbage remove for TQ244
        PHONY  = grm
        GBG_ARCH_DIR  = arch/alpha
        GBG_ARCH_DIR  = arch/avr32
        GBG_ARCH_DIR  = arch/cris
        GBG_ARCH_DIR  = arch/h8300
        GBG_ARCH_DIR  = arch/m68k
        GBG_ARCH_DIR  = arch/microblaze
        GBG_ARCH_DIR  = arch/mn10300
        GBG_ARCH_DIR  = arch/powerpc
        GBG_ARCH_DIR  = arch/sh
        GBG_ARCH_DIR  = arch/um
        GBG_ARCH_DIR  = arch/xtensa
        GBG_ARCH_DIR  = arch/blackfin
        GBG_ARCH_DIR  = arch/frv
        GBG_ARCH_DIR  = arch/ia64
        GBG_ARCH_DIR  = arch/m32r
        GBG_ARCH_DIR  = arch/m68knommu
        GBG_ARCH_DIR  = arch/mips
        GBG_ARCH_DIR  = arch/parisc
        GBG_ARCH_DIR  = arch/s390
        GBG_ARCH_DIR  = arch/sparc
        GBG_ARCH_DIR  = arch/x86

        GBG_ARM_SUB_DIR  = arch/arm/mach-aaec2000
        GBG_ARM_SUB_DIR  = arch/arm/mach-footbridge
        GBG_ARM_SUB_DIR  = arch/arm/mach-iop32x
        GBG_ARM_SUB_DIR  = arch/arm/mach-ks8695
        GBG_ARM_SUB_DIR  = arch/arm/mach-mv78xx0
        GBG_ARM_SUB_DIR  = arch/arm/mach-omap1
        GBG_ARM_SUB_DIR  = arch/arm/mach-rpc
        GBG_ARM_SUB_DIR  = arch/arm/mach-versatile
        GBG_ARM_SUB_DIR  = arch/arm/mach-at91
        GBG_ARM_SUB_DIR  = arch/arm/mach-gemini
        GBG_ARM_SUB_DIR  = arch/arm/mach-iop33x
        GBG_ARM_SUB_DIR  = arch/arm/mach-l7200
        GBG_ARM_SUB_DIR  = arch/arm/mach-mx1
        GBG_ARM_SUB_DIR  = arch/arm/mach-omap2
        GBG_ARM_SUB_DIR  = arch/arm/mach-s3c24a0
        GBG_ARM_SUB_DIR  = arch/arm/mach-w90x900
        GBG_ARM_SUB_DIR  = arch/arm/mach-clps711x
        GBG_ARM_SUB_DIR  = arch/arm/mach-h720x
        GBG_ARM_SUB_DIR  = arch/arm/mach-ixp2000
        GBG_ARM_SUB_DIR  = arch/arm/mach-lh7a40x
        GBG_ARM_SUB_DIR  = arch/arm/mach-mx2
        GBG_ARM_SUB_DIR  = arch/arm/mach-orion5x
        GBG_ARM_SUB_DIR  = arch/arm/mach-s3c6400
        GBG_ARM_SUB_DIR  = arch/arm/mach-davinci
        GBG_ARM_SUB_DIR  = arch/arm/mach-imx
        GBG_ARM_SUB_DIR  = arch/arm/mach-ixp23xx
        GBG_ARM_SUB_DIR  = arch/arm/mach-loki
        GBG_ARM_SUB_DIR  = arch/arm/mach-mx3
        GBG_ARM_SUB_DIR  = arch/arm/mach-pnx4008
        GBG_ARM_SUB_DIR  = arch/arm/mach-s3c6410
        GBG_ARM_SUB_DIR  = arch/arm/mach-ebsa110
        GBG_ARM_SUB_DIR  = arch/arm/mach-integrator
        GBG_ARM_SUB_DIR  = arch/arm/mach-ixp4xx
        GBG_ARM_SUB_DIR  = arch/arm/mach-mmp
        GBG_ARM_SUB_DIR  = arch/arm/mach-netx
        GBG_ARM_SUB_DIR  = arch/arm/mach-pxa
        GBG_ARM_SUB_DIR  = arch/arm/mach-sa1100
        GBG_ARM_SUB_DIR  = arch/arm/mach-ep93xx
        GBG_ARM_SUB_DIR  = arch/arm/mach-iop13xx
        GBG_ARM_SUB_DIR  = arch/arm/mach-kirkwood
        GBG_ARM_SUB_DIR  = arch/arm/mach-msm
        GBG_ARM_SUB_DIR  = arch/arm/mach-ns9xxx
        GBG_ARM_SUB_DIR  = arch/arm/mach-realview
        GBG_ARM_SUB_DIR  = arch/arm/mach-shark

        GBG_ARM_SUB_DIR  = arch/arm/plat-orion
        GBG_ARM_SUB_DIR  = arch/arm/plat-pxa
        GBG_ARM_SUB_DIR  = arch/arm/plat-iop
        GBG_ARM_SUB_DIR  = arch/arm/plat-mxc
        GBG_ARM_SUB_DIR  = arch/arm/plat-s3c64xx
        GBG_ARM_SUB_DIR  = arch/arm/plat-omap

        grm:
            @for i in $(GBG_ARCH_DIR); do                 echo remove $$i;                rm -rf $$i;                done
            @for i in $(GBG_ARM_SUB_DIR); do                 sed -i "s|^source \"$$i/Kconfig\"|#grm!!! source \"$$i/Kconfig\"|g" arch/arm/Kconfig;                 echo remove $$i;                rm -rf $$i;                done

3. make grm

make grm后make clean的时候可能会报找不到arch/um/scripts/Makefile.rules的错误
        对策就是将fs/hostfs/Makefile中include arch/um/scripts/Makefile.rules 注释掉即可
        或者在include前加-号,即-include arch/um/scripts/Makefile.rules 更好些

世界清净了.

来源:https://www.icode9.com/content-3-904651.html

(0)

相关推荐