summaryrefslogtreecommitdiffstats
path: root/utils/tcctool/Makefile
blob: 88d59bda60cbf2877d90c9868cbeb697740cbae1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# This contains the file to upload
ROMFILE=player.rom

ifndef VERSION
VERSION=$(shell ../../tools/version.sh ../../)
endif

CFLAGS=-Wall -W -I/usr/local/include -DVERSION=\"$(VERSION)\"

ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
OUTPUT=tcctool.exe
CROSS=
CFLAGS+=-mno-cygwin
else
OUTPUT=tcctool
CROSS=i586-mingw32msvc-
endif

LIBS = -lusb
WINLIBS = -I libusb-win32-device-bin-0.1.12.1/include libusb-win32-device-bin-0.1.12.1/lib/dynamic/libusb_dyn.c 

NATIVECC = gcc
CC = $(CROSS)gcc

all: $(OUTPUT)

tcctool: tcctool.c
	gcc $(CFLAGS) $(LIBS) -o tcctool tcctool.c
	strip tcctool

tcctool.exe:  tcctool.c
	$(CC) $(CFLAGS) $(WINLIBS) -o tcctool.exe tcctool.c
	$(CROSS)strip tcctool.exe

tcctool-mac: tcctool-i386 tcctool-ppc
	lipo -create tcctool-ppc tcctool-i386 -output tcctool-mac

tcctool-i386:  tcctool.c usb.h libusb-i386.a
	gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -framework iokit -framework coreservices -arch i386 $(CFLAGS) -o tcctool-i386 tcctool.c -I. libusb-i386.a
	strip tcctool-i386

tcctool-ppc: tcctool.c usb.h libusb-ppc.a
	gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -framework iokit -framework coreservices -arch ppc $(CFLAGS) -o tcctool-ppc tcctool.c -I. libusb-ppc.a
	strip tcctool-ppc

clean:
	rm -f tcctool.exe tcctool-mac tcctool-i386 tcctool-ppc tcctool *~