Nuklear/demo/sdl_opengl3/Makefile
Alexander W. Schultz b6a7791d13 disables intrinsics on SDL demos
SDL library has an issue where it expects intrinsics headers to be
provided, but intrinsics are not exactly part of a standard, so there is
no guarantee that they will be available. As such, the library allows
you to turn them off. I am disabling them to allow for better
portability and ease of compilation.
2024-10-20 23:17:02 -04:00

26 lines
505 B
Makefile

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