Skip to content

Commit

Permalink
Support running make DEBUG=1 to create a debug build.
Browse files Browse the repository at this point in the history
  • Loading branch information
rlofc committed Mar 22, 2016
1 parent f212953 commit 6a5ffaf
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
30 changes: 15 additions & 15 deletions Makefile
Expand Up @@ -20,19 +20,19 @@
# distribution.
CC = gcc
CFLAGS = `sdl2-config --cflags` -c
CFLAGS += -O3
# CFLAGS += -g3
DEBUG ?= 0
ifeq (DEBUG, 1)
CFLAGS += -g3
else
CFLAGS += -O3
endif
ifeq ($(UNAME_S),Linux)
CFLAGS += -std=c89
endif
WARNINGS = -Wall -Wno-unused-label
LDFLAGS =
LIBRARIES =
SOURCES = $(wildcard src/*.c)
OBJECTS = $(addprefix obj/,$(patsubst src/%,%,$(SOURCES:.c=.o) ) )
LIBRARY = build/libcage.a
CLDOC = python2 ~/.local/bin/cldoc


NO_COLOR=\x1b[0m
INFO_COLOR=\x1b[35;01m
Expand Down Expand Up @@ -81,12 +81,12 @@ doc:
@cd docs && make html

extra: $(LIBRARY)
cd samples/state && $(MAKE)
cd samples/image && $(MAKE)
cd samples/sprite && $(MAKE)
cd samples/timeline && $(MAKE)
cd samples/callout && $(MAKE)
cd samples/collisions && $(MAKE)
cd samples/wizard && $(MAKE)
cd samples/chipmunk && $(MAKE)
cd samples/tiled && $(MAKE)
cd samples/state && $(MAKE) DEBUG=$(DEBUG)
cd samples/image && $(MAKE) DEBUG=$(DEBUG)
cd samples/sprite && $(MAKE) DEBUG=$(DEBUG)
cd samples/timeline && $(MAKE) DEBUG=$(DEBUG)
cd samples/callout && $(MAKE) DEBUG=$(DEBUG)
cd samples/collisions && $(MAKE) DEBUG=$(DEBUG)
cd samples/wizard && $(MAKE) DEBUG=$(DEBUG)
cd samples/chipmunk && $(MAKE) DEBUG=$(DEBUG)
cd samples/tiled && $(MAKE) DEBUG=$(DEBUG)
8 changes: 6 additions & 2 deletions samples/common.mk
Expand Up @@ -20,8 +20,12 @@
# distribution.
CC = gcc
CFLAGS += `sdl2-config --cflags` -I../../src/ -c
CFLAGS += -O3
# CFLAGS += -g3
DEBUG ?= 0
ifeq (DEBUG, 1)
CFLAGS += -g3
else
CFLAGS += -O3
endif
ifeq ($(UNAME_S),Linux)
CFLAGS += -std=c89
endif
Expand Down

0 comments on commit 6a5ffaf

Please sign in to comment.