diff options
author | Chad Versace <chad.versace@linux.intel.com> | 2013-10-05 14:18:14 -0700 |
---|---|---|
committer | Chad Versace <chad.versace@linux.intel.com> | 2013-10-05 14:24:33 -0700 |
commit | 6bc6ef0e37cd64e0c19b697ae2e92fb2a875ea64 (patch) | |
tree | b70ac9b3b76d158696cd080b12b13d8b7fa05339 | |
parent | b2c8cae995c74d5facebed24181d8f41b2ec7f9a (diff) |
examples: Fix example Makefile for Mac OS
On Mac OS, we need to compile the sources as Objective-C, link to
some Mac OS frameworks, and not build the Linux-specific example
'simple-x11-egl'.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
-rw-r--r-- | examples/Makefile.example | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/examples/Makefile.example b/examples/Makefile.example index 183c62a..92e6a62 100644 --- a/examples/Makefile.example +++ b/examples/Makefile.example @@ -1,4 +1,15 @@ EXES := gl_basic simple-x11-egl +CFLAGS += -std=c99 $(shell pkg-config --cflags waffle-1) +LDFLAGS += $(shell pkg-config --libs waffle-1) + +ifeq ($(shell uname),Darwin) + EXES := $(filter-out simple-x11-egl,$(EXES)) + CFLAGS += -ObjC + LDFLAGS += \ + -framework Cocoa \ + -framework CoreFoundation \ + -framework OpenGL +endif .PHONY: all all: $(EXES) @@ -8,7 +19,7 @@ clean: -rm $(EXES) gl_basic: gl_basic.c - $(CC) -std=c99 $(shell pkg-config --cflags --libs waffle-1) -o gl_basic gl_basic.c + $(CC) $(CFLAGS) $(LDFLAGS) -o gl_basic gl_basic.c simple-x11-egl: simple-x11-egl.c - $(CC) -std=c99 $(shell pkg-config --cflags --libs waffle-1) -o simple-x11-egl simple-x11-egl.c + $(CC) $(CFLAGS) $(LDFLAGS) -o simple-x11-egl simple-x11-egl.c |