Added debug/release configurations

This commit is contained in:
Lior Halphon 2016-04-01 22:53:29 +03:00
parent 1a66f26a5e
commit abfebf0eb2

View File

@ -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