threads / discuss / 1363

Makefile: COPTS vs CFLAGS

Subject: Makefile: COPTS vs CFLAGS

## tl;dr

2 messages between Jul 29, 2005 and Jul 29, 2005.

replies: 1people: 2as markdown or json

Petr Baudis· Jul 29, 2005, 13:40 UTC · lore
  Hello,
  one more thing - should we keep the $COPTS variable? Most projects
(including Cogito) have the C flags controlled by the $CFLAGS variable.
  What I would propose:
	-COPTS=-g -O2
	-CFLAGS=$(COPTS) -Wall
	+CFLAGS?=-g -O2
	+CFLAGS+=-Wall
  That is, if user does not specify custom $CFLAGS, default to "-g -O2",
and always append -Wall (and more after I'll send my Makefile patches).
  Opinions?
-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
If you want the holes in your knowledge showing up try teaching
someone.  -- Alan Cox
Timo Hirvonen· Jul 29, 2005, 14:03 UTC · re: Petr Baudis · lore

Re: Makefile: COPTS vs CFLAGS

On Fri, 29 Jul 2005 15:40:11 +0200 Petr Baudis <pasky@suse.cz> wrote:

Show 6 quoted lines
>   What I would propose:
> 
> 	-COPTS=-g -O2
> 	-CFLAGS=$(COPTS) -Wall
> 	+CFLAGS?=-g -O2
> 	+CFLAGS+=-Wall

Sounds good. I've never heard of anyone using COPTS variable before. And "-g -O2" seems to be a good default value.

Using $DESTDIR instead of $dest would be nice too because DESTDIR is used by Autotools.

-- 
http://onion.dynserv.net/~timo/

← back to recent threads