2017-10-01 15:10:57 +03:00
|
|
|
# Install
|
|
|
|
BIN = demo
|
|
|
|
|
|
|
|
# Flags
|
2021-12-16 22:44:00 +03:00
|
|
|
CFLAGS += -std=c89 -Wall -Wextra -pedantic -O2
|
2017-10-01 15:10:57 +03:00
|
|
|
|
|
|
|
SRC = main.c
|
|
|
|
OBJ = $(SRC:.c=.o)
|
|
|
|
|
|
|
|
UNAME_S := $(shell uname -s)
|
|
|
|
ifeq ($(UNAME_S),Darwin)
|
2017-10-08 22:26:33 +03:00
|
|
|
LIBS = -lSDL2 -framework OpenGLES -lm
|
2017-10-01 15:10:57 +03:00
|
|
|
else
|
2017-10-08 22:26:33 +03:00
|
|
|
LIBS = -lSDL2 -lGLESv2 -lm
|
2017-10-01 15:10:57 +03:00
|
|
|
endif
|
|
|
|
|
2017-10-08 22:26:33 +03:00
|
|
|
$(BIN): prepare
|
|
|
|
$(CC) $(SRC) $(CFLAGS) -o bin/$(BIN) $(LIBS)
|
|
|
|
|
|
|
|
web: prepare
|
2018-10-28 14:08:15 +03:00
|
|
|
emcc $(SRC) -Os -s USE_SDL=2 -o bin/index.html
|
|
|
|
|
|
|
|
rpi: prepare
|
|
|
|
$(CC) $(SRC) $(CFLAGS) -o bin/$(BIN) `PKG_CONFIG_PATH=/opt/vc/lib/pkgconfig/ pkg-config --cflags --libs bcm_host brcmglesv2` `/usr/local/bin/sdl2-config --libs --cflags`
|
2017-10-08 22:26:33 +03:00
|
|
|
|
|
|
|
prepare:
|
2017-10-01 15:10:57 +03:00
|
|
|
@mkdir -p bin
|
|
|
|
rm -f bin/$(BIN) $(OBJS)
|