diff options
| author | Inari Listenmaa <inari.listenmaa@gmail.com> | 2021-07-25 04:15:07 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-25 04:15:07 +0200 |
| commit | b8324fe3e6dd2ebde21f79a25e093753375c5a64 (patch) | |
| tree | 5c93c2088ef0f1aec3eaadf5a3f95dba5e2f0f5b /Makefile | |
| parent | bb51224e8e171e2172c85ca1fe86636fee9cbca3 (diff) | |
| parent | 8814fde817af010e6c17ff8829eceb008dfa5f72 (diff) | |
Merge pull request #116 from anka-213/fix-binary-package-build
Update scripts to use `cabal v1-...` so they work on newer cabal
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 41 |
1 files changed, 29 insertions, 12 deletions
@@ -1,31 +1,48 @@ -.PHONY: all build install doc clean gf html deb pkg bintar sdist +.PHONY: all build install doc clean html deb pkg bintar sdist # This gets the numeric part of the version from the cabal file VERSION=$(shell sed -ne "s/^version: *\([0-9.]*\).*/\1/p" gf.cabal) +# Check if stack is installed +STACK=$(shell if hash stack 2>/dev/null; then echo "1"; else echo "0"; fi) + +# Check if cabal >= 2.4 is installed (with v1- and v2- commands) +CABAL_NEW=$(shell if cabal v1-repl --help >/dev/null 2>&1 ; then echo "1"; else echo "0"; fi) + +ifeq ($(STACK),1) + CMD=stack +else + CMD=cabal + ifeq ($(CABAL_NEW),1) + CMD_PFX=v1- + endif +endif + all: build dist/setup-config: gf.cabal Setup.hs WebSetup.hs - cabal configure +ifneq ($(STACK),1) + cabal ${CMD_PFX}configure +endif build: dist/setup-config - cabal build + ${CMD} ${CMD_PFX}build install: - cabal copy - cabal register +ifeq ($(STACK),1) + stack install +else + cabal ${CMD_PFX}copy + cabal ${CMD_PFX}register +endif doc: - cabal haddock + ${CMD} ${CMD_PFX}haddock clean: - cabal clean + ${CMD} ${CMD_PFX}clean bash bin/clean_html -gf: - cabal build rgl-none - strip dist/build/gf/gf - html:: bash bin/update_html @@ -35,7 +52,7 @@ html:: deb: dpkg-buildpackage -b -uc -# Make an OS X Installer package +# Make a macOS installer package pkg: FMT=pkg bash bin/build-binary-dist.sh |
