Makefile.am to control Debug, Release


#1

Folks,

Does anyone know the Makefile.am directives for making my Juce a Debug versus Release mode for a GNU Autotools project? Ubuntu Linux 9.10.

I’m doing:
aclocal
autoconf
automake

My src/Makefile.am looks like this:

bin_PROGRAMS = program 

program_SOURCES = Program1.cpp Program2.cpp Program3.cpp

program_LDFLAGS = -L"/usr/X11R6/lib/" -lfreetype -lpthread -lX11 -lGL -lGLU -lXinerama -lasound -lpam -lcrypt

program_CPPFLAGS = -D "LINUX=1" -D "CONFIG=Release" -I "/usr/include" -I "/usr/include/freetype2" 

CLEANFILES = *.o program

The Makefile.am should be controlling this and I’ve tried the CONFIG=Release and CONFIG=Debug, but in both instances it’s always Debug.


#2

I studied the Jucer.make and found that the Release mode compiler flag should be:
-D “NDEBUG=1”

But it still isn’t working. Here is my final Makefile.am. Can anyone help?

    bin_PROGRAMS = program

    program_SOURCES = Program1.cpp Program2.cpp Program3.cpp

    program_LDFLAGS = -L"/usr/X11R6/lib/" -lfreetype -lpthread -lX11 -lGL -lGLU -lXinerama -lasound -lpam -lcrypt

    program_CPPFLAGS = -D "LINUX=1" -D "NDEBUG=1" -I "/usr/include" -I "/usr/include/freetype2"

    CLEANFILES = *.o program