Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What meaning of the ',' in ifneq ($(KERNELRELEASE),)

3,403 views
Skip to first unread message

fl

unread,
Apr 27, 2013, 8:14:31 AM4/27/13
to



Hi,
I am reading the following Makefile script. I do not understand the ',' in the ifneq clause. I do not find the explanation in a pdf book on 'make'. Could you explain it to me?


Thanks,



.....................
# If KERNELRELEASE is defined, we've been invoked from the
# kernel build system and can use its language.
ifneq ($(KERNELRELEASE),)
obj-m := hello.o
# Otherwise we were called directly from the command
# line; invoke the kernel build system.
else
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
endif

Dan Espen

unread,
Apr 27, 2013, 10:02:48 AM4/27/13
to
fl <rxj...@gmail.com> writes:

> Hi,
> I am reading the following Makefile script. I do not understand the
> ,' in the ifneq clause. I do not find the explanation in a pdf book on
> make'. Could you explain it to me?
...
> ifneq ($(KERNELRELEASE),)

http://www.gnu.org/software/make/manual/html_node/Conditional-Syntax.html

Example of above shown.

--
Dan Espen

bachchu...@gmail.com

unread,
Apr 12, 2014, 2:27:13 AM4/12/14
to
There are two arguments, one is $(KERNELRELEASE)& other is empty "".
Comma "," is just separating both.
ifneq is checking whether $(KERNELRELEASE) has empty value or not.

neerajda...@gmail.com

unread,
Jun 7, 2015, 1:26:38 AM6/7/15
to
hi
iam new to device driver, here it is writtn that the if condition is used to check wheather the KERNELRELEASE has empty value or not but for what it is checking it

Barry Margolin

unread,
Jun 7, 2015, 1:20:02 PM6/7/15
to
In article <b0a0f730-86c7-489f...@googlegroups.com>,
It's explained in the comment right before the test:

# If KERNELRELEASE is defined, we've been invoked from the
# kernel build system and can use its language.

--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
0 new messages