<div dir="ltr">Hi<div>I have problem with passing flag from makefile to .c file.</div><div>During building external kernel module my macro isn't seen by compiler. I used plenty of ways.</div><div><br></div><div>First way:</div><div>ccflags-y += -DMY_FLAG<br></div><div>$(MAKE) -C $(KERNEL_SRC) M=$(SRC)<br></div><div>Second:</div><div>$(MAKE) -C $(KERNEL_SRC) M=$(SRC) CFLAGS_my-kernel-module.o="-DMY_FLAG"<br></div><div>Third:</div><div>$(MAKE) -C $(KERNEL_SRC) M=$(SRC) CFLAGS="-DMY_FLAG"  <br></div><div>Forth:</div><div> $(MAKE) -C $(KERNEL_SRC) M=$(SRC) ccflags-y="-DMY_FLAG"   </div><div><br></div><div>In general I use bitbake to build external kernel modules.  And I wonder if bitbake doesn't introduce issue as some of above solution really should work. And additionally I had to use absolute paths in headers because relative didn't work so -I append also doesn't work:<br></div><div>SRC := $(shell pwd)<br></div><div>ccflags-y := -I$(SRC)<br></div><div><br></div><div>BR</div><div>Tomek</div><div><br></div></div>