###########################################
# Simple Makefile for HIDAPI test program
#
# Alan Ott
# Signal 11 Software
# 2010-07-03
###########################################

all: testgui

CC=gcc
CXX=g++
COBJS=../mac/hid.o
CPPOBJS=test.o
OBJCOBJS=mac_support_cocoa.o
OBJS=$(COBJS) $(CPPOBJS) $(OBJCOBJS)
CFLAGS=-I../hidapi -Wall -g -c `fox-config --cflags`
LIBS=`fox-config --libs` -framework IOKit -framework CoreFoundation -framework Cocoa


testgui: $(OBJS)
	g++ -Wall -g $^ $(LIBS) -o testgui
	./copy_to_bundle.sh
	#cp TestGUI.app/Contents/MacOS/testgui  TestGUI.app/Contents/MacOS/tg 
	#cp start.sh TestGUI.app/Contents/MacOS/testgui 

$(COBJS): %.o: %.c
	$(CC) $(CFLAGS) $< -o $@

$(CPPOBJS): %.o: %.cpp
	$(CXX) $(CFLAGS) $< -o $@

$(OBJCOBJS): %.o: %.m
	$(CXX) $(CFLAGS) -x objective-c++ $< -o $@


clean:
	rm $(OBJS) testgui

.PHONY: clean
