8da94aecf261f87df52e6e8d4564c0a5d36774e9
1 # Makefile for HID USB relay utility, hidusbrelay-cmd and library
3 # (Quick'n'dirty - no .h dependencies, etc.)
4 # Assume make is run in this dir
8 # Author: Christian Starkjohann
9 # Creation Date: 2008-04-11
10 # Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH
15 CMD_UTILITY
:= hidusb-relay-cmd
16 SHRLIB
:= usb_relay_device.so
18 # For Linux: Using old simple version 0.1 of libusb
19 HIDDATA
:= hiddata_libusb01
20 USBFLAGS
:= $(shell libusb-config
--cflags)
21 USBLIBS
:= $(shell libusb-config
--libs
)
25 # Use the following lines to build for Windows and comment out the 3 above:
26 #HIDDATA=hiddata_mswin
28 #USBLIBS= -lhid -lsetupapi
31 #+pa GCC on my ubuntu 12 won't pick this dir by default ?!
32 #USBFLAGS+=-I/usr/include
34 SRCS
= usbrelay-cmd
$(HIDDATA
)
36 PROGRAM
= $(CMD_UTILITY
)$(EXE_SUFFIX
)
38 all: $(PROGRAM
) $(SHRLIB
)
42 CFLAGS
= -O
-Wall
$(USBFLAGS
) $(DEBUGFLAGS
) -I
$(SRCDIR
)
44 OBJ
= $(addsuffix .o
,$(SRCS
))
48 $(CC
) -o
$(PROGRAM
) $(OBJ
) $(LIBS
)
54 rm -f
*.o
$(PROGRAM
) $(SHRLIB
)
57 $(CC
) $(ARCH_COMPILE
) $(CFLAGS
) -c
$*.c
-o
$*.o
61 # The main lib source is in lib/ and hiddata src with the cmd utility - reorg!
63 SRCS_LIB
= $(HIDDATA
) usb_relay_lib
67 $(SHRLIB
): $(addsuffix .o
, $(SRCS_LIB
))
68 $(CC
) -shared
-Wl
,-shared
$(addsuffix .o
, $(SRCS_LIB
)) $(LIBS
) -o
$(SHRLIB
)