ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / arch / mips / baget / Makefile
1 #
2 # Makefile for the Baget specific kernel interface routines
3 # under Linux.
4 #
5
6 obj-y                   := baget.o print.o setup.o time.o irq.o bagetIRQ.o \
7                            reset.o
8 obj-$(CONFIG_VAC_RTC)   += vacrtc.o
9
10 EXTRA_AFLAGS := $(CFLAGS)
11
12 bagetIRQ.o : bagetIRQ.S
13         $(CC) $(CFLAGS) -c -o $@ $<
14
15 ##################### Baget Loader stuff ########################
16
17 image: ../../../vmlinux
18         cp -f $< $@
19
20 image.bin: image
21         $(OBJCOPY) -O binary $< $@
22
23 ramdisk.bin:
24         echo "Dummy ramdisk used. Provide your own if needed !" > $@
25
26 dummy.c:
27         touch $@
28
29 dummy.o: dummy.c image.bin ramdisk.bin
30         $(CC) $(CFLAGS) -c -o $@ $<
31         $(OBJCOPY) --add-section=.vmlinux=image.bin \
32                    --add-section=.ramdisk=ramdisk.bin   $@
33
34 balo.h: image
35         $(NM) $< | awk ' \
36         BEGIN               { printf "/* DO NOT EDIT THIS FILE */\n" }    \
37         /_ftext/            { printf "#define LOADADDR 0x%s\n", $$1     } \
38         /kernel_entry/      { printf "#define START 0x%s\n", $$1 }        \
39         /balo_ramdisk_base/ { printf "#define RAMDISK_BASE 0x%s\n", $$1 } \
40         /balo_ramdisk_size/ { printf "#define RAMDISK_SIZE 0x%s\n", $$1 } \
41                        ' > $@
42 balo.o:   balo.c balo.h
43         $(CC) $(CFLAGS) -c $<
44
45 balo_supp.o: balo_supp.S
46         $(CC) $(CFLAGS) -c $<
47
48 balo:   balo.o dummy.o balo_supp.o print.o
49         $(LD) $(LDFLAGS) -T ld.script.balo -o $@ $^
50
51 clean:
52         rm -f balo balo.h dummy.c image image.bin
53