# Maintainer: Alexey Pavlov <alexpux@gmail.com>
# Contributor: Ray Donnelly <mingw.android@gmail.com>

pkgname=make
pkgver=4.4.1
pkgrel=2
pkgdesc="GNU make utility to maintain groups of programs"
arch=('i686' 'x86_64')
url="https://www.gnu.org/software/make"
msys2_references=(
  "cpe: cpe:/a:gnu:make"
)
license=('GPL3')
depends=('libintl' 'sh')
makedepends=('gettext' 'procps-ng' 'autotools' 'gcc' 'gettext-devel')
options=() # 'debug' '!strip')
source=("https://ftp.gnu.org/gnu/make/${pkgname}-${pkgver}.tar.gz"{,.sig})
sha256sums=('dd16fb1d67bfab79a72f5e8390735c49e3e8e70b4945a15ab1f81ddb78658fb3'
            'SKIP')
validpgpkeys=('6D4EEB02AD834703510B117680CB727A20C79BB2')  # Paul D. Smith <psmith@gnu.org>


prepare() {
  cd ${srcdir}/${pkgname}-${pkgver}
  #autoreconf -fi
}

build() {
  cd ${srcdir}/${pkgname}-${pkgver}

  # Disable posix_spawn because it is slower.
  # openssl with "make clean; time make -j32": 1m35s vs 1m53s
  ./configure \
    --build=${CHOST} \
    --prefix=/usr \
    --without-libintl-prefix \
    --without-libiconv-prefix \
    --without-guile \
    --disable-posix-spawn \
    ac_cv_dos_paths=yes

  make -j1 all
}

check() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make check
}

package() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make DESTDIR=${pkgdir} install
}
