You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mxe/src/freeimage.mk

37 lines
1.2 KiB

# This file is part of MXE.
# See index.html for further information.
PKG := freeimage
$(PKG)_IGNORE :=
$(PKG)_CHECKSUM := 1d30057a127b2016cf9b4f0f8f2ba92547670f96
$(PKG)_SUBDIR := FreeImage
$(PKG)_FILE := FreeImage$(subst .,,$($(PKG)_VERSION)).zip
$(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/freeimage/Source Distribution/$($(PKG)_VERSION)/$($(PKG)_FILE)
$(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
endef
define $(PKG)_BUILD
$(MAKE) -C '$(1)' -j '$(JOBS)' -f Makefile.mingw \
CXX='$(TARGET)-g++' \
CC='$(TARGET)-gcc' \
AR='$(TARGET)-ar' \
RC='$(TARGET)-windres' \
FREEIMAGE_LIBRARY_TYPE=STATIC \
TARGET=freeimage
$(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/'
'$(TARGET)-gcc' \
-W -Wall -Werror -ansi -pedantic \
'$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \
-lfreeimage -DFREEIMAGE_LIB
endef