2007-09-09 13:30:40 +00:00
|
|
|
CFLAGS=-Wall -W
|
|
|
|
|
|
|
|
ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
|
|
|
|
OUTPUT=e200rpatcher.exe
|
|
|
|
CROSS=
|
|
|
|
CFLAGS+=-mno-cygwin
|
|
|
|
else
|
|
|
|
OUTPUT=e200rpatcher
|
|
|
|
CROSS=i586-mingw32msvc-
|
|
|
|
endif
|
|
|
|
|
|
|
|
LIBS = -lusb
|
2007-09-15 22:49:29 +00:00
|
|
|
WINLIBS = -I libusb-win32-device-bin-0.1.12.1/include libusb-win32-device-bin-0.1.12.1/lib/dynamic/libusb_dyn.c
|
2007-09-09 13:30:40 +00:00
|
|
|
|
|
|
|
NATIVECC = gcc
|
|
|
|
CC = $(CROSS)gcc
|
2008-01-20 21:19:37 +00:00
|
|
|
WINDRES = $(CROSS)windres
|
2007-09-09 13:30:40 +00:00
|
|
|
|
|
|
|
all: $(OUTPUT)
|
|
|
|
|
|
|
|
e200rpatcher: e200rpatcher.c bootimg.c
|
|
|
|
gcc $(CFLAGS) $(LIBS) -o e200rpatcher e200rpatcher.c bootimg.c
|
|
|
|
strip e200rpatcher
|
|
|
|
|
2008-01-20 21:19:37 +00:00
|
|
|
e200rpatcher.exe: e200rpatcher.c bootimg.c e200rpatcher-rc.o
|
|
|
|
$(CC) $(CFLAGS) $(WINLIBS) -o e200rpatcher.exe e200rpatcher.c bootimg.c e200rpatcher-rc.o
|
2007-09-09 13:30:40 +00:00
|
|
|
$(CROSS)strip e200rpatcher.exe
|
2008-01-20 21:19:37 +00:00
|
|
|
|
|
|
|
e200rpatcher-rc.o: e200rpatcher.rc e200rpatcher.manifest
|
|
|
|
$(WINDRES) -i e200rpatcher.rc -o e200rpatcher-rc.o
|
2007-09-09 13:30:40 +00:00
|
|
|
|
|
|
|
e200rpatcher-mac: e200rpatcher-i386 e200rpatcher-ppc
|
|
|
|
lipo -create e200rpatcher-ppc e200rpatcher-i386 -output e200rpatcher-mac
|
2007-09-11 16:47:26 +00:00
|
|
|
|
2009-07-11 15:23:56 +00:00
|
|
|
e200rpatcher.dmg: e200rpatcher-mac
|
2009-07-11 22:50:22 +00:00
|
|
|
mkdir -p e200rpatcher-dmg
|
|
|
|
cp -p e200rpatcher-mac e200rpatcher-dmg
|
2009-07-11 15:23:56 +00:00
|
|
|
hdiutil create -srcfolder e200rpatcher-dmg e200rpatcher.dmg
|
|
|
|
|
2007-09-11 16:47:26 +00:00
|
|
|
e200rpatcher-i386: e200rpatcher.c bootimg.c usb.h libusb-i386.a
|
2008-02-24 19:39:51 +00:00
|
|
|
gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -framework iokit -framework coreservices -arch i386 $(CFLAGS) -o e200rpatcher-i386 e200rpatcher.c bootimg.c -I. libusb-i386.a
|
2007-09-09 13:30:40 +00:00
|
|
|
strip e200rpatcher-i386
|
|
|
|
|
2007-09-11 16:47:26 +00:00
|
|
|
e200rpatcher-ppc: e200rpatcher.c bootimg.c usb.h libusb-ppc.a
|
2008-02-24 19:39:51 +00:00
|
|
|
gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -framework iokit -framework coreservices -arch ppc $(CFLAGS) -o e200rpatcher-ppc e200rpatcher.c bootimg.c -I. libusb-ppc.a
|
2007-09-09 13:30:40 +00:00
|
|
|
strip e200rpatcher-ppc
|
|
|
|
|
2009-07-05 18:45:12 +00:00
|
|
|
bin2c: ../tools/bin2c.c
|
|
|
|
$(NATIVECC) $(CFLAGS) -o bin2c ../tools/bin2c.c
|
2007-09-09 13:30:40 +00:00
|
|
|
|
|
|
|
bootimg.c: bootloader.bin bin2c
|
|
|
|
./bin2c bootloader.bin bootimg
|
|
|
|
|
|
|
|
clean:
|
2009-07-11 15:23:56 +00:00
|
|
|
rm -f e200rpatcher.exe e200rpatcher-mac e200rpatcher-i386 e200rpatcher-ppc e200rpatcher bin2c bootimg.c bootimg.h *~ e200rpatcher.dmg
|
|
|
|
rm -rf e200rpatcher-dmg
|