blob: 88d59bda60cbf2877d90c9868cbeb697740cbae1 [file] [log] [blame]
Dave Chapman71cdf002007-10-20 09:11:34 +00001# This contains the file to upload
2ROMFILE=player.rom
3
Dave Chapman9de9b9d2010-05-02 09:54:14 +00004ifndef VERSION
Amaury Pouly27433072013-09-18 13:05:29 +02005VERSION=$(shell ../../tools/version.sh ../../)
Dave Chapman9de9b9d2010-05-02 09:54:14 +00006endif
7
8CFLAGS=-Wall -W -I/usr/local/include -DVERSION=\"$(VERSION)\"
Dave Chapman71cdf002007-10-20 09:11:34 +00009
10ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
11OUTPUT=tcctool.exe
12CROSS=
13CFLAGS+=-mno-cygwin
14else
15OUTPUT=tcctool
16CROSS=i586-mingw32msvc-
17endif
18
19LIBS = -lusb
20WINLIBS = -I libusb-win32-device-bin-0.1.12.1/include libusb-win32-device-bin-0.1.12.1/lib/dynamic/libusb_dyn.c
21
22NATIVECC = gcc
23CC = $(CROSS)gcc
24
25all: $(OUTPUT)
26
27tcctool: tcctool.c
28 gcc $(CFLAGS) $(LIBS) -o tcctool tcctool.c
29 strip tcctool
30
31tcctool.exe: tcctool.c
32 $(CC) $(CFLAGS) $(WINLIBS) -o tcctool.exe tcctool.c
33 $(CROSS)strip tcctool.exe
34
35tcctool-mac: tcctool-i386 tcctool-ppc
36 lipo -create tcctool-ppc tcctool-i386 -output tcctool-mac
37
38tcctool-i386: tcctool.c usb.h libusb-i386.a
39 gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -framework iokit -framework coreservices -arch i386 $(CFLAGS) -o tcctool-i386 tcctool.c -I. libusb-i386.a
40 strip tcctool-i386
41
42tcctool-ppc: tcctool.c usb.h libusb-ppc.a
43 gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -framework iokit -framework coreservices -arch ppc $(CFLAGS) -o tcctool-ppc tcctool.c -I. libusb-ppc.a
44 strip tcctool-ppc
45
46clean:
47 rm -f tcctool.exe tcctool-mac tcctool-i386 tcctool-ppc tcctool *~