<div dir="ltr"><div>My makefile of `kpd.ko` is following:</div><div>============================</div><div>module_name = kpd</div><div>src_sym = kpd_main a38_kpd util</div><div>objs = $(addsuffix .o,$(src_sym))</div><div>wd = $(shell pwd)</div>
<div><br></div><div>EXTRA_CFLAGS+=-DTEST</div><div>ifneq ($(KERNELRELEASE),)</div><div><br></div><div>obj-m := $(module_name).o</div><div>$(module_name)-objs := $(objs)</div><div><br></div><div>else</div><div><br></div><div>
kver = $(shell uname -r)</div><div>kd = ../../linux-2.6.32.8</div><div>modules:</div><div><span class="" style="white-space:pre">        </span>$(MAKE) -C $(kd) M=$(wd) $@</div><div><br></div><div>clean:</div><div><span class="" style="white-space:pre">        </span>$(MAKE) -C $(kd) M=$(wd) $@</div>
<div><br></div><div>endif</div><div>=============================</div><div>Everything's fine,but I want to add `-DTEST` to EXTRA_CFLAGS.</div><div>Even if I put $(EXTRA_FLAGS) or other macro into `$(MAKE) -C $(kd) M=$(wd) $@`,</div>
<div>Nothing changed in all building process.</div><div><br></div><div>How should I do to insert `-Dxxx` to original Makefile ?</div></div>