Nuklear/demo/sdl_opengl2/Makefile
Cameron Cawley 60c52adfaf
Enable and fix most GCC warnings (#377)
Co-authored-by: Rob Loach <robloach@gmail.com>
2021-12-16 20:44:00 +01:00

26 lines
456 B
Makefile

# Install
BIN = demo
# Flags
CFLAGS += -std=c89 -Wall -Wextra -pedantic -O2
SRC = main.c
OBJ = $(SRC:.c=.o)
ifeq ($(OS),Windows_NT)
BIN := $(BIN).exe
LIBS = -lmingw32 -lSDL2main -lSDL2 -lopengl32 -lm -lGLU32
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
LIBS = -lSDL2 -framework OpenGL -lm
else
LIBS = -lSDL2 -lGL -lm -lGLU
endif
endif
$(BIN):
@mkdir -p bin
rm -f bin/$(BIN) $(OBJS)
$(CC) $(SRC) $(CFLAGS) -o bin/$(BIN) $(LIBS)