1 |
666 |
simons |
#
|
2 |
|
|
# or32/Makefile
|
3 |
|
|
#
|
4 |
|
|
# This file is included by the global makefile so that you can add your own
|
5 |
|
|
# platform-specific flags and dependencies.
|
6 |
|
|
#
|
7 |
|
|
# This file is subject to the terms and conditions of the GNU General Public
|
8 |
|
|
# License. See the file "COPYING" in the main directory of this archive
|
9 |
|
|
# for more details.
|
10 |
|
|
#
|
11 |
|
|
# Based on m68k/Rules.make
|
12 |
|
|
#
|
13 |
|
|
|
14 |
852 |
simons |
CROSS_COMPILE =or32-uclinux-
|
15 |
666 |
simons |
|
16 |
852 |
simons |
# LIBGCC = /home/simons/delete/or32-rtems/lib/gcc-lib/or32-rtems/2.95.2/libgcc.a
|
17 |
1313 |
jurem |
LIBGCC = /shared/projects/or32-uclinux/lib/gcc-lib/or32-uclinux/3.1/libgcc.a
|
18 |
666 |
simons |
|
19 |
852 |
simons |
CFLAGS := $(CFLAGS) -pipe -DNO_MM -DNO_FPU -DMAGIC_ROM_PTR -DNO_FORGET -DUTS_SYSNAME='"uClinux"'
|
20 |
|
|
AFLAGS := $(AFLAGS) -pipe -DNO_MM -DNO_FPU -DMAGIC_ROM_PTR -DUTS_SYSNAME='"uClinux"'
|
21 |
666 |
simons |
|
22 |
|
|
LINKFLAGS = -T arch/$(ARCH)/board/$(MODEL).ld
|
23 |
|
|
|
24 |
|
|
INIT_B := arch/$(ARCH)/board/init_$(MODEL).b
|
25 |
|
|
STOB := arch/$(ARCH)/tools/stob
|
26 |
|
|
|
27 |
|
|
SUBDIRS := arch/$(ARCH)/kernel arch/$(ARCH)/mm arch/$(ARCH)/lib \
|
28 |
|
|
arch/$(ARCH)/board $(SUBDIRS)
|
29 |
|
|
ARCHIVES := arch/$(ARCH)/kernel/kernel.o arch/$(ARCH)/mm/mm.o \
|
30 |
|
|
arch/$(ARCH)/board/board.o $(ARCHIVES)
|
31 |
|
|
LIBS += arch/$(ARCH)/lib/lib.a $(LIBGCC)
|
32 |
|
|
|
33 |
|
|
ifdef CONFIG_FRAMEBUFFER
|
34 |
|
|
SUBDIRS := $(SUBDIRS) arch/$(ARCH)/console
|
35 |
|
|
ARCHIVES := $(ARCHIVES) arch/$(ARCH)/console/console.a
|
36 |
|
|
endif
|
37 |
|
|
|
38 |
|
|
romfs.s19: romfs.img arch/$(ARCH)/empty.o
|
39 |
|
|
$(CROSS_COMPILE)objcopy -v -R .text -R .data -R .bss --add-section=.fs=romfs.img --adjust-section-vma=.fs=$(ROMFS_LOAD_ADDR) arch/$(ARCH)/empty.o romfs.s19
|
40 |
|
|
$(CROSS_COMPILE)objcopy -O srec romfs.s19
|
41 |
|
|
|
42 |
|
|
romfs.b: romfs.s19
|
43 |
|
|
$(STOB) romfs.s19 > romfs.b
|
44 |
|
|
|
45 |
|
|
linux.data: linux
|
46 |
|
|
$(CROSS_COMPILE)objcopy -O binary --remove-section=.romvec --remove-section=.text --remove-section=.ramvec --remove-section=.bss --remove-section=.eram linux linux.data
|
47 |
|
|
|
48 |
|
|
linux.text: linux
|
49 |
|
|
$(CROSS_COMPILE)objcopy -O binary --remove-section=.ramvec --remove-section=.bss --remove-section=.data --remove-section=.eram --set-section-flags=.romvec=CONTENTS,ALLOC,LOAD,READONLY,CODE linux linux.text
|
50 |
|
|
|
51 |
|
|
romfs.img:
|
52 |
|
|
echo creating a vmlinux rom image without root filesystem!
|
53 |
|
|
|
54 |
|
|
linux.bin: linux.text linux.data romfs.img
|
55 |
|
|
if [ -f romfs.img ]; then\
|
56 |
|
|
cat linux.text linux.data romfs.img > linux.bin;\
|
57 |
|
|
else\
|
58 |
|
|
cat linux.text linux.data > linux.bin;\
|
59 |
|
|
fi
|
60 |
|
|
|
61 |
|
|
flash.s19: linux.bin arch/$(ARCH)/empty.o
|
62 |
|
|
$(CROSS_COMPILE)objcopy -v -R .text -R .data -R .bss --add-section=.fs=linux.bin --adjust-section-vma=.fs=$(FLASH_LOAD_ADDR) arch/$(ARCH)/empty.o flash.s19
|
63 |
|
|
$(CROSS_COMPILE)objcopy -O srec flash.s19
|
64 |
|
|
|
65 |
|
|
flash.b: flash.s19
|
66 |
|
|
$(STOB) flash.s19 > flash.b
|
67 |
|
|
|
68 |
|
|
linux.trg linux.rom: linux.bin
|
69 |
|
|
perl arch/$(ARCH)/tools/fixup.pl
|
70 |
|
|
|
71 |
|
|
linux.s19: linux
|
72 |
|
|
$(CROSS_COMPILE)objcopy -O srec --adjust-section-vma=.data=0x`$(CROSS_COMPILE)nm linux | awk '/__data_rom_start/ {printf $$1}'` linux linux.s19
|
73 |
|
|
|
74 |
|
|
$(CROSS_COMPILE)objcopy -O srec linux.s19
|
75 |
|
|
|
76 |
|
|
linux.b: linux.s19
|
77 |
|
|
if [ -f $(INIT_B) ]; then\
|
78 |
|
|
cp $(INIT_B) linux.b;\
|
79 |
|
|
fi
|
80 |
|
|
$(STOB) linux.s19 >> linux.b
|
81 |
|
|
|
82 |
862 |
simons |
linux.z: linux arch/$(ARCH)/board/uncomp.c linux arch/$(ARCH)/board/reset.S
|
83 |
|
|
$(CROSS_COMPILE)objcopy -O binary linux linux.img
|
84 |
|
|
arch/$(ARCH)/tools/comp linux.img
|
85 |
|
|
arch/$(ARCH)/tools/piggyback < linux.img.cmp |$(CROSS_COMPILE)as -o linux.o
|
86 |
|
|
$(CROSS_COMPILE)ld -Tarch/$(ARCH)/board/comp.ld -o linux.z \
|
87 |
|
|
arch/$(ARCH)/board/reset.o arch/$(ARCH)/board/uncomp.o linux.o
|
88 |
|
|
|
89 |
666 |
simons |
archclean:
|
90 |
|
|
rm -f linux.text linux.data linux.bin linux.rom linux.trg
|
91 |
|
|
rm -f linux.s19 romfs.s19 flash.s19
|
92 |
|
|
rm -f linux.img romdisk.img
|
93 |
|
|
rm -f linux.b romfs.b flash.b
|