Files
annotate/config/targets/package.targ
alain viari 085a5ff2a7 squared muscle
Former-commit-id: 54638fc7623ec0485109b0b5879144f8f2514213
Former-commit-id: 23f43cd31169d95df12ae1c207d9fd1c924d26b1
2015-11-14 00:11:27 +01:00

61 lines
1.6 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))
$(MAKE) -C $(PKGDIR)
pkg.install:: pkg.make
$(MAKE) -C $(PKGDIR) install
pkg:: pkg.install
@echo "+++++++++++ package $(PKG) done"
test::
(! test -d $(PKGDIR)) || $(MAKE) -C $(PKGDIR) test
clean::
(! test -d $(PKGDIR)) || $(MAKE) -C $(PKGDIR) clean
portclean::
(! test -d $(PKGDIR)) || $(MAKE) -C $(PKGDIR) distclean
(! test -d $(PKGDIR)) || \rm -r $(PKGDIR)