diff --git a/sw/AMI/driver/Makefile b/sw/AMI/driver/Makefile index c429fcf..02ed5e6 100755 --- a/sw/AMI/driver/Makefile +++ b/sw/AMI/driver/Makefile @@ -25,20 +25,16 @@ $(TARGET_MODULE)-objs += gcq-driver/src/gcq_driver.o $(TARGET_MODULE)-objs += gcq-driver/src/gcq_hw.o $(TARGET_MODULE)-objs += gcq-driver/src/gcq_features.o -EXTRA_CFLAGS:=-I$(PWD) -I$(PWD)/fal -I$(PWD)/fal/gcq -I$(PWD)/gcq-driver/src +# To apply the macro to all the source files compiled with this makefile +ccflags-y := -I$(src) -I$(src)/fal -I$(src)/fal/gcq -I$(src)/gcq-driver/src +ccflags-y += -DDEBUG -DVERBOSE_DEBUG -DGCQ_MAX_INSTANCES=16 -KERNEL_DIR = /lib/modules/`uname -r`/build - -#CFLAGS_file_name will apply the macros to those files -# CFLAGS_versal_vmc.o:=-DDEBUG - -#To apply the macro to all the source files compiled with this makefile -# ccflags-y:=-DDEBUG -ccflags-y:=-DDEBUG -DVERBOSE_DEBUG -DGCQ_MAX_INSTANCES=16 +KERNEL_DIR ?= /lib/modules/$(shell uname -r)/build +PWD := $(shell pwd) all: clean @test -f ../scripts/getVersion.sh && ../scripts/getVersion.sh driver $(realpath .) || echo "" - $(MAKE) -C ${KERNEL_DIR} M=${PWD} modules + $(MAKE) -C $(KERNEL_DIR) M=$(PWD) modules clean: - $(MAKE) -C ${KERNEL_DIR} M=${PWD} clean + $(MAKE) -C $(KERNEL_DIR) M=$(PWD) clean diff --git a/sw/AMI/driver/ami_amc_control.c b/sw/AMI/driver/ami_amc_control.c index 146b3d5..583b1d6 100755 --- a/sw/AMI/driver/ami_amc_control.c +++ b/sw/AMI/driver/ami_amc_control.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "gcq.h" #include "ami_top.h" diff --git a/sw/AMI/driver/ami_cdev.c b/sw/AMI/driver/ami_cdev.c index 834e5d3..b727dc4 100755 --- a/sw/AMI/driver/ami_cdev.c +++ b/sw/AMI/driver/ami_cdev.c @@ -15,6 +15,7 @@ #include #include #include +#include #include "ami.h" #include "ami_hwmon.h" diff --git a/sw/AMI/driver/ami_sensor.c b/sw/AMI/driver/ami_sensor.c index 9350f21..4203499 100755 --- a/sw/AMI/driver/ami_sensor.c +++ b/sw/AMI/driver/ami_sensor.c @@ -8,6 +8,7 @@ #include #include #include +#include #include "ami_top.h" #include "ami_sensor.h" diff --git a/sw/AMI/driver/ami_sysfs.c b/sw/AMI/driver/ami_sysfs.c index f2f3122..e63e3a4 100644 --- a/sw/AMI/driver/ami_sysfs.c +++ b/sw/AMI/driver/ami_sysfs.c @@ -7,6 +7,7 @@ #include #include +#include #include "ami.h" #include "ami_top.h"