add commandline utility
[usb-relay-hid.git] / commandline / Makefile
1 # Makefile for HID USB relay utility, usbrelay-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 # For Unix/Linux, Mac OS X:
13 USBFLAGS= `libusb-config --cflags`
14 USBLIBS= `libusb-config --libs`
15 EXE_SUFFIX=
16
17 # Use the following 3 lines on Windows and comment out the 3 above:
18 #USBFLAGS=
19 #USBLIBS= -lhid -lusb -lsetupapi
20 #EXE_SUFFIX= .exe
21
22 #+pa GCC on my ubuntu won't pick this dir by default ?!
23 #USBFLAGS+=-I/usr/include
24
25 CC= gcc
26 CFLAGS= -O -Wall $(USBFLAGS)
27 LIBS= $(USBLIBS)
28
29 OBJ= usbrelay-cmd.o hiddata.o
30 PROGRAM= usbrelay-cmd$(EXE_SUFFIX)
31
32 all: $(PROGRAM)
33
34 $(PROGRAM): $(OBJ)
35 $(CC) -o $(PROGRAM) $(OBJ) $(LIBS)
36
37 strip: $(PROGRAM)
38 strip $(PROGRAM)
39
40 clean:
41 rm -f $(OBJ) $(PROGRAM)
42
43 .c.o:
44 $(CC) $(ARCH_COMPILE) $(CFLAGS) -c $*.c -o $*.o