mxe/src/mxml.mk

40 lines
1.5 KiB
Makefile
Raw Permalink Normal View History

# This file is part of MXE. See LICENSE.md for licensing information.
2010-11-26 22:11:23 +00:00
PKG := mxml
2017-03-28 22:38:45 +01:00
$(PKG)_WEBSITE := https://michaelrsweet.github.io/mxml/
$(PKG)_DESCR := Mini-XML
2010-11-26 22:11:23 +00:00
$(PKG)_IGNORE :=
$(PKG)_VERSION := 3.1
$(PKG)_CHECKSUM := 0a50cbb42ad078e51589208997858c8d86ea95f255d61e4af5b3d635d2659603
$(PKG)_GH_CONF := michaelrsweet/mxml/tags, v
$(PKG)_DEPS := cc pthreads
2010-11-26 22:11:23 +00:00
define $(PKG)_BUILD
# doesn't support out-of-source builds
# https://github.com/michaelrsweet/mxml/issues/135
cd '$(SOURCE_DIR)' && $(SOURCE_DIR)/configure \
$(MXE_CONFIGURE_OPTS) \
2010-11-26 22:11:23 +00:00
--disable-shared \
--enable-static \
2010-11-26 23:16:17 +00:00
--enable-threads
$(MAKE) -C '$(SOURCE_DIR)' -j '$(JOBS)' libmxml.a
2010-11-26 23:07:42 +00:00
$(INSTALL) -d '$(PREFIX)/$(TARGET)/include'
$(INSTALL) -m644 '$(1)/mxml.h' '$(PREFIX)/$(TARGET)/include/'
$(INSTALL) -d '$(PREFIX)/$(TARGET)/lib/pkgconfig'
$(INSTALL) -m644 '$(1)/mxml.pc' '$(PREFIX)/$(TARGET)/lib/pkgconfig/'
2010-11-26 23:33:03 +00:00
# shared libs are easier to do ourselves in the case where all
# functions are exported.
# https://github.com/michaelrsweet/mxml/issues/188
# https://github.com/michaelrsweet/mxml/issues/192
$(if $(BUILD_STATIC),\
$(MAKE) -C '$(SOURCE_DIR)' -j 1 install-libmxml.a \
$(else), \
$(MAKE_SHARED_FROM_STATIC) '$(SOURCE_DIR)/libmxml.a' -lpthread)
2010-11-26 23:33:03 +00:00
'$(TARGET)-gcc' \
-W -Wall -Werror -ansi -pedantic \
'$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-mxml.exe' \
2010-11-26 23:33:03 +00:00
`'$(TARGET)-pkg-config' mxml --cflags --libs`
2010-11-26 22:11:23 +00:00
endef