# Makefile: COPTS vs CFLAGS

2 messages from 2005-07-29 to 2005-07-29. Participants: Petr Baudis, Timo Hirvonen.
Thread: https://gitlist.dev/t/1363

## Petr Baudis, 2005-07-29 13:40

Subject: Makefile: COPTS vs CFLAGS
Message-ID: <20050729134011.GD21909@pasky.ji.cz>
URL: https://gitlist.dev/e/20050729134011.GD21909%40pasky.ji.cz

```
  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, 2005-07-29 14:03

Subject: Re: Makefile: COPTS vs CFLAGS
Message-ID: <20050729170327.5f8f3d5a.tihirvon@ee.oulu.fi>
URL: https://gitlist.dev/e/20050729170327.5f8f3d5a.tihirvon%40ee.oulu.fi
In-Reply-To: <20050729134011.GD21909@pasky.ji.cz>

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

>   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/

```
