Nuklear/demo/sdl_opengles2/Makefile
2017-10-08 21:26:33 +02:00

26 lines
405 B
Makefile

# Install
BIN = demo
# Flags
CFLAGS = -std=c99 -pedantic -O2
SRC = main.c
OBJ = $(SRC:.c=.o)
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
LIBS = -lSDL2 -framework OpenGLES -lm
else
LIBS = -lSDL2 -lGLESv2 -lm
endif
$(BIN): prepare
$(CC) $(SRC) $(CFLAGS) -o bin/$(BIN) $(LIBS)
web: prepare
emcc $(SRC) -Os -s USE_SDL=2 -o bin/index.html
prepare:
@mkdir -p bin
rm -f bin/$(BIN) $(OBJS)