ifdef HAVE_LIBUSB10

XHC_WHB04B6_LIB_DEPENDENCIES = ../lib/liblinuxcnchal.so.0 ../lib/liblinuxcncini.so.0 ../lib/librtapi_math.so.0 ../lib/libmtalk.so ../lib/libmachinetalk-pb2++.so
XHC_WHB04B6_SRC = hal/user_comps/xhc-whb04b-6/hal.cc \
                  hal/user_comps/xhc-whb04b-6/usb.cc \
                  hal/user_comps/xhc-whb04b-6/pendant-types.cc \
                  hal/user_comps/xhc-whb04b-6/pendant.cc \
                  hal/user_comps/xhc-whb04b-6/xhc-whb04b6.cc \
                  hal/user_comps/xhc-whb04b-6/main.cc

XHC_WHB04B6_DEBUG = -g -funwind-tables
XHC_WHB04B6_CFLAGS += $(LIBUSB10_CFLAGS) $(XHC_WHB04B6_DEBUG) -Wall
XHC_WHB04B6_LIBS = -lstdc++ $(LIBUSB10_LIBS) $(PROTOBUF_LIBS)

$(call TOOBJSDEPS, $(XHC_WHB04B6_SRC)) : EXTRAFLAGS += $(XHC_WHB04B6_CFLAGS)

xhc-whb04b6.o xhc-whb04b6.d : xhc-whb04b6.c xhc-whb04b6.h $(XHC_WHB04B6_LIB_DEPENDENCIES)
	$(ECHO) Linking $(notdir $@)
	$(Q)$(CC) $(LDFLAGS) $(XHC_WHB04B6_LIBS) -o $@ $^

pendant-types.o pendant-types.d : pendant-types.c pendant-types.h $(XHC_WHB04B6_LIB_DEPENDENCIES)
	$(ECHO) Linking $(notdir $@)
	$(Q)$(CC) $(LDFLAGS) $(XHC_WHB04B6_LIBS) -o $@ $^

pendant.o pendant.d : pendant.c pendant.h $(XHC_WHB04B6_LIB_DEPENDENCIES)
	$(ECHO) Linking $(notdir $@)
	$(Q)$(CC) $(LDFLAGS) $(XHC_WHB04B6_LIBS) -o $@ $^

hal.o hal.d : hal.c hal.h $(XHC_WHB04B6_LIB_DEPENDENCIES)
	$(ECHO) Linking $(notdir $@)
	$(Q)$(CC) $(LDFLAGS) $(XHC_WHB04B6_LIBS) -o $@ $^

usb.o usb.d : usb.c usb.h $(XHC_WHB04B6_LIB_DEPENDENCIES)
	$(ECHO) Linking $(notdir $@)
	$(Q)$(CC) $(LDFLAGS) $(XHC_WHB04B6_LIBS) -o $@ $^

USERSRCS += $(XHC_WHB04B6_SRC)
../bin/xhc-whb04b-6 xhc-whb04b-6.d : $(call TOOBJS, $(XHC_WHB04B6_SRC)) $(XHC_WHB04B6_LIB_DEPENDENCIES)
	$(ECHO) Linking $(notdir $@)
	$(Q)$(CC) $(LDFLAGS) $(XHC_WHB04B6_LIBS) -o $@ $^

TARGETS += ../bin/xhc-whb04b-6

endif # HAVE_LIBUSB10
