0
0
Fork 0
hgicf/Makefile

108 lines
4.3 KiB
Makefile
Raw Normal View History

2023-05-16 09:13:19 +00:00
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-
2023-10-12 23:37:43 +00:00
#LINUX_KERNEL_PATH := $(CURRENT_PATH)/../linux-3.0.8
#CFLAGS += -DFH8852 -DCONFIG_USB_ZERO_PACKET
2023-05-16 09:13:19 +00:00
#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-
2023-10-12 23:37:43 +00:00
LINUX_KERNEL_PATH := $(CURRENT_PATH)/../source/linux-3.10.14.x
2023-05-16 09:13:19 +00:00
#Raspberry Pi
#ARCH := arm
#LINUX_KERNEL := $(shell uname -r)
#LINUX_KERNEL_PATH := /usr/src/linux-headers-$(LINUX_KERNEL)
2023-10-12 23:37:43 +00:00
#################################################################################################
#CFLAGS += -DCONFIG_HGIC_AH
#export CONFIG_HGIC_AH = y
2023-05-16 09:13:19 +00:00
2023-10-12 23:37:43 +00:00
CFLAGS += -DCONFIG_HGIC_2G
export CONFIG_HGIC_2G = y
2023-05-16 09:13:19 +00:00
2023-10-12 23:37:43 +00:00
#CFLAGS += -DCONFIG_HGIC_STABR
#export CONFIG_HGIC_STABR = y
CFLAGS += -DCONFIG_SDIO_REINIT
2023-05-16 09:13:19 +00:00
help:
2023-10-12 23:37:43 +00:00
@echo "--------------------------------------------------------------------------------------"
2023-05-16 09:13:19 +00:00
@echo "usage:"
2023-10-12 23:37:43 +00:00
@echo " make smac : compile SMAC driver. support sdio/usb interface. generate hgics.ko"
@echo " make smac_usb : compile SMAC driver. only support usb interface. generate hgics.ko"
@echo " make smac_sdio: compile SMAC driver. only support sdio interface. generate hgics.ko"
2023-05-16 09:13:19 +00:00
@echo ""
2023-10-12 23:37:43 +00:00
@echo " make fmac : compile FMAC driver. support sdio/usb interface. generate hgicf.ko"
@echo " make fmac_usb : compile FMAC driver. only support usb interface. generate hgicf.ko"
@echo " make fmac_sdio: compile FMAC driver. only support sdio interface. generate hgicf.ko"
2023-05-16 09:13:19 +00:00
@echo ""
@echo " make clean"
2023-10-12 23:37:43 +00:00
@echo "--------------------------------------------------------------------------------------"
2023-05-16 09:13:19 +00:00
2023-10-12 23:37:43 +00:00
prepare:
mkdir -p ko
2023-05-16 09:13:19 +00:00
2023-10-12 23:37:43 +00:00
smac: prepare
$(MAKE) -C $(LINUX_KERNEL_PATH) M=$(CURRENT_PATH)/hgic_smac ARCH=$(ARCH) CROSS_COMPILE=$(COMPILER) CONFIG_HGICS=m CONFIG_HGIC_USB=y CONFIG_HGIC_SDIO=y EXTRA_CFLAGS="$(CFLAGS) -DCONFIG_HGIC_SDIO -DCONFIG_HGIC_USB" modules
cp -f hgic_smac/hgics.ko ko/hgics.ko
$(COMPILER)strip -g ko/hgics.ko
2023-05-16 09:13:19 +00:00
2023-10-12 23:37:43 +00:00
smac_usb: prepare
$(MAKE) -C $(LINUX_KERNEL_PATH) M=$(CURRENT_PATH)/hgic_smac ARCH=$(ARCH) CROSS_COMPILE=$(COMPILER) CONFIG_HGICS=m CONFIG_HGIC_USB=y EXTRA_CFLAGS="$(CFLAGS) -DCONFIG_HGIC_USB" modules
cp -f hgic_smac/hgics.ko ko/hgics.ko
$(COMPILER)strip -g ko/hgics.ko
2023-05-16 09:13:19 +00:00
2023-10-12 23:37:43 +00:00
smac_sdio: prepare
$(MAKE) -C $(LINUX_KERNEL_PATH) M=$(CURRENT_PATH)/hgic_smac ARCH=$(ARCH) CROSS_COMPILE=$(COMPILER) CONFIG_HGICS=m CONFIG_HGIC_SDIO=y EXTRA_CFLAGS="$(CFLAGS) -DCONFIG_HGIC_SDIO" modules
cp -f hgic_smac/hgics.ko ko/hgics.ko
$(COMPILER)strip -g ko/hgics.ko
2023-05-16 09:13:19 +00:00
2023-10-12 23:37:43 +00:00
fmac: prepare
$(MAKE) -C $(LINUX_KERNEL_PATH) M=$(CURRENT_PATH)/hgic_fmac ARCH=$(ARCH) CROSS_COMPILE=$(COMPILER) CONFIG_HGICF=m CONFIG_HGIC_USB=y CONFIG_HGIC_SDIO=y EXTRA_CFLAGS="$(CFLAGS) -DCONFIG_HGIC_SDIO -DCONFIG_HGIC_USB" modules
2023-05-16 09:13:19 +00:00
cp -f hgic_fmac/hgicf.ko ko/hgicf.ko
$(COMPILER)strip -g ko/hgicf.ko
2023-10-12 23:37:43 +00:00
fmac_usb: prepare
$(MAKE) -C $(LINUX_KERNEL_PATH) M=$(CURRENT_PATH)/hgic_fmac ARCH=$(ARCH) CROSS_COMPILE=$(COMPILER) CONFIG_HGICF=m CONFIG_HGIC_USB=y EXTRA_CFLAGS="$(CFLAGS) -DCONFIG_HGIC_USB" modules
cp -f hgic_fmac/hgicf.ko ko/hgicf.ko
$(COMPILER)strip -g ko/hgicf.ko
2023-05-16 09:13:19 +00:00
2023-10-12 23:37:43 +00:00
fmac_sdio: prepare
$(MAKE) -C $(LINUX_KERNEL_PATH) M=$(CURRENT_PATH)/hgic_fmac ARCH=$(ARCH) CROSS_COMPILE=$(COMPILER) CONFIG_HGICF=m CONFIG_HGIC_SDIO=y EXTRA_CFLAGS="$(CFLAGS) -DCONFIG_HGIC_SDIO" modules
cp -f hgic_fmac/hgicf.ko ko/hgicf.ko
$(COMPILER)strip -g ko/hgicf.ko
2023-05-16 09:13:19 +00:00
clean:
2023-10-12 23:37:43 +00:00
@find ./ -name "*.o" | xargs rm -fv
@find ./ -name "*.ko" | xargs rm -fv
@find ./ -name "*.cmd" | xargs rm -fv
@find ./ -name "*.symvers" | xargs rm -fv
@find ./ -name "*.markers" | xargs rm -fv
@find ./ -name "*.order" | xargs rm -fv
@find ./ -name "*.mod.c" | xargs rm -fv
@rm -rf ko