Index: Makefile
===================================================================
--- Makefile	(revision 23414)
+++ Makefile	(working copy)
@@ -46,12 +46,14 @@
 beastpatcher-mac: beastpatcher-i386 beastpatcher-ppc
 	lipo -create beastpatcher-ppc beastpatcher-i386 -output beastpatcher-mac
 
-beastpatcher-i386:  beastpatcher.c  bootimg.c usb.h main.c libusb-i386.a
-	$(CC) -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -framework iokit -framework coreservices -arch i386 $(CFLAGS) -o beastpatcher-i386 beastpatcher.c bootimg.c -I. libusb-i386.a
+beastpatcher-i386:  $(SOURCES) $(HEADERS) $(MTPSRCS_MTP) usb.h libmtp.h libusb-i386.a libmtp-i386.a 
+	gcc -c -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch i386 $(CFLAGS) -I. -DBEASTPATCHER $(SOURCES) $(MTPSRCS_MTP)
+	gcc -framework iokit -framework coreservices -arch i386 -o beastpatcher-i386 beastpatcher.o bootimg.o mknkboot.o main.o mtp_libmtp.o libusb-i386.a libmtp-i386.a -liconv
 	strip beastpatcher-i386
-
-beastpatcher-ppc: beastpatcher.c bootimg.c usb.h main.c libusb-ppc.a
-	$(CC) -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -framework iokit -framework coreservices -arch ppc $(CFLAGS) -o beastpatcher-ppc beastpatcher.c bootimg.c -I. libusb-ppc.a
+	
+beastpatcher-ppc: $(SOURCES) $(HEADERS) $(MTPSRCS_MTP) usb.h libmtp.h libusb-ppc.a libmtp-ppc.a 
+	gcc -c -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch ppc $(CFLAGS) -I. -DBEASTPATCHER $(SOURCES) $(MTPSRCS_MTP)
+	gcc -framework iokit -framework coreservices -arch ppc -o beastpatcher-ppc beastpatcher.o bootimg.o mknkboot.o main.o mtp_libmtp.o libusb-ppc.a libmtp-ppc.a -liconv
 	strip beastpatcher-ppc
 
 bin2c: ../../../rbutil/tools/bin2c.c
@@ -63,4 +65,4 @@
 mknkboot: mknkboot.c
 	$(SILENT)$(NATIVECC) $(CFLAGS) $+ -o $@
 clean:
-	rm -f beastpatcher.exe beastpatcher-mac beastpatcher-i386 beastpatcher-ppc beastpatcher bin2c bootimg.c bootimg.h mknkboot *~
+	rm -f beastpatcher.exe beastpatcher-mac beastpatcher-i386 beastpatcher-ppc beastpatcher bin2c bootimg.c bootimg.h mknkboot *~ *.o
