Results 1 to 2 of 2
Hi,
Small question regarding makefiles:
I want to add a new target: release
that will compile my driver with additional flag
(EXTRA_CFLAGS += -Drelease_flag)
how can i do that on ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 01-26-2009 #1Just Joined!
- Join Date
- Jan 2009
- Posts
- 1
Makefile with flags
Hi,
Small question regarding makefiles:
I want to add a new target: release
that will compile my driver with additional flag
(EXTRA_CFLAGS += -Drelease_flag)
how can i do that on this example:
thanksCode:KERNELPATH := /home/kernel-2.6.24/ .PHONY: all clean EXTRA_CFLAGS += -Werror EXTRA_CFLAGS += -I$(src)/dir1 EXTRA_CFLAGS += -I$(src)/dir2 all: modules obj-m := driver.o driver-objs := file1.o driver-objs += file2.o modules: make -C $(KERNELPATH) M=$(PWD) modules clean: make -C $(KERNELPATH) M=$(PWD) clean
- 02-05-2009 #2Just Joined!
- Join Date
- Feb 2008
- Posts
- 17
This is usually how I do it. (Note that I might not be doing it in a perfect way.
make -C $(KERNELPATH) M=$(PWD) CFLAGS_MODULE="-Drelease_flag" modules


Reply With Quote
