Files
annotate/config/targets/package.targ
Eric Coissac f39e66d4c1 integrate options in the main script
Former-commit-id: e046ef88288559ed68463d3e9fd334ff0a8d1ec6
Former-commit-id: a2f99a532f7ce1b3114385c49affc197419a04d9
2015-12-18 22:05:51 +01:00

69 lines
1.9 KiB
Plaintext

#
# $Id: package.targ 1825 2013-02-26 09:39:47Z viari $
#
# package.targ
#
# default make targets for standard package with configure
#
# you should define the 'PKG' variable
# (and optionaly 'PKGTAR', 'PKGDIR')
#
PKGTAR ?= $(PKG).tgz
PKGDIR ?= build.$(PORTNAME)
PRTPATH = $(abspath $(PRTDIR))
PRTPATH_BIN = $(PRTPATH)/bin
PKG_CONFIG = $(PRTPATH)/bin/pkg-config
#
# Rules
#
.PHONY: all clean test portclean pkg pkg.expand pkg.make pkg.install
all:: pkg
pkg.expand::
test -d $(PKGDIR) || mkdir $(PKGDIR)
test -f $(PKGDIR)/configure || $(TAR) zxf $(PKGTAR) -C $(PKGDIR) --strip-components 1
pkg.make:: pkg.expand
test -f $(PKGDIR)/Makefile || (export PATH="$(PRTPATH_BIN):$$PATH" && \
export PKG_CONFIG=$(PKG_CONFIG) && \
export CC="$(CC)" && \
export CXX="$(CXX)" && \
export CPP="$(CPP)" && \
export CXXPP="$(CXXPP)" && \
export CFLAGS="$(CFLAGS)" && \
export LDFLAGS="$(LDFLAGS)" && \
cd $(PKGDIR) && \
./configure --prefix=$(PRTPATH) $(CONFIGURE_OPTIONS))
(export PATH="$(PRTPATH_BIN):$$PATH" && \
export PKG_CONFIG=$(PKG_CONFIG) && \
export CC="$(CC)" && \
export CXX="$(CXX)" && \
export CPP="$(CPP)" && \
export CXXPP="$(CXXPP)" && \
export CFLAGS="$(CFLAGS)" && \
export LDFLAGS="$(LDFLAGS)" && \
$(MAKE) $(MAKEOPTIONS) -C $(PKGDIR))
pkg.install:: pkg.make
$(MAKE) $(MAKEOPTIONS) -C $(PKGDIR) install
pkg:: pkg.install
@echo "+++++++++++ package $(PKG) done"
test::
(! test -d $(PKGDIR)) || $(MAKE) $(MAKEOPTIONS) -C $(PKGDIR) test
clean::
(! test -d $(PKGDIR)) || $(MAKE) $(MAKEOPTIONS) -C $(PKGDIR) clean
portclean::
(! test -d $(PKGDIR)) || $(MAKE) $(MAKEOPTIONS) -C $(PKGDIR) distclean
(! test -d $(PKGDIR)) || \rm -r $(PKGDIR)