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:
parent
35fa12d85f
commit
7c8dbf46a8
2 changed files with 6 additions and 7 deletions
|
@ -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
|
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
|
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
|
all: ../dualboot.h ../dualboot.c
|
||||||
|
|
||||||
dualboot.h: $(BOOTBINS)
|
|
||||||
|
|
||||||
# Dualboot bootloaders
|
# Dualboot bootloaders
|
||||||
|
|
||||||
|
@ -47,11 +45,11 @@ nrv2e_d8.o: nrv2e_d8.S
|
||||||
%.arm-bin: %.arm-elf
|
%.arm-bin: %.arm-elf
|
||||||
arm-elf-objcopy -O binary $< $@
|
arm-elf-objcopy -O binary $< $@
|
||||||
|
|
||||||
dualboot.c dualboot.h: $(BOOTBINS) bin2c
|
../dualboot.c ../dualboot.h: $(BOOTBINS) bin2c
|
||||||
./bin2c dualboot $(BOOTBINS)
|
./bin2c ../dualboot $(BOOTBINS)
|
||||||
|
|
||||||
bin2c: bin2c.c
|
bin2c: bin2c.c
|
||||||
$(CC) -o bin2c bin2c.c
|
$(CC) -o bin2c bin2c.c
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *~ bin2c $(BOOTBINS) $(BOOTOBJS) dualboot.c dualboot.h
|
rm -f *~ bin2c $(BOOTBINS) $(BOOTOBJS)
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <libgen.h>
|
||||||
|
|
||||||
#ifndef O_BINARY
|
#ifndef O_BINARY
|
||||||
#define O_BINARY 0
|
#define O_BINARY 0
|
||||||
|
@ -90,7 +91,7 @@ int main (int argc, char* argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(cfile,"/* Generated by bin2c */\n\n");
|
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");
|
fprintf(hfile,"/* Generated by bin2c */\n\n");
|
||||||
|
|
||||||
for(i=0; i < argc - 2; i++) {
|
for(i=0; i < argc - 2; i++) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue