stages:
  - build

build_project:
  stage: build
  script:
    - git submodule sync # In case .gitmodules changed and we're in 'fetch' mode
    - git submodule update --init --recursive
    - make -k
  tags:
    - make
    - c
    - sh
    - freebsd

## How-to install on FreeBSD (sshd highly recommended):
# pkg install wget security/ca_root_nss gcc git
# wget -O /usr/local/bin/gitlab-ci-multi-runner https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-ci-multi-runner-freebsd-amd64
## wget -O /usr/local/bin/gitlab-ci-multi-runner https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-ci-multi-runner-freebsd-386
# chmod +x /usr/local/bin/gitlab-ci-multi-runner
# /usr/local/bin/gitlab-ci-multi-runner register # Needs the token from the website
# /usr/local/bin/gitlab-ci-multi-runner --debug --log-level debug run > & runner.log &

stages:
  - build

build_project:
  stage: build
  script:
    - git submodule sync # In case .gitmodules changed and we're in 'fetch' mode
    - git submodule update --init --recursive
# WORKAROUND 1:
# The problem:
# https://lists.freebsd.org/pipermail/freebsd-hackers/2004-October/008809.html
# The solution:
# https://lists.freebsd.org/pipermail/freebsd-hackers/2004-October/008816.html
# WORKAROUND 2:
# 'make -k' not only keeps going, it also silently ignores any errors of
# subtargets.  If you want more verbose error messages on FreeBSD, go fix their
# broken 'make' first.
    - env MAKEOBJDIR="83dfd219-a074-4361-9442-b38485644ad1" make
  tags:
    - make
    - c
    - sh
    - freebsd

## How-to install on FreeBSD (sshd highly recommended):
# pkg install wget security/ca_root_nss gcc git
# wget -O /usr/local/bin/gitlab-ci-multi-runner https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-ci-multi-runner-freebsd-amd64
## wget -O /usr/local/bin/gitlab-ci-multi-runner https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-ci-multi-runner-freebsd-386
# chmod +x /usr/local/bin/gitlab-ci-multi-runner
# /usr/local/bin/gitlab-ci-multi-runner register # Needs the token from the website
# /usr/local/bin/gitlab-ci-multi-runner --debug --log-level debug run > & runner.log &

Work around BSD make bugs
Work around BSD make bugs
