-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
33 lines (24 loc) · 1.01 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# This only works on osx right now, @TODO get it building for linux (maybe
# windows) and ios.
# Only non git reqirement is sdl2, it must be installed before running this
# makefile.
# `brew install sdl2`
OPENGL_LIB= -framework OpenGL
NANOVG_I= -Inanovg/src
NANOVG_LD= -Lnanovg/build -lnanovg
# -Weverything -pedantic -Werror
CFLAGS= $(NANOVG_I) -std=c11 -g -Wall -O0 -fPIC `pkg-config --cflags sdl2`
LDFLAGS= $(NANOVG_LD) $(OPENGL_LIB) `pkg-config --libs sdl2`
all: libgame.dylib rockets tags
libgame.dylib: rockets.c rockets.h rockets_platform.h rockets_*.h rockets_*.c
clang -dynamiclib -undefined dynamic_lookup $(CFLAGS) -o libgame.dylib rockets.c
rockets: rockets_platform.c rockets_platform.h
clang $(CFLAGS) $(LDFLAGS) -o rockets rockets_platform.c
clean:
rm -r rockets libgame.dylib*
# check-syntax:
# clang -o /dev/null $(CFLAGS) -S ${CHK_SOURCES}
# It would be better if this just built the two things but didn't output them.
check-syntax: all
tags: rockets*.c rockets*.h
etags ./*.c ./*.h nanovg/src/nanovg.h