129 lines
5.3 KiB
Makefile
129 lines
5.3 KiB
Makefile
CURRENT_PATH := $(shell pwd)
|
|
|
|
#Hi3516
|
|
#ARCH := arm
|
|
#COMPILER := arm-himix100-linux-
|
|
#LINUX_KERNEL_PATH := /home/matt/Hi3516/Hi3516EV200_SDK_V1.0.0.1/osdrv/opensource/kernel/linux-4.9.y
|
|
|
|
#Hi3518
|
|
#ARCH := arm
|
|
#COMPILER := arm-hisiv300-linux-uclibcgnueabi-
|
|
#LINUX_KERNEL_PATH := /home/matt/Hi3518/hi3518/linux-3.4.y
|
|
|
|
#FH8852
|
|
#ARCH := arm
|
|
#COMPILER := arm-fullhan-linux-uclibcgnueabi-
|
|
#LINUX_KERNEL_PATH := /home/matt/FH8852/FH8856_IPC_V1.1.0_20190125/board_support/kernel/linux-3.0.8
|
|
|
|
#Hi3536d
|
|
#ARCH := arm
|
|
#COMPILER := arm-hisiv510-linux-uclibcgnueabi-
|
|
#LINUX_KERNEL_PATH := /home/matt/Hi3536d/Hi3536DV100_SDK_V1.0.2.0/osdrv/opensource/kernel/linux-4.9.y
|
|
|
|
#OpenWRT MT7628
|
|
#ARCH := mips
|
|
#COMPILER := /home/matt/openwrt/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-7.3.0_musl/bin/mipsel-openwrt-linux-
|
|
#LINUX_KERNEL_PATH := /home/matt/openwrt/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/linux-4.14.151
|
|
#export STAGING_DIR = $(COMPILER)
|
|
|
|
#MTK SDK
|
|
ARCH := mips
|
|
COMPILER := /opt/buildroot-gcc463/usr/bin/mipsel-linux-
|
|
LINUX_KERNEL_PATH := /home/dongyun/work/disk4/AH6001/RT288x_AHv1.2/source/linux-3.10.14.x
|
|
|
|
#Raspberry Pi
|
|
#ARCH := arm
|
|
#LINUX_KERNEL := $(shell uname -r)
|
|
#LINUX_KERNEL_PATH := /usr/src/linux-headers-$(LINUX_KERNEL)
|
|
|
|
|
|
CFLAGS += -DCONFIG_HGIC_AH
|
|
#CFLAGS += -DCONFIG_HGIC_2G
|
|
|
|
export CONFIG_HGIC_AH = y
|
|
#export CONFIG_HGIC_2G = y
|
|
|
|
help:
|
|
@echo "-------------------------------------------------------------------------------------------------------------------"
|
|
@echo "usage:"
|
|
@echo " make smac : compile SMAC driver. generate 3 ko files : hgics.ko, hgic_sdio.ko hgic_usb.ko."
|
|
@echo " make smac_usb : compile SMAC driver. generate 1 ko file : hgics_usb.ko (combined hgics.ko and hgic_usb.ko)."
|
|
@echo " make smac_sdio: compile SMAC driver. generate 1 ko file : hgics_sdio.ko (combined hgics.ko and hgic_sdio.ko)."
|
|
@echo ""
|
|
@echo " make fmac : compile FMAC driver. generate 3 ko files : hgicf.ko, hgic_sdio.ko hgic_usb.ko."
|
|
@echo " make fmac_usb : compile FMAC driver. generate 1 ko file : hgicf_usb.ko (combined hgicf.ko and hgic_usb.ko)."
|
|
@echo " make fmac_sdio: compile FMAC driver. generate 1 ko file : hgicf_sdio.ko (combined hgicf.ko and hgic_sdio.ko)."
|
|
@echo ""
|
|
@echo " make clean"
|
|
@echo "-------------------------------------------------------------------------------------------------------------------"
|
|
|
|
smac: prepare _smac _driver_smac
|
|
|
|
fmac: prepare _fmac _driver_fmac
|
|
|
|
smac_usb: prepare _smac_usb
|
|
|
|
smac_sdio: prepare _smac_sdio
|
|
|
|
fmac_usb: prepare _fmac_usb
|
|
|
|
fmac_sdio: prepare _fmac_sdio
|
|
|
|
prepare:
|
|
mkdir -p ko
|
|
|
|
_fmac:
|
|
$(MAKE) -C $(LINUX_KERNEL_PATH) M=$(CURRENT_PATH)/hgic_fmac ARCH=$(ARCH) CROSS_COMPILE=$(COMPILER) CONFIG_HGICF=hgicf EXTRA_CFLAGS=$(CFLAGS) modules
|
|
cp -f hgic_fmac/hgicf.ko ko/hgicf.ko
|
|
$(COMPILER)strip -g ko/hgicf.ko
|
|
|
|
_smac:
|
|
$(MAKE) -C $(LINUX_KERNEL_PATH) M=$(CURRENT_PATH)/hgic_smac ARCH=$(ARCH) CROSS_COMPILE=$(COMPILER) CONFIG_HGICS=hgics EXTRA_CFLAGS=$(CFLAGS) modules
|
|
cp -f hgic_smac/hgics.ko ko/hgics.ko
|
|
$(COMPILER)strip -g ko/hgics.ko
|
|
|
|
_fmac_sdio:
|
|
$(MAKE) -C $(LINUX_KERNEL_PATH) M=$(CURRENT_PATH)/hgic_fmac ARCH=$(ARCH) CROSS_COMPILE=$(COMPILER) CONFIG_HGICF=hgicf_sdio EXTRA_CFLAGS="$(CFLAGS) -DCONFIG_HGIC_SDIOIN" modules
|
|
cp -f hgic_fmac/hgicf_sdio.ko ko/hgicf_sdio.ko
|
|
$(COMPILER)strip -g ko/hgicf_sdio.ko
|
|
|
|
_fmac_usb:
|
|
$(MAKE) -C $(LINUX_KERNEL_PATH) M=$(CURRENT_PATH)/hgic_fmac ARCH=$(ARCH) CROSS_COMPILE=$(COMPILER) CONFIG_HGICF=hgicf_usb EXTRA_CFLAGS="$(CFLAGS) -DCONFIG_HGIC_USBIN" modules
|
|
cp -f hgic_fmac/hgicf_usb.ko ko/hgicf_usb.ko
|
|
$(COMPILER)strip -g ko/hgicf_usb.ko
|
|
|
|
_smac_sdio:
|
|
$(MAKE) -C $(LINUX_KERNEL_PATH) M=$(CURRENT_PATH)/hgic_smac ARCH=$(ARCH) CROSS_COMPILE=$(COMPILER) CONFIG_HGICS=hgics_sdio EXTRA_CFLAGS="$(CFLAGS) -DCONFIG_HGIC_SDIOIN" modules
|
|
cp -f hgic_smac/hgics_sdio.ko ko/hgics_sdio.ko
|
|
$(COMPILER)strip -g ko/hgics_sdio.ko
|
|
|
|
_smac_usb:
|
|
$(MAKE) -C $(LINUX_KERNEL_PATH) M=$(CURRENT_PATH)/hgic_smac ARCH=$(ARCH) CROSS_COMPILE=$(COMPILER) CONFIG_HGICS=hgics_usb EXTRA_CFLAGS="$(CFLAGS) -DCONFIG_HGIC_USBIN" modules
|
|
cp -f hgic_smac/hgics_usb.ko ko/hgics_usb.ko
|
|
$(COMPILER)strip -g ko/hgics_usb.ko
|
|
|
|
_driver_fmac:
|
|
cp -f hgic_fmac/Module.symvers utils/Module.symvers
|
|
$(MAKE) -C $(LINUX_KERNEL_PATH) M=$(CURRENT_PATH)/utils ARCH=$(ARCH) CROSS_COMPILE=$(COMPILER) EXTRA_CFLAGS=$(CFLAGS) modules
|
|
cp -f utils/hgic_usb.ko ko/hgic_usb.ko
|
|
cp -f utils/hgic_sdio.ko ko/hgic_sdio.ko
|
|
$(COMPILER)strip -g ko/hgic_usb.ko
|
|
$(COMPILER)strip -g ko/hgic_sdio.ko
|
|
|
|
_driver_smac:
|
|
cp -f hgic_smac/Module.symvers utils/Module.symvers
|
|
$(MAKE) -C $(LINUX_KERNEL_PATH) M=$(CURRENT_PATH)/utils ARCH=$(ARCH) CROSS_COMPILE=$(COMPILER) EXTRA_CFLAGS=$(CFLAGS) modules
|
|
cp -f utils/hgic_usb.ko ko/hgic_usb.ko
|
|
cp -f utils/hgic_sdio.ko ko/hgic_sdio.ko
|
|
$(COMPILER)strip -g ko/hgic_usb.ko
|
|
$(COMPILER)strip -g ko/hgic_sdio.ko
|
|
|
|
clean:
|
|
rm -fr Module.symvers ; rm -fr Module.markers ; rm -fr modules.order
|
|
cd hgic_fmac ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko Module.symvers modules.order
|
|
cd hgic_smac ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko Module.symvers modules.order
|
|
cd hgic_smac/umac ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
|
|
cd hgic_smac/umac/cfg80211 ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
|
|
cd hgic_smac/umac/mac80211 ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
|
|
cd utils ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko Module.symvers modules.order
|
|
rm -rf ko
|