29 lines
557 B
Makefile
29 lines
557 B
Makefile
FILE := app
|
|
TARGET := $(FILE)
|
|
REPOS := glcxx glm
|
|
|
|
CCFLAGS := $(shell sdl2-config --cflags)
|
|
ifeq (MINGW,$(findstring MINGW,$(shell uname)))
|
|
LIBS := -lopengl32 -lglu32 -lmingw32
|
|
CXX := mingw32-g++
|
|
TARGET := $(TARGET).exe
|
|
else
|
|
LIBS := -lGL -lGLU `sdl2-config --libs`
|
|
endif
|
|
LDFLAGS := $(LIBS) $(shell sdl2-config --libs)
|
|
|
|
|
|
all: submodule_init $(TARGET)
|
|
|
|
$(TARGET): $(FILE).cc
|
|
$(CXX) -o $(TARGET) $(CCFLAGS) $< $(LDFLAGS)
|
|
|
|
.PHONY: submodule_init
|
|
submodule_init:
|
|
@if [ ! -e glcxx ]; then \
|
|
git submodule update --init; \
|
|
fi
|
|
|
|
clean:
|
|
-rm -f $(TARGET) *~ *.o
|