Debian Codegraph @

Makefile

raw
1 CABAL = cabal
2
3 HAPPY_VER = `awk '/^version:/ { print $$2 }' happy.cabal`
4
5 SDIST_DIR=dist-newstyle/sdist
6
7 sdist ::
8 @case "`$(CABAL) --numeric-version`" in \
9 2.[2-9].* | [3-9].* ) ;; \
10 * ) echo "Error: needs cabal 2.2.0.0 or later (but got : `$(CABAL) --numeric-version`)" ; exit 1 ;; \
11 esac
12 @if [ "`git status -s`" != '' ]; then \
13 echo "Error: Tree is not clean"; \
14 exit 1; \
15 fi
16 $(CABAL) v2-sdist all
17 @if [ ! -f "${SDIST_DIR}/happy-$(HAPPY_VER).tar.gz" ]; then \
18 echo "Error: source tarball not found: dist/happy-$(HAPPY_VER).tar.gz"; \
19 exit 1; \
20 fi
21 git checkout .
22 git clean -f
23
24 sdist-test :: sdist sdist-test-only
25 @rm -rf "${SDIST_DIR}/happy-${HAPPY_VER}/"
26
27 sdist-test-only ::
28 @if [ ! -f "${SDIST_DIR}/happy-$(HAPPY_VER).tar.gz" ]; then \
29 echo "Error: source tarball not found: ${SDIST_DIR}/happy-$(HAPPY_VER).tar.gz"; \
30 exit 1; \
31 fi
32 rm -rf "${SDIST_DIR}/happy-$(HAPPY_VER)/"
33 tar -xf "${SDIST_DIR}/happy-$(HAPPY_VER).tar.gz" -C ${SDIST_DIR}/
34 echo "packages: ." > "${SDIST_DIR}/happy-$(HAPPY_VER)/cabal.project"
35 echo "tests: True" >> "${SDIST_DIR}/happy-$(HAPPY_VER)/cabal.project"
36 cd "${SDIST_DIR}/happy-$(HAPPY_VER)/" \
37 && cabal v2-build all \
38 && cabal v2-test all -j
39 @echo ""
40 @echo "Success! ${SDIST_DIR}/happy-$(HAPPY_VER).tar.gz is ready for distribution!"
41 @echo ""