Makefile 3.19 KB
Newer Older
1
# $Id: Makefile,v 1.15 2003/07/04 12:47:53 tobiasa Exp $
Linus Torvalds's avatar
Linus Torvalds committed
2 3 4 5 6 7 8 9 10 11 12 13
# cris/Makefile
#
# This file is included by the global makefile so that you can add your own
# architecture-specific flags and dependencies. Remember to do have actions
# for "archclean" and "archdep" for cleaning up and making dependencies for
# this architecture
#
# This file is subject to the terms and conditions of the GNU General Public
# License.  See the file "COPYING" in the main directory of this archive
# for more details.

# A bug in ld prevents us from having a (constant-value) symbol in a
14 15
# "ORIGIN =" or "LENGTH =" expression.

16 17 18 19 20 21 22 23 24
arch-y := v10
arch-$(CONFIG_ETRAX_ARCH_V10) := v10

# No config avaiable for make clean etc
ifneq ($(arch-y),)
SARCH := arch-$(arch-y)
else
SARCH :=
endif
25

26 27 28
LD = $(CROSS_COMPILE)ld -mcrislinux
LDFLAGS_BLOB	:= --format binary --oformat elf32-cris \
		   -T arch/cris/$(SARCH)/output_arch.ld
Linus Torvalds's avatar
Linus Torvalds committed
29

30
OBJCOPYFLAGS := -O binary -R .note -R .comment -S
Linus Torvalds's avatar
Linus Torvalds committed
31

32 33
AFLAGS_vmlinux.lds.o = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE)
AFLAGS += -mlinux
Linus Torvalds's avatar
Linus Torvalds committed
34

35
CFLAGS := $(CFLAGS) -mlinux -march=$(arch-y) -pipe
Linus Torvalds's avatar
Linus Torvalds committed
36

Linus Torvalds's avatar
Linus Torvalds committed
37
ifdef CONFIG_ETRAX_KGDB
Linus Torvalds's avatar
Linus Torvalds committed
38 39 40 41
CFLAGS := $(subst -fomit-frame-pointer,,$(CFLAGS)) -g
CFLAGS += -fno-omit-frame-pointer
endif

42
HEAD := arch/$(ARCH)/$(SARCH)/kernel/head.o
Linus Torvalds's avatar
Linus Torvalds committed
43

Linus Torvalds's avatar
Linus Torvalds committed
44
LIBGCC = $(shell $(CC) $(CFLAGS) -print-file-name=libgcc.a)
45

46 47 48 49
core-y		+= arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/
core-y		+= arch/$(ARCH)/$(SARCH)/kernel/ arch/$(ARCH)/$(SARCH)/mm/
drivers-y	+= arch/$(ARCH)/$(SARCH)/drivers/
libs-y		+= arch/$(ARCH)/$(SARCH)/lib/ $(LIBGCC)
Linus Torvalds's avatar
Linus Torvalds committed
50 51

vmlinux.bin: vmlinux
52
	$(OBJCOPY) $(OBJCOPYFLAGS) vmlinux vmlinux.bin
Linus Torvalds's avatar
Linus Torvalds committed
53 54 55 56 57 58 59 60 61 62 63 64

timage: vmlinux.bin
	cat vmlinux.bin cramfs.img >timage

simimage: timage
	cp vmlinux.bin simvmlinux.bin

# the following will remake timage without compiling the kernel
# it does of course require that all object files exist...

cramfs:
## cramfs      - Creates a cramfs image
Linus Torvalds's avatar
Linus Torvalds committed
65
	mkcramfs -b 8192 -m romfs_meta.txt root cramfs.img
Linus Torvalds's avatar
Linus Torvalds committed
66 67
	cat vmlinux.bin cramfs.img >timage

Linus Torvalds's avatar
Linus Torvalds committed
68 69
clinux: vmlinux.bin decompress.bin rescue.bin

70
decompress.bin: FORCE
71
	@make -C arch/$(ARCH)/boot/compressed decompress.bin
Linus Torvalds's avatar
Linus Torvalds committed
72

73
rescue.bin: FORCE
74
	@make -C arch/$(ARCH)/boot/rescue rescue.bin
Linus Torvalds's avatar
Linus Torvalds committed
75

76
zImage: vmlinux.bin rescue.bin
Linus Torvalds's avatar
Linus Torvalds committed
77
## zImage     - Compressed kernel (gzip)
78
	@make -C arch/$(ARCH)/boot/ zImage
Linus Torvalds's avatar
Linus Torvalds committed
79 80 81

compressed: zImage

82
archmrproper:
Linus Torvalds's avatar
Linus Torvalds committed
83
archclean:
84
	$(Q)$(MAKE) $(clean)=arch/$(ARCH)/boot
Linus Torvalds's avatar
Linus Torvalds committed
85 86 87
	rm -f timage vmlinux.bin cramfs.img
	rm -rf $(LD_SCRIPT).tmp

88 89 90 91 92 93 94 95
prepare: arch/$(ARCH)/.links include/asm-$(ARCH)/.arch \
	 include/asm-$(ARCH)/$(SARCH)/offset.h

# Create some links to make all tools happy
arch/$(ARCH)/.links:
	@ln -sfn $(SARCH)/drivers arch/$(ARCH)/drivers
	@ln -sfn $(SARCH)/boot arch/$(ARCH)/boot
	@ln -sfn $(SARCH)/lib arch/$(ARCH)/lib
96
	@ln -sfn $(SARCH)/vmlinux.lds.S arch/$(ARCH)/kernel/vmlinux.lds.S
97 98 99 100 101 102 103 104 105 106 107 108 109 110
	@touch $@

# Create link to sub arch includes
include/asm-$(ARCH)/.arch: $(wildcard include/config/arch/*.h)
	@echo '  Making asm-$(ARCH)/arch -> asm-$(ARCH)/$(SARCH) symlink'
	@rm -f include/asm-$(ARCH)/arch
	@ln -sf $(SARCH) include/asm-$(ARCH)/arch
	@touch $@

arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
					include/config/MARKER

include/asm-$(ARCH)/$(SARCH)/offset.h: arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.s
	$(call filechk,gen-asm-offsets)