
#The name of the kernel module to build.
KMOD    = rtl8192du

.OBJ = ${.CURDIR}

#Tells PMake another place to search for included makefiles
CFLAGS += -I${.CURDIR}/include
.ifdef MP
CFLAGS += -DCONFIG_MP_INCLUDED=1
.endif

#Replace $(RTL871X) with rtl8192d
RTL871X = rtl8192d
MODULE_NAME = 8192du
HCI_NAME = usb

SRC_DIRS +=  ${.CURDIR}/os_dep
#List of source files.
SRCS     +=  osdep_service.c                      

SRC_DIRS +=  ${.CURDIR}/core/efuse
#List of source files.
SRCS     +=  rtw_efuse.c

SRC_DIRS += ${.CURDIR}/os_dep/bsd
#List of source files.
SRCS     += os_intfs.c                       \
            $(HCI_NAME)_intf.c               \
            ioctl_bsd.c                      \
            xmit_bsd.c                       \
            mlme_bsd.c                       \
            recv_bsd.c                       \
	    rtw_usb_compat_linux.c

SRC_DIRS += ${.CURDIR}/core
#List of source files.
SRCS     += rtw_xmit.c                             \
            rtw_cmd.c                              \
            rtw_security.c                         \
            rtw_debug.c                            \
            rtw_io.c                               \
            rtw_ioctl_query.c                      \
            rtw_ioctl_set.c                        \
            rtw_ieee80211.c                            \
            rtw_mlme.c                             \
            rtw_mlme_ext.c                         \
            rtw_wlan_util.c                        \
            rtw_pwrctrl.c                          \
            rtw_rf.c                               \
            rtw_recv.c                             \
            rtw_sta_mgt.c                          \
            rtw_p2p.c                              

.ifdef MP
SRCS	+= rtw_mp.c	\
		rtw_mp_ioctl.c
.endif

SRC_DIRS += ${.CURDIR}/hal
#List of source files.
SRCS     += hal_init.c                              

SRC_DIRS += ${.CURDIR}/hal/$(RTL871X)
#List of source files.
SRCS     += $(RTL871X)_hal_init.c        \
            $(RTL871X)_phycfg.c          \
            $(RTL871X)_rf6052.c          \
            $(RTL871X)_dm.c              \
            $(RTL871X)_rxdesc.c          \
            $(RTL871X)_cmd.c              

SRC_DIRS += ${.CURDIR}/hal/$(RTL871X)/usb
#List of source files.
SRCS     += usb_ops_bsd.c            \
            usb_halinit.c            \
            rtl$(MODULE_NAME)_led.c  \
            rtl$(MODULE_NAME)_xmit.c \
            rtl$(MODULE_NAME)_recv.c \
            Hal8192DUHWImg.c         \
            Hal8192DUTestHWImg.c
            
SRCS     += bus_if.h device_if.h                        \
            opt_bus.h opt_usb.h usb_if.h usbdevs.h      
                 

.PATH: ${.CURDIR} ${SRC_DIRS}

#Include other makefile. The file is FreeBSD provided
.include <bsd.kmod.mk>
