Project

General

Profile

Bug #537

make CFLAGS=-g breaks examples build

Added by Mathieu Desnoyers almost 7 years ago. Updated almost 7 years ago.

Status:
Resolved
Priority:
High
Target version:
Start date:
05/17/2013
Due date:
% Done:

100%

Estimated time:

Description

cd doc/examples/easy-ust
compudj@thinkos:~/git/lttng-ust/doc/examples/easy-ust$ (git:master $)> make
gcc -I. -c -o tp.o tp.c
gcc -o sample sample.o tp.o -ldl -llttng-ust
compudj@thinkos:~/git/lttng-ust/doc/examples/easy-ust$ (git:master $)> make clean
rm -f .html
rm -f *.o sample
compudj@thinkos:~/git/lttng-ust/doc/examples/easy-ust$ (git:master $)> make CFLAGS=-g
gcc -g -c -o sample.o sample.c
gcc -g -c -o tp.o tp.c
In file included from sample_component_provider.h:143:0,
from tp.c:33:
/usr/local/include/lttng/tracepoint-event.h:60:28: fatal error: ./sample_component_provider.h: No such file or directory
compilation terminated.
make: *
* [tp.o] Error 1

for some reason, the CFLAGS += have no effect when a CFLAGS is specified on the command line.

#1

Updated by Jérémie Galarneau almost 7 years ago

'make CFLAGS=-g'
This will override the CFLAGS variable defined in the Makefile.

http://www.gnu.org/software/make/manual/html_node/Overriding.html

#2

Updated by Mathieu Desnoyers almost 7 years ago

So the Makefile is wrong.

CFLAGS += -I../../../include/

is therefore getting wiped out, and should not.

Basically,

make CFLAGS=-g

from the project root should never fail.

--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

#3

Updated by Jérémie Galarneau almost 7 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF