Linux version with old libusb done
[usb-relay-hid.git] / commandline / Makefile
1 # Makefile for HID USB relay utility, hidusbrelay-cmd
2 # pa01 16-apr-2014
3 #
4 # prototype:
5 # Author: Christian Starkjohann
6 # Creation Date: 2008-04-11
7 # Tabsize: 4
8 # Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH
9 # License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
10
11
12 CMD_UTILITY=hidusb-relay-cmd
13
14 # For Unix/Linux, Mac OS X:
15 # Using old simple version of libusb
16 USBFLAGS= `libusb-config --cflags`
17 USBLIBS= `libusb-config --libs`
18 EXE_SUFFIX=
19
20 # Use the following 3 lines on Windows and comment out the 3 above:
21 #USBFLAGS=
22 #USBLIBS= -lhid -lusb -lsetupapi
23 #EXE_SUFFIX= .exe
24
25 #+pa GCC on my ubuntu won't pick this dir by default ?!
26 #USBFLAGS+=-I/usr/include
27
28 CC= gcc
29 DEBUGFLAGS=
30 CFLAGS= -O -Wall $(USBFLAGS) $(DEBUGFLAGS)
31 LIBS= $(USBLIBS)
32
33 OBJ= usbrelay-cmd.o hiddata.o
34 PROGRAM= $(CMD_UTILITY)$(EXE_SUFFIX)
35
36 all: $(PROGRAM)
37
38 $(PROGRAM): $(OBJ)
39 $(CC) -o $(PROGRAM) $(OBJ) $(LIBS)
40
41 strip: $(PROGRAM)
42 strip $(PROGRAM)
43
44 clean:
45 rm -f $(OBJ) $(PROGRAM)
46
47 .c.o:
48 $(CC) $(ARCH_COMPILE) $(CFLAGS) -c $*.c -o $*.o