diff --git "a/#define DRIVERVERSION \"v5.2.20.2_ohd_THIS_IS_DIRTY\"" "b/#define DRIVERVERSION \"v5.2.20.2_ohd_THIS_IS_DIRTY\"" new file mode 100644 index 00000000..8b6ff93e --- /dev/null +++ "b/#define DRIVERVERSION \"v5.2.20.2_ohd_THIS_IS_DIRTY\"" @@ -0,0 +1 @@ +ERSION_HEADER diff --git a/Makefile b/Makefile index d40cc580..cab606f4 100755 --- a/Makefile +++ b/Makefile @@ -1,3 +1,4 @@ +VERSION_HEADER = include/rtw_version.h EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS) -fno-pie EXTRA_CFLAGS += -O1 #EXTRA_CFLAGS += -O3 @@ -1603,6 +1604,8 @@ export CONFIG_RTL8812AU = m all: modules modules: + @echo '#define DRIVERVERSION "v5.2.20.2_ohd_$(shell git rev-parse --short HEAD)"' > $(VERSION_HEADER) + $(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KSRC) M=$(shell pwd) O="$(KBUILD_OUTPUT)" modules strip: @@ -1658,6 +1661,7 @@ config_r: .PHONY: modules clean clean: + @echo '#define DRIVERVERSION "v5.2.20.2_ohd_THIS_IS_DIRTY"' > $(VERSION_HEADER) #$(MAKE) -C $(KSRC) M=$(shell pwd) clean cd hal ; rm -fr */*/*/*.mod.c */*/*/*.mod */*/*/*.o */*/*/*.o.* */*/*/.*.cmd */*/*/*.ko cd hal ; rm -fr */*/*.mod.c */*/*.mod */*/*.o */*/*.o.* */*/.*.cmd */*/*.ko @@ -1672,4 +1676,5 @@ clean: rm -fr *.mod.c *.mod *.o *.o.* .*.cmd *.ko *~ rm -fr .tmp_versions rm -fr .cache.mk + endif diff --git a/include/rtw_version.h b/include/rtw_version.h index 042f3b4b..9711e493 100644 --- a/include/rtw_version.h +++ b/include/rtw_version.h @@ -1,12 +1 @@ -#ifndef RTW_VERSION_H -#define RTW_VERSION_H - -// Helper macro to convert a macro to a string -#define STR_HELPER(x) #x -#define STR(x) STR_HELPER(x) - -// Generate the version string with the current date in the format v5.2.20.2_OHD_20122023 -#define CURRENT_DATE __DATE__ -#define DRIVERVERSION "v5.2.20.2_OHD_" STR(CURRENT_DATE[4]) STR(CURRENT_DATE[5]) STR(CURRENT_DATE[7]) STR(CURRENT_DATE[8]) STR(CURRENT_DATE[9]) STR(CURRENT_DATE[22]) STR(CURRENT_DATE[23]) - -#endif // RTW_VERSION_H +#define DRIVERVERSION "v5.2.20.2_ohd_THIS_IS_DIRTY"