Eric W. Biederman wrote:

> Tyson D Sawyer <[EMAIL PROTECTED]> writes:
> 
> 
>>Ronald G Minnich wrote:
>>
>>
>>>On 4 Feb 2002, Eric W. Biederman wrote:
>>>
>>>
>>>>Grr.  Somehow I suspect I did that.  I guess I would have suspected
>>>>that if you had gotten any output and the boot didn't work.
>>>>
>>>>Any clue why that happened?
>>>>
>>>>
>>>it's all part of the changeover from
>>>option blah
>>>to
>>>option blah=1
>>>This changeover affects every .h and .c that uses
>>>#ifdef blah
>>>instead of
>>>#if (blah == 1)
>>>
>>
>>
>>Why was this change made?  What is the advantage?
>>
> 
> We can put the conditionals at the makefile level instead of at the
> #ifdef level.  The file level is usually cleaner.  The problem
> is mostly we are doing a gradual conversion and we forget the issue of
> needing to make certain the variable is set to a non-null value.
> 
> Eric
> 


but you can do ifdef in Makefiles:

[...]

KLINUX = linux

ifeq (linux, $(wildcard linux))
include $(KLINUX)/.config
endif

KCC = kgcc
KCFLAGS = -O2 -Wall -Wstrict-prototypes -fomit-frame-pointer
KCFLAGS += -fno-strict-aliasing -pipe -march=i686 -c
KCPPFLAGS = -D__KERNEL__ -DMODULE -I$(KLINUX)/include

ifdef CONFIG_MODVERSIONS
KCPPFLAGS += -DMODVERSIONS -include $(KLINUX)/include/linux/modversions.h
endif

fnmod.o : fnmod.c fnmod.h
         $(KCC) $(KCFLAGS) $(KCPPFLAGS) -o fnmod.o fnmod.c

clean:
         rm -f core *.o *~

[...]

That is a working makefile for a device driver.

Ty

-- 
Tyson D Sawyer                             iRobot Corporation
Senior Systems Engineer                    Military Systems Division
[EMAIL PROTECTED]                         Robots for the Real World
603-532-6900 ext 206                       http://www.irobot.com

Reply via email to