# # $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)