diff Makefile @ 1537:b4914d92308b nuklear_ui

Added OSX implementation of default_font
author Michael Pavone <pavone@retrodev.com>
date Sun, 25 Mar 2018 10:30:40 -0700
parents c59adc305e46
children bed941c9bc86
line wrap: on
line diff
--- a/Makefile	Sun Mar 25 10:29:40 2018 -0700
+++ b/Makefile	Sun Mar 25 10:30:40 2018 -0700
@@ -27,13 +27,14 @@
 
 MEM:=mem.o
 TERMINAL:=terminal.o
-FONT:=nuklear_ui/font.o
 EXE:=
 
 ifeq ($(OS),Darwin)
 LIBS=sdl2 glew
+FONT:=nuklear_ui/font_mac.o
 else
 LIBS=sdl2 glew gl
+FONT:=nuklear_ui/font.o
 endif #Darwin
 
 HAS_PROC:=$(shell if [ -d /proc ]; then /bin/echo -e -DHAS_PROC; fi)
@@ -48,7 +49,7 @@
 
 ifeq ($(OS),Darwin)
 CFLAGS+= -IFrameworks/SDL2.framework/Headers
-LDFLAGS+= -FFrameworks -framework SDL2 -framework OpenGL
+LDFLAGS+= -FFrameworks -framework SDL2 -framework OpenGL -framework AppKit
 FIXUP:=install_name_tool -change @rpath/SDL2.framework/Versions/A/SDL2 @executable_path/Frameworks/SDL2.framework/Versions/A/SDL2
 else
 CFLAGS+= -Isdl/include
@@ -60,14 +61,18 @@
 LDFLAGS:=-lm $(shell pkg-config --libs $(LIBS))
 
 ifeq ($(OS),Darwin)
-LDFLAGS+= -framework OpenGL
+LDFLAGS+= -framework OpenGL -framework AppKit
 endif
 
 endif #PORTABLE
 endif #Windows
 
 ifdef DEBUG
+ifeq ($(OS),Darwin)
+OPT:=-g3 -O0
+else
 OPT:=-g3 -Og
+endif #Darwin
 else
 ifdef NOLTO
 OPT:=-O2
@@ -249,6 +254,10 @@
 
 %.o : %.c
 	$(CC) $(CFLAGS) -c -o $@ $<
+  
+%.o : %.m
+	$(CC) $(CFLAGS) -c -o $@ $<
+
 %.png : %.xcf
 	xcf2png $< > $@