Dave Chapman | 71cdf00 | 2007-10-20 09:11:34 +0000 | [diff] [blame] | 1 | # This contains the file to upload |
| 2 | ROMFILE=player.rom |
| 3 | |
| 4 | CFLAGS=-Wall -W -I/usr/local/include |
| 5 | |
| 6 | ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN) |
| 7 | OUTPUT=tcctool.exe |
| 8 | CROSS= |
| 9 | CFLAGS+=-mno-cygwin |
| 10 | else |
| 11 | OUTPUT=tcctool |
| 12 | CROSS=i586-mingw32msvc- |
| 13 | endif |
| 14 | |
| 15 | LIBS = -lusb |
| 16 | WINLIBS = -I libusb-win32-device-bin-0.1.12.1/include libusb-win32-device-bin-0.1.12.1/lib/dynamic/libusb_dyn.c |
| 17 | |
| 18 | NATIVECC = gcc |
| 19 | CC = $(CROSS)gcc |
| 20 | |
| 21 | all: $(OUTPUT) |
| 22 | |
| 23 | tcctool: tcctool.c |
| 24 | gcc $(CFLAGS) $(LIBS) -o tcctool tcctool.c |
| 25 | strip tcctool |
| 26 | |
| 27 | tcctool.exe: tcctool.c |
| 28 | $(CC) $(CFLAGS) $(WINLIBS) -o tcctool.exe tcctool.c |
| 29 | $(CROSS)strip tcctool.exe |
| 30 | |
| 31 | tcctool-mac: tcctool-i386 tcctool-ppc |
| 32 | lipo -create tcctool-ppc tcctool-i386 -output tcctool-mac |
| 33 | |
| 34 | tcctool-i386: tcctool.c usb.h libusb-i386.a |
| 35 | gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -framework iokit -framework coreservices -arch i386 $(CFLAGS) -o tcctool-i386 tcctool.c -I. libusb-i386.a |
| 36 | strip tcctool-i386 |
| 37 | |
| 38 | tcctool-ppc: tcctool.c usb.h libusb-ppc.a |
| 39 | gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -framework iokit -framework coreservices -arch ppc $(CFLAGS) -o tcctool-ppc tcctool.c -I. libusb-ppc.a |
| 40 | strip tcctool-ppc |
| 41 | |
| 42 | clean: |
| 43 | rm -f tcctool.exe tcctool-mac tcctool-i386 tcctool-ppc tcctool *~ |