28 lines
774 B
Makefile
28 lines
774 B
Makefile
CXX ?= g++
|
|
CPPFLAGS = -std=c++14 -Wall -Wextra -pedantic
|
|
LIBRARYFLAGS = -fPIC
|
|
|
|
MAJOR ?= 1
|
|
MINOR ?= 0
|
|
RELEASE ?= 0
|
|
|
|
SDLPPLIBRARY = libsdlpp.so.${MAJOR}.${MINOR}.${RELEASE}
|
|
|
|
OBJECTFILES = sdlpp_circlecolider.o sdlpp_circlerenderer.o sdlpp_collision.o sdlpp_common.o sdlpp_font.o sdlpp_linerenderer.o sdlpp_rectcolider.o sdlpp_rectrenderer.o sdlpp_renderer.o sdlpp_renderobject.o sdlpp_scene.o sdlpp_textrenderer.o sdlpp_texture.o sdlpp_window.o
|
|
|
|
all: ${SDLPPLIBRARY}
|
|
|
|
%.o: %.cpp
|
|
${CXX} ${CPPFLAGS} ${LIBRARYFLAGS} -c $< -o $@
|
|
|
|
${SDLPPLIBRARY}: ${OBJECTFILES}
|
|
${CXX} ${CPPFLAGS} -shared -Wl,-soname,libsdlpp.so.${MAJOR}\
|
|
-o ${SDLPPLIBRARY} $^
|
|
ln -sf ${SDLPPLIBRARY} libsdlpp.so
|
|
ln -sf ${SDLPPLIBRARY} libsdlpp.so.${MAJOR}
|
|
|
|
clean:
|
|
${RM} *.so* *.o
|
|
|
|
.PHONY: all clean test
|