[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Passing variables to a Makefile



2007/10/11, Charles Plessy <charles-debian-nospam@plessy.org>:
> Dear mentors,
>
> in a package I prepare, there is the following line in a source/Makefile:
>
>   CPPFLAGS=-O3 -funroll-loops -march=i686 -mfpmath=sse -msse  -mmmx
>
> This is obviously not convenient for building on many platforms, so I
> decided to override it with the following command in debian/rules:
>
>   CPPFLAGS='$(CFLAGS)' $(MAKE) --environment-overrides --directory=source
>
> However, I am quite unexperienced with makefiles, and my gut feeling
> tells me that I may be doing something wrong... Can somebody tell me ?

It seems OK for me, I usually do it that way too. You can also
alternatively override the variable sending it as a parameter for
make:

$(MAKE) -C source CPPFLAGS='$(CFLAGS)'

But in my opinion both ways are equivalent in this case.

I did not have time to have a look at the package anyway, so I haven't
tested it. I'm quite too busy these days, sorry.

Greetings,
Miry



Reply to: