mxe/src/freeimage.mk

47 lines
1.6 KiB
Makefile
Raw Normal View History

2012-03-28 14:46:58 +01:00
# This file is part of MXE.
2012-03-29 11:14:15 +01:00
# See index.html for further information.
2010-02-16 11:22:34 +00:00
PKG := freeimage
$(PKG)_IGNORE :=
$(PKG)_VERSION := 3.15.4
2012-10-27 22:06:34 +01:00
$(PKG)_CHECKSUM := 1d30057a127b2016cf9b4f0f8f2ba92547670f96
2010-02-16 11:22:34 +00:00
$(PKG)_SUBDIR := FreeImage
$(PKG)_FILE := FreeImage$(subst .,,$($(PKG)_VERSION)).zip
$(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/freeimage/Source Distribution/$($(PKG)_VERSION)/$($(PKG)_FILE)
2010-02-16 11:22:34 +00:00
$(PKG)_DEPS := gcc
define $(PKG)_UPDATE
$(WGET) -q -O- 'http://sourceforge.net/projects/freeimage/files/Source Distribution/' | \
$(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \
head -1
2010-02-16 11:22:34 +00:00
endef
define $(PKG)_BUILD
$(MAKE) -C '$(1)' -j '$(JOBS)' -f Makefile.mingw \
2010-02-16 11:22:34 +00:00
CXX='$(TARGET)-g++' \
CC='$(TARGET)-gcc' \
AR='$(TARGET)-ar' \
RC='$(TARGET)-windres' \
FREEIMAGE_LIBRARY_TYPE=STATIC \
TARGET=freeimage
2010-02-16 11:22:34 +00:00
$(INSTALL) -d '$(PREFIX)/$(TARGET)/lib'
$(INSTALL) -m644 '$(1)/libfreeimage.a' '$(PREFIX)/$(TARGET)/lib/'
$(INSTALL) -d '$(PREFIX)/$(TARGET)/include'
$(INSTALL) -m644 '$(1)/Source/FreeImage.h' '$(PREFIX)/$(TARGET)/include/'
# create pkg-config file
$(INSTALL) -d '$(PREFIX)/$(TARGET)/lib/pkgconfig'
(echo 'Name: freeimage'; \
echo 'Version: $(freeimage_VERSION)'; \
echo 'Description: FreeImage'; \
echo 'Cflags: -DFREEIMAGE_LIB'; \
echo 'Libs: -lfreeimage -lws2_32';) \
> '$(PREFIX)/$(TARGET)/lib/pkgconfig/freeimage.pc'
'$(TARGET)-gcc' \
-W -Wall -Werror -ansi -pedantic \
'$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-freeimage.exe' \
`'$(TARGET)-pkg-config' freeimage --cflags --libs`
2010-02-16 11:22:34 +00:00
endef