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 

Additions to build.mak for kxploit without corrupted data

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



Joined: 16 Aug 2005
Posts: 1
Location: san diego

PostPosted: Thu Aug 18, 2005 5:12 am    Post subject: Additions to build.mak for kxploit without corrupted data Reply with quote

This adds targets to build.mak for kxploit with corrupted data hidden and for automated installation to PSP.

For example, to compile and install on PSP with corrupted data hidden (use the appropriate destination directory for your system):
make kxploit2-install INSTALL_DIR=/media/usbdisk/psp/game

Code:

--- build.mak   2005-08-17 12:10:42.000000000 -0700
+++ mine/build.mak      2005-08-17 12:10:10.000000000 -0700
@@ -90,6 +90,19 @@
 FINAL_TARGET = $(TARGET).elf
 endif
 
+ifndef TARGET_LONG
+TARGET_LONG:=$(TARGET)_________________________________1
+endif
+
+ifndef TARGET_BASE
+TARGET_BASE:=$(strip $(shell echo "$(TARGET_LONG)" | sed -e 's/\(.\{6\}\).*/\1/'))
+endif
+
+ifndef TARGET_SHORT
+TARGET_SHORT:=$(TARGET_BASE)~1%
+endif
+
+
 all: $(EXTRA_TARGETS) $(FINAL_TARGET)
 
 kxploit: $(TARGET).elf $(PSP_EBOOT_SFO)
@@ -100,6 +113,27 @@
                $(PSP_EBOOT_ICON1) $(PSP_EBOOT_UNKPNG) $(PSP_EBOOT_PIC1)  \
                $(PSP_EBOOT_SND0) NULL $(PSP_EBOOT_PSAR)
 
+kxploit2: $(TARGET).elf $(PSP_EBOOT_SFO)
+       mkdir -p "$(TARGET_LONG)"
+       $(STRIP) $(TARGET).elf -o $(TARGET_LONG)/$(PSP_EBOOT)
+       mkdir -p "$(TARGET_SHORT)"
+       $(PACK_PBP) "$(TARGET_SHORT)/$(PSP_EBOOT)" $(PSP_EBOOT_SFO) $(PSP_EBOOT_ICON)  \
+               $(PSP_EBOOT_ICON1) $(PSP_EBOOT_UNKPNG) $(PSP_EBOOT_PIC1)  \
+               $(PSP_EBOOT_SND0) NULL $(PSP_EBOOT_PSAR)
+       @echo "copy $(TARGET_LONG) to psp before $(TARGET_SHORT)"
+
+install-dir-check:
+       test "x$(INSTALL_DIR)" != "x" && test -d "$(INSTALL_DIR)"
+
+kxploit-install: kxploit install-dir-check
+       cp -rf "$(TARGET)" "$(TARGET)%" "$(INSTALL_DIR)"
+
+kxploit2-install: kxploit2 install-dir-check
+       cp -rf "$(TARGET_LONG)" "$(INSTALL_DIR)"
+       sync
+       cp -rf "$(TARGET_SHORT)" "$(INSTALL_DIR)"
+       sync
+
 $(TARGET).elf: $(OBJS)
        $(LINK.c) $^ $(LIBS) -o $@
 
Back to top
View user's profile Send private message
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Thu Aug 18, 2005 5:32 am    Post subject: Reply with quote

This was rejected once before ... installation targets don't belong in build.mak.
Back to top
View user's profile Send private message
holger



Joined: 18 Aug 2005
Posts: 204

PostPosted: Sun Aug 21, 2005 5:05 am    Post subject: Reply with quote

hi,

I commited a psp-install script, similiar to GNU install to the pspgl/tools/ directory: http://svn.ps2dev.org/filedetails.php?repname=psp&path=%2Ftrunk%2Fpspgl%2Ftools%2Fpsp-install&rev=904&sc=0

The script is controlled via environment variables, simply export your PSP_REVISION and your PSP_MOUNTDIR in your .bashrc (or whatever shell config file you are using).

Using this and the psp-setup.c hook you can compile&install existing (well-written, prepared for cross-compilation) packages with no or minimal changes, you basically need to overwrite only the used environment variables before calling "configure" or "make":

CC=psp-gcc LD=psp-gcc INSTALL=psp-install LFLAGS="-DMODULE_NAME=name psp-setup.c (other linker flags follow)"

hope you find it useful, with this the existing Makefiles and build rules can become somewhat simplified.

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