forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

psppacker dependancy

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
_df_



Joined: 01 Jun 2007
Posts: 9

PostPosted: Mon Jun 11, 2007 7:48 am    Post subject: psppacker dependancy Reply with quote

psppacker is missing a bin2c dependancy.

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:

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
Back to top
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Mon Jun 11, 2007 9:52 am    Post subject: Reply with quote

This has been added to the repository.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group