From abfebf0eb219f03500f138ba00db63a678a30eb8 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Fri, 1 Apr 2016 22:53:29 +0300 Subject: [PATCH] Added debug/release configurations --- Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile b/Makefile index 8357c63..8c9d352 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ CC := clang CFLAGS += -Werror -Wall -std=gnu11 -ICore -D_GNU_SOURCE SDL_LDFLAGS := -lSDL LDFLAGS += -lc -lm +CONF ?= debug ifeq ($(shell uname -s),Darwin) CFLAGS += -F/Library/Frameworks @@ -20,6 +21,14 @@ LDFLAGS += -framework AppKit SDL_LDFLAGS := -framework SDL endif +ifeq ($(CONF),debug) +CFLAGS += -g +else ifeq ($(CONF), release) +CFLAGS += -O3 +else +$(error Invalid value for CONF: $(CONF). Use "debug" or "release") +endif + cocoa: $(BIN)/Sameboy.app sdl: $(BIN)/sdl/sameboy $(BIN)/sdl/dmg_boot.bin $(BIN)/sdl/cgb_boot.bin bootroms: $(BIN)/BootROMs/cgb_boot.bin $(BIN)/BootROMs/dmg_boot.bin