2016-04-29 15:07:08 +03:00
|
|
|
# Install
|
|
|
|
BIN = demo
|
|
|
|
|
|
|
|
# Flags
|
2017-12-31 19:12:41 +03:00
|
|
|
CFLAGS += -std=c99 -pedantic -O2
|
2016-04-29 15:07:08 +03:00
|
|
|
|
|
|
|
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)
|