diff --git a/Makefile b/Makefile index 4b94551..7e0d5ac 100644 --- a/Makefile +++ b/Makefile @@ -7,10 +7,20 @@ LIBDIR := ext/tangerine LIB := $(LIBDIR)/build/libTangerine.a CXX := g++ -# NOTE: have to set -O or -O1 here to get warnings for uninitialized variables -CXXFLAGS := -std=c++11 -g -ggdb3 -O -Wall -Wuninitialized \ - -I$(LIBDIR)/include/ \ +# NOTE: due to a longstanding 'bug' in gcc, we can only check for unitialized +# variables if an optimization pass is run. However, compiling without +# optimization is useful for debugging, so we can add some local variables +# for easier inspection. +# see) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=18501 +CHECK_UNITIALIZED := false +ifeq ($(CHECK_UNITIALIZED), true) + CXXFLAGS := -std=c++11 -g -ggdb3 -O -Wall +else + CXXFLAGS := -std=c++11 -g -ggdb3 -Wall +endif +CXXFLAGS += -I$(LIBDIR)/include/ \ $(shell sdl2-config --cflags) + LDFLAGS := $(shell sdl2-config --libs) -lGLEW -lGL COMMON_SOURCES := $(SRCDIR)/orbits.cpp