1
0
Fork 0
forked from len0rd/rockbox

mkamsboot: update dualboot.c / dualboot.h in place

This removes the need for copying these files to ../ and removes the
risk of only copying one of the files (which led to bricking 2 c200v2
already)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24719 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rafaël Carré 2010-02-17 14:37:06 +00:00
parent 35fa12d85f
commit 7c8dbf46a8
2 changed files with 6 additions and 7 deletions

View file

@ -7,9 +7,7 @@ CC=gcc
BOOTOBJS = nrv2e_d8.o dualboot_clip.o dualboot_e200v2.o dualboot_c200v2.o dualboot_m200v4.o dualboot_fuze.o dualboot_clipv2.o dualboot_clipplus.o
BOOTBINS = nrv2e_d8.arm-bin dualboot_clip.arm-bin dualboot_e200v2.arm-bin dualboot_c200v2.arm-bin dualboot_m200v4.arm-bin dualboot_fuze.arm-bin dualboot_clipv2.arm-bin dualboot_clipplus.arm-bin
all: dualboot.h
dualboot.h: $(BOOTBINS)
all: ../dualboot.h ../dualboot.c
# Dualboot bootloaders
@ -47,11 +45,11 @@ nrv2e_d8.o: nrv2e_d8.S
%.arm-bin: %.arm-elf
arm-elf-objcopy -O binary $< $@
dualboot.c dualboot.h: $(BOOTBINS) bin2c
./bin2c dualboot $(BOOTBINS)
../dualboot.c ../dualboot.h: $(BOOTBINS) bin2c
./bin2c ../dualboot $(BOOTBINS)
bin2c: bin2c.c
$(CC) -o bin2c bin2c.c
clean:
rm -f *~ bin2c $(BOOTBINS) $(BOOTOBJS) dualboot.c dualboot.h
rm -f *~ bin2c $(BOOTBINS) $(BOOTOBJS)

View file

@ -26,6 +26,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include <libgen.h>
#ifndef O_BINARY
#define O_BINARY 0
@ -90,7 +91,7 @@ int main (int argc, char* argv[])
}
fprintf(cfile,"/* Generated by bin2c */\n\n");
fprintf(cfile,"#include \"%s\"\n\n", hfilename);
fprintf(cfile,"#include \"%s\"\n\n", basename(hfilename));
fprintf(hfile,"/* Generated by bin2c */\n\n");
for(i=0; i < argc - 2; i++) {