makefile - Setting CFLAGS for pr_debug and printk -
i trying understand linux kernel module , see output of pr_debug , printk. using gnu make.
understand pr_debug messages, have use ddebug.
so, how enable printk statements ?
lets filename kvm.c. difference between these two:
cflags_kvm.o := -ddebug cflags_kvm.o += -ddebug what statement do:
cflags_kvm.o := -i. [edit]:
looks usage of square brackets has caused confusion. [filename], meant file, kvm.c.
i don't know how activate printk() - did search google? amongst other things, found this seems imply printk() available (but have mark messages appropriate level, , there control on levels displayed on console).
the square brackets in macro name unorthodox - , therefore extension specific system.
reading between lines, talking linux kernel , therefore gnu make, you'd if stated such things.
the := notation immediate assignment variable. rhs evaluated when line read , processed, not when macro used case. means if there macros referenced on rhs, subsequent changes macros not affect value of macro. consider:
cflags = ${oflags} ${iflags} ${dflags} ${wflags} cflags := ${oflags} ${iflags} ${dflags} ${wflags} the first variation notes cflags formed 4 named macros (well, actually, copies line ready later expansion), not expand values until used in (presumably) c compilation command.
the second variation looks values of 4 macros @ time when line read , expands them out. subsequent changes in 4 referenced macros not reflected in cflags.
the += notation adds rhs macro, rather replacing it.
Comments
Post a Comment