2018-01-22 17:00:39 +03:00
|
|
|
# Install
|
|
|
|
BIN = demo
|
|
|
|
|
|
|
|
# Flags
|
2019-02-27 17:02:44 +03:00
|
|
|
CFLAGS += -std=c89 -pedantic -O2
|
2018-01-22 17:00:39 +03:00
|
|
|
|
|
|
|
SRC = main.c
|
|
|
|
OBJ = $(SRC:.c=.o)
|
|
|
|
|
|
|
|
ifeq ($(OS),Windows_NT)
|
|
|
|
BIN := $(BIN).exe
|
|
|
|
LIBS = -lglfw3 -lopengl32 -lm -lGLU32 -lGLEW32
|
|
|
|
else
|
|
|
|
UNAME_S := $(shell uname -s)
|
|
|
|
GLFW3 := $(shell pkg-config --libs glfw3)
|
|
|
|
ifeq ($(UNAME_S),Darwin)
|
|
|
|
LIBS := $(GLFW3) -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo -lm -lGLEW -L/usr/local/lib
|
|
|
|
else
|
|
|
|
LIBS = $(GLFW3) -lGL -lm -lGLU -lGLEW
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(BIN):
|
|
|
|
@mkdir -p bin
|
|
|
|
rm -f bin/$(BIN) $(OBJS)
|
|
|
|
$(CC) $(SRC) $(CFLAGS) -o bin/$(BIN) $(LIBS)
|