diff options
| author | Jesper Nilsson <jesper.nilsson@axis.com> | 2007-11-30 10:07:06 -0500 |
|---|---|---|
| committer | Jesper Nilsson <jesper.nilsson@axis.com> | 2008-02-08 05:06:25 -0500 |
| commit | 2c2314bf6b1e72c2de6703a62f51f453576cd132 (patch) | |
| tree | aa51cb45b4ed85d8e63d753df8c63262159445dd /arch/cris/Makefile | |
| parent | 5fc1f3122fda1a15df0e4f83d85f4d2991bf0edd (diff) | |
CRIS: Update main Kbuild makefile.
- Remove old and non-generic targets, use generic ones instead.
- Add sub-arch as mach-fs or mach-a3 for EtraxFS and Artpec-3 respectively.
- Add links to sub-arch directories, and erase before trying to create them.
- Include from sub-arch specific include directory "mach".
- Add files to be cleaned in CLEAN_FILES instead of as archclean target.
Diffstat (limited to 'arch/cris/Makefile')
| -rw-r--r-- | arch/cris/Makefile | 139 |
1 files changed, 70 insertions, 69 deletions
diff --git a/arch/cris/Makefile b/arch/cris/Makefile index e6bf00c262e0..838cd2ae03ae 100644 --- a/arch/cris/Makefile +++ b/arch/cris/Makefile | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # $Id: Makefile,v 1.28 2005/03/17 10:44:37 larsv Exp $ | 1 | # |
| 2 | # cris/Makefile | 2 | # cris/Makefile |
| 3 | # | 3 | # |
| 4 | # This file is included by the global makefile so that you can add your own | 4 | # This file is included by the global makefile so that you can add your own |
| @@ -10,28 +10,36 @@ | |||
| 10 | # License. See the file "COPYING" in the main directory of this archive | 10 | # License. See the file "COPYING" in the main directory of this archive |
| 11 | # for more details. | 11 | # for more details. |
| 12 | 12 | ||
| 13 | # A bug in ld prevents us from having a (constant-value) symbol in a | ||
| 14 | # "ORIGIN =" or "LENGTH =" expression. | ||
| 15 | |||
| 16 | arch-y := v10 | 13 | arch-y := v10 |
| 17 | arch-$(CONFIG_ETRAX_ARCH_V10) := v10 | 14 | arch-$(CONFIG_ETRAX_ARCH_V10) := v10 |
| 18 | arch-$(CONFIG_ETRAX_ARCH_V32) := v32 | 15 | arch-$(CONFIG_ETRAX_ARCH_V32) := v32 |
| 19 | 16 | ||
| 20 | # No config avaiable for make clean etc | 17 | # No config available for make clean etc |
| 18 | mach-y := fs | ||
| 19 | mach-$(CONFIG_CRIS_MACH_ARTPEC3) := a3 | ||
| 20 | mach-$(CONFIG_ETRAXFS) := fs | ||
| 21 | |||
| 21 | ifneq ($(arch-y),) | 22 | ifneq ($(arch-y),) |
| 22 | SARCH := arch-$(arch-y) | 23 | SARCH := arch-$(arch-y) |
| 23 | else | 24 | else |
| 24 | SARCH := | 25 | SARCH := |
| 25 | endif | 26 | endif |
| 26 | 27 | ||
| 28 | ifneq ($(mach-y),) | ||
| 29 | MACH := mach-$(mach-y) | ||
| 30 | else | ||
| 31 | MACH := | ||
| 32 | endif | ||
| 33 | |||
| 27 | LD = $(CROSS_COMPILE)ld -mcrislinux | 34 | LD = $(CROSS_COMPILE)ld -mcrislinux |
| 28 | 35 | ||
| 29 | OBJCOPYFLAGS := -O binary -R .note -R .comment -S | 36 | OBJCOPYFLAGS := -O binary -R .note -R .comment -S |
| 30 | 37 | ||
| 31 | CPPFLAGS_vmlinux.lds = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE) | 38 | CPPFLAGS_vmlinux.lds = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE) |
| 32 | KBUILD_AFLAGS += -mlinux | ||
| 33 | 39 | ||
| 34 | KBUILD_CFLAGS += -mlinux -march=$(arch-y) -pipe | 40 | KBUILD_AFLAGS += -mlinux -march=$(arch-y) -Iinclude/asm/arch/mach -Iinclude/asm/arch |
| 41 | |||
| 42 | KBUILD_CFLAGS += -mlinux -march=$(arch-y) -pipe -Iinclude/asm/arch/mach -Iinclude/asm/arch | ||
| 35 | 43 | ||
| 36 | ifdef CONFIG_FRAME_POINTER | 44 | ifdef CONFIG_FRAME_POINTER |
| 37 | KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g | 45 | KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g |
| @@ -44,6 +52,9 @@ LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libgcc.a) | |||
| 44 | 52 | ||
| 45 | core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/ | 53 | core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/ |
| 46 | core-y += arch/$(ARCH)/$(SARCH)/kernel/ arch/$(ARCH)/$(SARCH)/mm/ | 54 | core-y += arch/$(ARCH)/$(SARCH)/kernel/ arch/$(ARCH)/$(SARCH)/mm/ |
| 55 | ifdef CONFIG_ETRAX_ARCH_V32 | ||
| 56 | core-y += arch/$(ARCH)/$(SARCH)/$(MACH)/ | ||
| 57 | endif | ||
| 47 | drivers-y += arch/$(ARCH)/$(SARCH)/drivers/ | 58 | drivers-y += arch/$(ARCH)/$(SARCH)/drivers/ |
| 48 | libs-y += arch/$(ARCH)/$(SARCH)/lib/ $(LIBGCC) | 59 | libs-y += arch/$(ARCH)/$(SARCH)/lib/ $(LIBGCC) |
| 49 | 60 | ||
| @@ -52,79 +63,69 @@ SRC_ARCH = $(srctree)/arch/$(ARCH) | |||
| 52 | # cris object files path | 63 | # cris object files path |
| 53 | OBJ_ARCH = $(objtree)/arch/$(ARCH) | 64 | OBJ_ARCH = $(objtree)/arch/$(ARCH) |
| 54 | 65 | ||
| 55 | target_boot_arch_dir = $(OBJ_ARCH)/$(SARCH)/boot | 66 | boot := arch/$(ARCH)/boot |
| 56 | target_boot_dir = $(OBJ_ARCH)/boot | 67 | MACHINE := arch/$(ARCH)/$(SARCH) |
| 57 | src_boot_dir = $(SRC_ARCH)/boot | ||
| 58 | target_compressed_dir = $(OBJ_ARCH)/boot/compressed | ||
| 59 | src_compressed_dir = $(SRC_ARCH)/boot/compressed | ||
| 60 | target_rescue_dir = $(OBJ_ARCH)/boot/rescue | ||
| 61 | src_rescue_dir = $(SRC_ARCH)/boot/rescue | ||
| 62 | |||
| 63 | export target_boot_arch_dir target_boot_dir src_boot_dir target_compressed_dir src_compressed_dir target_rescue_dir src_rescue_dir | ||
| 64 | |||
| 65 | vmlinux.bin: vmlinux | ||
| 66 | $(OBJCOPY) $(OBJCOPYFLAGS) vmlinux vmlinux.bin | ||
| 67 | |||
| 68 | timage: vmlinux.bin | ||
| 69 | cat vmlinux.bin cramfs.img >timage | ||
| 70 | |||
| 71 | simimage: timage | ||
| 72 | cp vmlinux.bin simvmlinux.bin | ||
| 73 | |||
| 74 | # the following will remake timage without compiling the kernel | ||
| 75 | # it does of course require that all object files exist... | ||
| 76 | |||
| 77 | cramfs: | ||
| 78 | ## cramfs - Creates a cramfs image | ||
| 79 | mkcramfs -b 8192 -m romfs_meta.txt root cramfs.img | ||
| 80 | cat vmlinux.bin cramfs.img >timage | ||
| 81 | 68 | ||
| 82 | clinux: vmlinux.bin decompress.bin rescue.bin | 69 | all: zImage |
| 83 | 70 | ||
| 84 | decompress.bin: $(target_boot_dir) | 71 | zImage Image: vmlinux |
| 85 | @$(MAKE) -f $(src_compressed_dir)/Makefile $(target_compressed_dir)/decompress.bin | 72 | $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@ |
| 86 | 73 | ||
| 87 | $(target_rescue_dir)/rescue.bin: $(target_boot_dir) | 74 | archprepare: $(SRC_ARCH)/.links $(srctree)/include/asm-$(ARCH)/.arch FORCE |
| 88 | @$(MAKE) -f $(src_rescue_dir)/Makefile $(target_rescue_dir)/rescue.bin | ||
| 89 | |||
| 90 | zImage: $(target_boot_dir) vmlinux.bin $(target_rescue_dir)/rescue.bin | ||
| 91 | ## zImage - Compressed kernel (gzip) | ||
| 92 | @$(MAKE) -f $(src_boot_dir)/Makefile zImage | ||
| 93 | |||
| 94 | $(target_boot_dir): $(target_boot_arch_dir) | ||
| 95 | ln -sfn $< $@ | ||
| 96 | |||
| 97 | $(target_boot_arch_dir): | ||
| 98 | mkdir -p $@ | ||
| 99 | |||
| 100 | compressed: zImage | ||
| 101 | |||
| 102 | archmrproper: | ||
| 103 | archclean: | ||
| 104 | @if [ -d arch/$(ARCH)/boot ]; then \ | ||
| 105 | $(MAKE) $(clean)=arch/$(ARCH)/boot ; \ | ||
| 106 | fi | ||
| 107 | rm -f timage vmlinux.bin decompress.bin rescue.bin cramfs.img | ||
| 108 | rm -rf $(LD_SCRIPT).tmp | ||
| 109 | |||
| 110 | archprepare: $(SRC_ARCH)/.links $(srctree)/include/asm-$(ARCH)/.arch | ||
| 111 | 75 | ||
| 112 | # Create some links to make all tools happy | 76 | # Create some links to make all tools happy |
| 113 | $(SRC_ARCH)/.links: | 77 | $(SRC_ARCH)/.links: |
| 114 | @rm -rf $(SRC_ARCH)/drivers | 78 | @rm -rf $(SRC_ARCH)/drivers |
| 115 | @ln -sfn $(SRC_ARCH)/$(SARCH)/drivers $(SRC_ARCH)/drivers | 79 | @ln -sfn $(SARCH)/drivers $(SRC_ARCH)/drivers |
| 116 | @rm -rf $(SRC_ARCH)/boot | 80 | @rm -rf $(SRC_ARCH)/boot |
| 117 | @ln -sfn $(SRC_ARCH)/$(SARCH)/boot $(SRC_ARCH)/boot | 81 | @ln -sfn $(SARCH)/boot $(SRC_ARCH)/boot |
| 118 | @rm -rf $(SRC_ARCH)/lib | 82 | @rm -rf $(SRC_ARCH)/lib |
| 119 | @ln -sfn $(SRC_ARCH)/$(SARCH)/lib $(SRC_ARCH)/lib | 83 | @ln -sfn $(SARCH)/lib $(SRC_ARCH)/lib |
| 120 | @ln -sfn $(SRC_ARCH)/$(SARCH) $(SRC_ARCH)/arch | 84 | @rm -f $(SRC_ARCH)/arch/mach |
| 121 | @ln -sfn $(SRC_ARCH)/$(SARCH)/vmlinux.lds.S $(SRC_ARCH)/kernel/vmlinux.lds.S | 85 | @rm -rf $(SRC_ARCH)/arch |
| 122 | @ln -sfn $(SRC_ARCH)/$(SARCH)/kernel/asm-offsets.c $(SRC_ARCH)/kernel/asm-offsets.c | 86 | @ln -sfn $(SARCH) $(SRC_ARCH)/arch |
| 87 | ifdef CONFIG_ETRAX_ARCH_V32 | ||
| 88 | @ln -sfn ../$(SARCH)/$(MACH) $(SRC_ARCH)/arch/mach | ||
| 89 | endif | ||
| 90 | @rm -rf $(SRC_ARCH)/kernel/vmlinux.lds.S | ||
| 91 | @ln -sfn ../$(SARCH)/vmlinux.lds.S $(SRC_ARCH)/kernel/vmlinux.lds.S | ||
| 92 | @rm -rf $(SRC_ARCH)/kernel/asm-offsets.c | ||
| 93 | @ln -sfn ../$(SARCH)/kernel/asm-offsets.c $(SRC_ARCH)/kernel/asm-offsets.c | ||
| 123 | @touch $@ | 94 | @touch $@ |
| 124 | 95 | ||
| 125 | # Create link to sub arch includes | 96 | # Create link to sub arch includes |
| 126 | $(srctree)/include/asm-$(ARCH)/.arch: $(wildcard include/config/arch/*.h) | 97 | $(srctree)/include/asm-$(ARCH)/.arch: $(wildcard include/config/arch/*.h) |
| 127 | @echo ' Making $(srctree)/include/asm-$(ARCH)/arch -> $(srctree)/include/asm-$(ARCH)/$(SARCH) symlink' | 98 | @echo ' SYMLINK include/asm-$(ARCH)/arch -> include/asm-$(ARCH)/$(SARCH)' |
| 128 | @rm -f include/asm-$(ARCH)/arch | 99 | @rm -f $(srctree)/include/asm-$(ARCH)/arch/mach |
| 129 | @ln -sf $(srctree)/include/asm-$(ARCH)/$(SARCH) $(srctree)/include/asm-$(ARCH)/arch | 100 | @rm -f $(srctree)/include/asm-$(ARCH)/arch |
| 101 | @ln -sf $(SARCH) $(srctree)/include/asm-$(ARCH)/arch | ||
| 102 | ifdef CONFIG_ETRAX_ARCH_V32 | ||
| 103 | @ln -sf $(MACH) $(srctree)/include/asm-$(ARCH)/arch/mach | ||
| 104 | endif | ||
| 130 | @touch $@ | 105 | @touch $@ |
| 106 | |||
| 107 | archclean: | ||
| 108 | $(Q)if [ -e arch/$(ARCH)/boot ]; then \ | ||
| 109 | $(MAKE) $(clean)=arch/$(ARCH)/boot; \ | ||
| 110 | fi | ||
| 111 | |||
| 112 | CLEAN_FILES += \ | ||
| 113 | $(MACHINE)/boot/zImage \ | ||
| 114 | $(MACHINE)/boot/compressed/decompress.bin \ | ||
| 115 | $(MACHINE)/boot/compressed/piggy.gz \ | ||
| 116 | $(MACHINE)/boot/rescue/rescue.bin \ | ||
| 117 | $(SRC_ARCH)/.links \ | ||
| 118 | $(srctree)/include/asm-$(ARCH)/.arch | ||
| 119 | |||
| 120 | MRPROPER_FILES += \ | ||
| 121 | $(SRC_ARCH)/drivers \ | ||
| 122 | $(SRC_ARCH)/boot \ | ||
| 123 | $(SRC_ARCH)/lib \ | ||
| 124 | $(SRC_ARCH)/arch \ | ||
| 125 | $(SRC_ARCH)/kernel/vmlinux.lds.S \ | ||
| 126 | $(SRC_ARCH)/kernel/asm-offsets.c | ||
| 127 | |||
| 128 | define archhelp | ||
| 129 | echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)' | ||
| 130 | echo '* Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)' | ||
| 131 | endef | ||
