1###########################################
2# Simple Makefile for HIDAPI test program
3#
4# Alan Ott
5# Signal 11 Software
6# 2010-06-01
7###########################################
8
9all: hidtest libhidapi.dll
10
11CC=gcc
12CXX=g++
13COBJS=hid.o
14CPPOBJS=../hidtest/hidtest.o
15OBJS=$(COBJS) $(CPPOBJS)
16CFLAGS=-I../hidapi -g -c
17LIBS= -lsetupapi
18DLL_LDFLAGS = -mwindows -lsetupapi
19
20hidtest: $(OBJS)
21	g++ -g $^ $(LIBS) -o hidtest
22
23libhidapi.dll: $(OBJS)
24	$(CC) -g $^ $(DLL_LDFLAGS) -o libhidapi.dll
25
26$(COBJS): %.o: %.c
27	$(CC) $(CFLAGS) $< -o $@
28
29$(CPPOBJS): %.o: %.cpp
30	$(CXX) $(CFLAGS) $< -o $@
31
32clean:
33	rm *.o ../hidtest/*.o hidtest.exe
34
35.PHONY: clean
36