Eg: a common device module's Makefile
obj-m:=jc.o
default:
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) modules
clean:
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) modules clean
I wonder if I can set gcc's CFLAGS for this specific Makefile. When I change default section to (note the addition of the -O2):
$(MAKE) -O2 -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) modules
The change does not take effect (i.e., - the -O2 is NOT added to the CFLAGS).
Any help? Thanks a lot.
$$PWDcan replace$(shell pwd)