How to define function-like macro?

2013-11-25 Thread 乃宏周
I read manual already: -D name=definition The contents of definition are tokenized and processed as if they appeared during translation phase three in a ‘#define’ directive. In particular, the definition will be truncated by embedded newline characters. If you are invoking the preprocessor from a

How to add '-Dxxx' flags in Makefile?

2013-11-25 Thread 乃宏周
My makefile of `kpd.ko` is following: module_name = kpd src_sym = kpd_main a38_kpd util objs = $(addsuffix .o,$(src_sym)) wd = $(shell pwd) EXTRA_CFLAGS+=-DTEST ifneq ($(KERNELRELEASE),) obj-m := $(module_name).o $(module_name)-objs := $(objs) else kver = $(shell un