Skip to content

Commit a4f43f8

Browse files
committed
Fix sdist rules after cabal moved the sdist
1 parent a678c43 commit a4f43f8

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

Makefile

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ ALEX = alex
77
ALEX_OPTS = -g
88
ALEX_VER = `awk '/^version:/ { print $$2 }' alex.cabal`
99

10+
SDIST_DIR=dist-newstyle/sdist
11+
1012
sdist ::
1113
@case "`$(CABAL) --numeric-version`" in \
1214
2.[2-9].* | [3-9].* ) ;; \
@@ -22,26 +24,26 @@ sdist ::
2224
mv src/Parser.y src/Parser.y.boot
2325
mv src/Scan.x src/Scan.x.boot
2426
$(CABAL) new-run gen-alex-sdist
25-
$(CABAL) sdist
26-
@if [ ! -f "dist/alex-$(ALEX_VER).tar.gz" ]; then \
27+
$(CABAL) new-sdist
28+
@if [ ! -f "${SDIST_DIR}/alex-$(ALEX_VER).tar.gz" ]; then \
2729
echo "Error: source tarball not found: dist/alex-$(ALEX_VER).tar.gz"; \
2830
exit 1; \
2931
fi
3032
git checkout .
3133
git clean -f
3234

3335
sdist-test :: sdist sdist-test-only
34-
@rm -rf "dist/alex-$(ALEX_VER)/"
36+
@rm -rf "${SDIST_DIR}/alex-${ALEX_VER}/"
3537

3638
sdist-test-only ::
37-
@if [ ! -f "dist/alex-$(ALEX_VER).tar.gz" ]; then \
38-
echo "Error: source tarball not found: dist/alex-$(ALEX_VER).tar.gz"; \
39+
@if [ ! -f "${SDIST_DIR}/alex-$(ALEX_VER).tar.gz" ]; then \
40+
echo "Error: source tarball not found: ${SDIST_DIR}/alex-$(ALEX_VER).tar.gz"; \
3941
exit 1; \
4042
fi
41-
rm -rf "dist/alex-$(ALEX_VER)/"
42-
tar -xf "dist/alex-$(ALEX_VER).tar.gz" -C dist/
43-
echo "packages: ." > "dist/alex-$(ALEX_VER)/cabal.project"
44-
cd "dist/alex-$(ALEX_VER)/" && cabal new-test --enable-tests all
43+
rm -rf "${SDIST_DIR}/alex-$(ALEX_VER)/"
44+
tar -xf "${SDIST_DIR}/alex-$(ALEX_VER).tar.gz" -C ${SDIST_DIR}/
45+
echo "packages: ." > "${SDIST_DIR}/alex-$(ALEX_VER)/cabal.project"
46+
cd "${SDIST_DIR}/alex-$(ALEX_VER)/" && cabal new-test --enable-tests all
4547
@echo ""
46-
@echo "Success! dist/alex-$(ALEX_VER).tar.gz is ready for distribution!"
48+
@echo "Success! ${SDIST_DIR}/alex-$(ALEX_VER).tar.gz is ready for distribution!"
4749
@echo ""

0 commit comments

Comments
 (0)