I have my own bin2c and it took a while to figure out why psppacker wasnt compiling correctly. I modified my own bin2c programs output so psp-packer compiled.
just as an FYI heads up...
mm I knocked out a patch that adds a bin2c and an install clause into the setup. I did an svn add then svn diff...
Code: Select all
Index: pc/Makefile
===================================================================
--- pc/Makefile (revision 2252)
+++ pc/Makefile (working copy)
@@ -10,7 +10,7 @@
$(LINK.c) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
%.h: ../pspstub/%.elf
- bin2c $^ $@ pspstub
+ ../bin2c/bin2c $^ $@ pspstub
clean:
rm -f $(OUTPUT) pspstub.h
Index: Makefile
===================================================================
--- Makefile (revision 2252)
+++ Makefile (working copy)
@@ -1,7 +1,16 @@
+PSPSDK=$(shell psp-config --pspsdk-path)
+PSPDIR=$(shell psp-config --psp-prefix)
+
all:
+ $(MAKE) -C bin2c
$(MAKE) -C pspstub
$(MAKE) -C pc
+install: all
+ @echo "Installing psp-packer into $(PSPDIR)/bin"
+ @cp pc/psp-packer $(PSPDIR)/bin
+
clean:
+ $(MAKE) -C bin2c clean
$(MAKE) -C pspstub clean
$(MAKE) -C pc clean
Index: bin2c/Makefile
===================================================================
--- bin2c/Makefile (revision 0)
+++ bin2c/Makefile (revision 0)
@@ -0,0 +1,12 @@
+OUTPUT=bin2c
+
+all: $(OUTPUT)
+
+CFLAGS=-Wall
+
+$(OUTPUT): $(OUTPUT).c
+ $(LINK.c) $(CFLAGS) $(LDFLAGS) -o $@ $^
+
+clean:
+ rm -f $(OUTPUT)
+
Property changes on: bin2c/Makefile
___________________________________________________________________
Name: svn:eol-style
+ native
Index: bin2c/bin2c.c
===================================================================
--- bin2c/bin2c.c (revision 0)
+++ bin2c/bin2c.c (revision 0)
@@ -0,0 +1,68 @@
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdint.h>
+
+int main(int argc, char *argv[])
+{
+ uint32_t fsize;
+ int lcount;
+ uint8_t c;
+
+ FILE *fp;
+ FILE *ofp;
+
+ if(argc<4)
+ {
+ printf("bin2c inputfile outputfile recordname\n");
+ exit(0);
+ }
+
+ ofp = fopen(argv[2], "wt");
+ if(ofp != NULL)
+ {
+ fp = fopen(argv[1], "rb");
+ if(fp!=NULL)
+ {
+ fseek(fp, 0x0L, SEEK_END);
+ fsize = ftell(fp);
+ fseek(fp, 0x0L, SEEK_SET);
+
+ lcount = 0;
+
+ fprintf(ofp, "unsigned long size_%s=%i;\n", argv[3], fsize);
+ fprintf(ofp, "unsigned char %s[]=\n{\n\t", argv[3]);
+
+ while(ftell(fp) < fsize)
+ {
+ c = fgetc(fp);
+
+ if(lcount > 0)
+ fprintf(ofp, ", ");
+
+ fprintf(ofp, "0x%02X", c);
+
+ lcount++;
+ if(lcount == 10)
+ {
+ lcount = 0;
+ fprintf(ofp, ", \n\t");
+ }
+ }
+ fclose(fp);
+ fprintf(ofp, "\n};\n");
+ fclose(ofp);
+ }
+ else
+ {
+ fprintf(stderr, "Could not open file\n");
+ }
+ }
+ else
+ {
+ fprintf(stderr, "Could not open output file\n");
+ }
+
+ return 0;
+}
+
Property changes on: bin2c/bin2c.c
___________________________________________________________________
Name: svn:eol-style
+ native