mxe/src/sfml.mk

49 lines
1.7 KiB
Makefile
Raw Normal View History

2013-06-24 15:05:03 +01:00
# This file is part of MXE.
# See index.html for further information.
PKG := sfml
$(PKG)_IGNORE :=
2016-04-13 18:25:52 +01:00
$(PKG)_VERSION := 2.3.2
$(PKG)_CHECKSUM := 03fe79943c48222037f1126a581b12c95a4dd53168881907964695c5ec3dc395
2013-06-24 15:05:03 +01:00
$(PKG)_SUBDIR := SFML-$($(PKG)_VERSION)
$(PKG)_FILE := SFML-$($(PKG)_VERSION)-sources.zip
$(PKG)_URL := http://sfml-dev.org/download/sfml/$($(PKG)_VERSION)/$($(PKG)_FILE)
2015-09-23 08:41:16 +01:00
$(PKG)_DEPS := gcc freetype glew jpeg libsndfile openal
2013-06-24 15:05:03 +01:00
define $(PKG)_UPDATE
$(WGET) -q -O- 'http://www.sfml-dev.org/download.php' | \
2013-10-07 16:31:30 +01:00
$(SED) -n 's,.*download/sfml/\([^"]\+\).*,\1,p' | \
2013-06-24 15:05:03 +01:00
head -1
endef
define $(PKG)_BUILD
mkdir '$(1)/build'
cd '$(1)/build' && cmake .. \
2013-12-26 07:50:53 +00:00
-DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \
-DSFML_BUILD_EXAMPLES=FALSE \
-DSFML_BUILD_DOC=FALSE
2013-06-24 15:05:03 +01:00
# build and install libs
$(MAKE) -C '$(1)/build/src/SFML' -j '$(JOBS)' install VERBOSE=1
# install headers
cmake -DCOMPONENT=devel -P '$(1)/build/cmake_install.cmake'
# create pkg-config file
$(INSTALL) -d '$(PREFIX)/$(TARGET)/lib/pkgconfig'
(echo 'Name: sfml'; \
echo 'Version: 0'; \
echo 'Description: sfml'; \
echo 'Requires: freetype2 glew openal sndfile vorbisenc vorbisfile'; \
echo 'Cflags: -DSFML_STATIC'; \
echo 'Libs: -lsfml-audio-s -lsfml-network-s -lsfml-graphics-s -lsfml-window-s -lsfml-system-s'; \
echo 'Libs.private: -ljpeg -lws2_32 -lgdi32';) \
> '$(PREFIX)/$(TARGET)/lib/pkgconfig/sfml.pc'
2013-06-24 15:05:03 +01:00
'$(TARGET)-g++' \
-W -Wall -Werror -ansi -pedantic \
2013-06-24 15:05:03 +01:00
'$(2).cpp' -o '$(PREFIX)/$(TARGET)/bin/test-sfml.exe' \
`$(TARGET)-pkg-config --cflags --libs sfml`
2013-06-24 15:05:03 +01:00
endef
$(PKG)_BUILD_SHARED =