summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorkrangelov <kr.angelov@gmail.com>2021-07-26 16:52:11 +0200
committerkrangelov <kr.angelov@gmail.com>2021-07-26 16:52:11 +0200
commite47042424ee2450c69c509601ddc3c1cc8cd9a39 (patch)
tree5cfad2acca46f8c9aafa3a5f97600ae26bbe0e1c /Makefile
parentecf309a28e9935923308da4b6aa2b1cc6c4b52e2 (diff)
parentd0a881f9038d2ca1620e0d95f90c297a452774d5 (diff)
Merge branch 'master' of https://github.com/GrammaticalFramework/gf-core
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile41
1 files changed, 29 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 93a8dc20b..cdb35e49a 100644
--- a/Makefile
+++ b/Makefile
@@ -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