Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | # |
2 | # Makefile for rescue code | |
3 | # | |
3e41d652 MS |
4 | target = $(target_rescue_dir) |
5 | src = $(src_rescue_dir) | |
6 | ||
7 | CC = gcc-cris -mlinux $(LINUXINCLUDE) | |
1da177e4 LT |
8 | CFLAGS = -O2 |
9 | LD = gcc-cris -mlinux -nostdlib | |
10 | OBJCOPY = objcopy-cris | |
11 | OBJCOPYFLAGS = -O binary --remove-section=.bss | |
12 | ||
3e41d652 | 13 | all: $(target)/rescue.bin $(target)/testrescue.bin $(target)/kimagerescue.bin |
1da177e4 | 14 | |
3e41d652 MS |
15 | $(target)/rescue.bin: $(target) $(target)/head.o |
16 | $(LD) -T $(src)/rescue.ld -o $(target)/rescue.o $(target)/head.o | |
17 | $(OBJCOPY) $(OBJCOPYFLAGS) $(target)/rescue.o $(target)/rescue.bin | |
18 | # Place a copy in top-level build directory | |
19 | cp -p $(target)/rescue.bin $(objtree) | |
1da177e4 | 20 | |
3e41d652 MS |
21 | $(target)/testrescue.bin: $(target) $(target)/testrescue.o |
22 | $(OBJCOPY) $(OBJCOPYFLAGS) $(target)/testrescue.o tr.bin | |
1da177e4 LT |
23 | # Pad it to 784 bytes |
24 | dd if=/dev/zero of=tmp2423 bs=1 count=784 | |
25 | cat tr.bin tmp2423 >testrescue_tmp.bin | |
3e41d652 | 26 | dd if=testrescue_tmp.bin of=$(target)/testrescue.bin bs=1 count=784 |
1da177e4 LT |
27 | rm tr.bin tmp2423 testrescue_tmp.bin |
28 | ||
3e41d652 MS |
29 | $(target)/kimagerescue.bin: $(target) $(target)/kimagerescue.o |
30 | $(OBJCOPY) $(OBJCOPYFLAGS) $(target)/kimagerescue.o ktr.bin | |
1da177e4 LT |
31 | # Pad it to 784 bytes, that's what the rescue loader expects |
32 | dd if=/dev/zero of=tmp2423 bs=1 count=784 | |
33 | cat ktr.bin tmp2423 >kimagerescue_tmp.bin | |
3e41d652 | 34 | dd if=kimagerescue_tmp.bin of=$(target)/kimagerescue.bin bs=1 count=784 |
1da177e4 LT |
35 | rm ktr.bin tmp2423 kimagerescue_tmp.bin |
36 | ||
3e41d652 MS |
37 | $(target): |
38 | mkdir -p $(target) | |
39 | ||
40 | $(target)/head.o: $(src)/head.S | |
1da177e4 LT |
41 | $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o |
42 | ||
3e41d652 | 43 | $(target)/testrescue.o: $(src)/testrescue.S |
1da177e4 LT |
44 | $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o |
45 | ||
3e41d652 | 46 | $(target)/kimagerescue.o: $(src)/kimagerescue.S |
1da177e4 LT |
47 | $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o |
48 | ||
49 | clean: | |
3e41d652 | 50 | rm -f $(target)/*.o $(target)/*.bin |
1da177e4 LT |
51 | |
52 | fastdep: | |
53 | ||
54 | modules: | |
55 | ||
56 | modules-install: |