summaryrefslogtreecommitdiff
path: root/software/hhd70dongle/pcusbhid/Makefile
diff options
context:
space:
mode:
authorBernhard Tittelbach <xro@realraum.at>2012-05-17 06:14:24 +0000
committerBernhard Tittelbach <xro@realraum.at>2012-05-17 06:14:24 +0000
commit9bdf2f92bf95c69d668772e1c289ab89868aa738 (patch)
treee55a84d87ea7af7de84e5500221be66f83aa3d94 /software/hhd70dongle/pcusbhid/Makefile
parenthhd70 spi (diff)
usb lib
git-svn-id: https://svn.spreadspace.org/mur.sat@415 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'software/hhd70dongle/pcusbhid/Makefile')
-rw-r--r--software/hhd70dongle/pcusbhid/Makefile62
1 files changed, 62 insertions, 0 deletions
diff --git a/software/hhd70dongle/pcusbhid/Makefile b/software/hhd70dongle/pcusbhid/Makefile
new file mode 100644
index 0000000..c6689ed
--- /dev/null
+++ b/software/hhd70dongle/pcusbhid/Makefile
@@ -0,0 +1,62 @@
+
+OS = LINUX
+#OS = MACOSX
+#OS = WINDOWS
+
+PROG = rawhid_testinterface
+
+# To set up Ubuntu Linux to cross compile for Windows:
+#
+# apt-get install mingw32 mingw32-binutils mingw32-runtime
+#
+# Just edit the variable above for WINDOWS, then use "make" to build rawhid.exe
+
+ifeq ($(OS), LINUX)
+TARGET = $(PROG)
+CC = gcc
+STRIP = strip
+CFLAGS = -Wall -O2 -DOS_$(OS)
+LIBS = -lusb
+else ifeq ($(OS), MACOSX)
+TARGET = $(PROG).dmg
+SDK = /Developer/SDKs/MacOSX10.5.sdk
+ARCH = -mmacosx-version-min=10.5 -arch ppc -arch i386
+CC = gcc
+STRIP = strip
+CFLAGS = -Wall -O2 -DOS_$(OS) -isysroot $(SDK) $(ARCH)
+LIBS = $(ARCH) -Wl,-syslibroot,$(SDK) -framework IOKit -framework CoreFoundation
+else ifeq ($(OS), WINDOWS)
+TARGET = $(PROG).exe
+CC = i586-mingw32msvc-gcc
+STRIP = i586-mingw32msvc-strip
+CFLAGS = -Wall -O2 -DOS_$(OS)
+LIBS = -lhid -lsetupapi
+endif
+
+OBJS = $(PROG).o hid.o
+
+
+all: $(TARGET)
+
+$(PROG): $(OBJS)
+ $(CC) -o $(PROG) $(OBJS) $(LIBS)
+ $(STRIP) $(PROG)
+
+$(PROG).exe: $(PROG)
+ cp $(PROG) $(PROG).exe
+
+$(PROG).dmg: $(PROG)
+ mkdir tmp
+ cp $(PROG) tmp
+ hdiutil create -ov -volname "Raw HID Test" -srcfolder tmp $(PROG).dmg
+
+hid.o: hid_$(OS).c hid.h
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+reset.o: reset.c
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+clean:
+ rm -f *.o $(PROG) $(PROG).exe $(PROG).dmg
+ rm -rf tmp
+