Skip to contentSkip to conversation

Makefile: COPTS vs CFLAGS

DISCUSSION Petr Baudis 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

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?

Signature · 4 lines
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
If you want the holes in your knowledge showing up try teaching
someone.  -- Alan Cox
#1 lore raw
Quoted 6 lines · On Fri, 29 Jul 2005 15:40:11 +0200 Petr Baudis <[email protected]> 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.

Signature · 1 line
http://onion.dynserv.net/~timo/