2026-06-23 19:34:36 -05:00
|
|
|
# Makefile for card-games -- byte-compile, test, and package.
|
|
|
|
|
EMACS ?= emacs
|
|
|
|
|
PKG = card-games
|
Add 16 games and known-games research; bump to 1.0.60
Console UNICODE games on the cg-core EIEIO engine, all ERT-tested (88/88):
- Tableau solitaire (cg-solitaire.el): Klondike, FreeCell, Spider, Yukon,
Canfield, Forty Thieves, Scorpion.
- Pile solitaire (cg-patience.el): Golf, TriPeaks, Pyramid.
- Trick-taking (cg-trick.el): Hearts, Spades, Whist, Oh Hell.
- Shedding/climbing: Crazy Eights (cg-eights.el), President (cg-president.el).
Wire all into the card-game chooser, Makefile, and README; add
known-games.org research collation; bump every file to 1.0.60.
2026-06-25 01:58:24 -05:00
|
|
|
VERSION = 1.0.60
|
2026-06-23 19:34:36 -05:00
|
|
|
# Source files in dependency order (cg-core first).
|
Add Contract Bridge: auction, dummy play, and rubber scoring
New cg-bridge.el: a four-handed Bridge game (you are South, partnering
North against East and West) on the shared cg-game base.
* Auction: level/strain bids plus pass, double, and redouble, with the
three-pass end rule, pass-outs, doubling state, and declarer
determination (first of the side to name the strain).
* Play: follow-suit with the dummy exposed after the opening lead; the
declarer plays both hands. Trick resolution honours trump and no-trump.
* Scoring: classic rubber -- trick points below the line toward game;
overtricks, slam, insult, and undertrick penalties above; vulnerability
and the rubber bonus. Verified against known results.
* A small natural bidding AI (openings, NT, raises with a fit, simple
overcalls) that always terminates the auction, plus a greedy
card-play AI.
Wire cg-bridge into the chooser, the Makefile, and the README, and add
two ERT tests (scoring math and a dozen full AI-driven deals). The suite
is now 109/109 and every file byte-compiles cleanly.
2026-06-25 06:53:51 -05:00
|
|
|
EL = cg-core.el cg-svg.el cg-render.el cg-net.el cg-bid.el cg-gaps.el cg-bid-ui.el cg-bid-net.el cg-solitaire.el cg-trick.el cg-eights.el cg-patience.el cg-president.el cg-rummy.el cg-rum500.el cg-handfoot.el cg-match.el cg-cribbage.el cg-scopa.el cg-trick-ext.el cg-spite.el cg-bridge.el card-games.el
|
2026-06-23 19:34:36 -05:00
|
|
|
ELC = $(EL:.el=.elc)
|
|
|
|
|
PKGDESC = $(PKG)-pkg.el
|
|
|
|
|
TARDIR = $(PKG)-$(VERSION)
|
|
|
|
|
TAR = $(TARDIR).tar
|
|
|
|
|
SRCTAR = $(PKG)-$(VERSION)-src.tar.gz
|
|
|
|
|
DIST = dist
|
|
|
|
|
BATCH = $(EMACS) -Q --batch -L .
|
|
|
|
|
EXTRA = README.org $(PKGDESC)
|
|
|
|
|
|
|
|
|
|
.PHONY: all compile test clean distclean checkdoc lint package tarball elpa release help
|
|
|
|
|
|
|
|
|
|
help:
|
|
|
|
|
@echo "card-games $(VERSION) -- make targets:"
|
|
|
|
|
@echo " compile byte-compile all sources"
|
|
|
|
|
@echo " test run the ERT test suite"
|
|
|
|
|
@echo " checkdoc run checkdoc on all sources"
|
|
|
|
|
@echo " lint run package-lint (if installed)"
|
|
|
|
|
@echo " package build the installable package tarball ($(TAR))"
|
|
|
|
|
@echo " elpa build a one-package ELPA archive in $(DIST)/"
|
|
|
|
|
@echo " release clean + test + package + source tarball"
|
|
|
|
|
@echo " clean remove .elc and build artifacts"
|
|
|
|
|
|
|
|
|
|
all: compile
|
|
|
|
|
|
|
|
|
|
# Compile in order so each file sees its compiled dependencies.
|
|
|
|
|
compile:
|
|
|
|
|
$(BATCH) -f batch-byte-compile $(EL)
|
|
|
|
|
|
|
|
|
|
test:
|
|
|
|
|
$(BATCH) -L test -l test/$(PKG)-tests.el -f ert-run-tests-batch-and-exit
|
|
|
|
|
|
|
|
|
|
checkdoc:
|
|
|
|
|
$(BATCH) --eval "(progn (dolist (f '($(EL))) (checkdoc-file f)))"
|
|
|
|
|
|
|
|
|
|
lint:
|
|
|
|
|
-$(BATCH) --eval "(progn (require 'package) (package-initialize) \
|
|
|
|
|
(unless (require 'package-lint nil t) (error \"package-lint not installed\")) \
|
|
|
|
|
(setq package-lint-main-file \"$(PKG).el\") \
|
|
|
|
|
(dolist (f '($(EL))) (with-temp-buffer (insert-file-contents f) \
|
|
|
|
|
(emacs-lisp-mode) (package-lint-buffer))))"
|
|
|
|
|
|
|
|
|
|
# Installable multi-file package: card-games-VERSION.tar with a top
|
|
|
|
|
# directory of the same name (package.el / package-install-file format).
|
|
|
|
|
package: tarball
|
|
|
|
|
# Uses GNU tar's --transform to add the top directory without a temp copy.
|
|
|
|
|
tarball: $(EL) $(EXTRA)
|
|
|
|
|
tar --transform 's,^,$(TARDIR)/,' -cf $(TAR) $(EL) $(EXTRA)
|
|
|
|
|
@echo "Built $(TAR)"
|
|
|
|
|
|
|
|
|
|
# A minimal ELPA archive (archive-contents + tar) under dist/.
|
|
|
|
|
# Testers can: (add-to-list 'package-archives '("cg" . "/path/to/dist/"))
|
|
|
|
|
elpa: tarball
|
|
|
|
|
rm -rf $(DIST)
|
|
|
|
|
mkdir -p $(DIST)
|
|
|
|
|
$(BATCH) --eval "(progn (require 'package-x) \
|
|
|
|
|
(let ((package-archive-upload-base (expand-file-name \"$(DIST)\"))) \
|
|
|
|
|
(package-upload-file \"$(TAR)\")))"
|
|
|
|
|
@echo "ELPA archive in $(DIST)/"
|
|
|
|
|
|
|
|
|
|
# Source snapshot for a GitHub release. Archive an explicit file list
|
|
|
|
|
# (not ".") so the growing output tarball and editor lock files are never
|
|
|
|
|
# read mid-write -- which is what caused "tar: .: file changed as we read it".
|
|
|
|
|
SRCFILES = $(EL) $(EXTRA) Makefile .gitignore test
|
|
|
|
|
release: distclean test tarball
|
|
|
|
|
rm -f $(SRCTAR)
|
|
|
|
|
tar --transform 's,^,$(TARDIR)/,' \
|
|
|
|
|
--exclude='*.elc' --exclude='*.tar' --exclude='*.tar.gz' \
|
|
|
|
|
--exclude='.#*' --exclude='$(DIST)' --exclude='.git' \
|
|
|
|
|
-czf $(SRCTAR) $(SRCFILES)
|
|
|
|
|
@echo "Built $(SRCTAR) and $(TAR) for release $(VERSION)"
|
|
|
|
|
|
|
|
|
|
clean:
|
|
|
|
|
rm -f $(ELC)
|
|
|
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
|
rm -rf $(DIST) $(TARDIR) $(TAR) $(SRCTAR)
|