WITH_DEBUG and CFLAGS sometimes are ignored

I tried those settings in make.conf:
Code:
.if ${.CURDIR:M*/games/sl}
CFLAGS+=        -pg
DEBUG_FLAGS+=   -pg
WITH_DEBUG=     YES
.endif

And later even basic settings:
Code:
WITH_DEBUG=     YES
DEBUG_FLAGS+=   -pg
CFLAGS+=        -pg
CXXFLAGS+=        -pg

Test commands:
Code:
> sudo portupgrade -f sl
> gprof `which sl`
gprof: /usr/local/bin/sl.gmon: No such file or directory

Test 2:
Code:
> gdb sl
(gdb) break 1
No symbol table is loaded.  Use the "file" command.
Tried manually to make in work directory, and flags are not passed in.

Tested with /usr/ports/lang/php52, it does work;/

What I'm doing wrong?
 
.gmon file is generated only after you run the app.
Code:
$ cd games/sl
$ make DEBUG_FLAGS='-pg -static'
$ cd $(make -V WRKSRC)
$ ./sl
$ [url=http://pastebin.com/fw6P0yyY]gprof sl sl.gmon[/url]
-static is required because you need to link against profiled libc, ncurses, i.e. /usr/lib/libc_p.a, /usr/lib/libncurses_p.a.
 
Back
Top