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

CFLAGS



Hi,

I'm wondering how to use CFLAGS properly debian/rules. I guess it really is a newbie question...

I read http://www.debian.org/doc/debian-policy/ch-files.html . dh- make currently does show how to set CFLAGS, but not how to pass it on.

In one of my packages, I do that (basically):

----8<----8<----8<- debian/rules

CFLAGS = -Wall -g -O2
CC = gcc $(CFLAGS)

build:
	$(MAKE) CC="$(CC)"

----8<----8<----8<----8<----8<----8<-

where upstream Makefile looks like:

----8<----8<----8<- Makefile

all: zerofree.c
	$(CC) -o zerofree -lext2fs zerofree.c

----8<----8<----8<----8<----8<----8<-

fakerrot debian/rules build then does the Right Thing(TM):
gcc -Wall -g -O2 -o zerofree -lext2fs zerofree.c

Is my approach correct ? shouldn't it be exemplified by dh-make?

Best regards, Thibaut.

Attachment: PGP.sig
Description: =?ISO-8859-1?Q?Ceci_est_une_signature_=E9lectronique_PGP?=


Reply to: