Ready to ship 2.8
[super-star-trek.git] / Makefile
index f04a38d780438af1fc30e9b5aea847a5005f9c68..6fb8a62199f46d8f12d174d588a109e75e9c613e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,20 @@
 # Makefile for the SST2K project
+#
+# SPDX-FileCopyrightText: (C) Eric S. Raymond <esr@thyrsus.com>
+# SPDX-License-Identifier: BSD-2-Clause
 
-VERS=$(shell sed <sst.py -n -e '/version=\(.*\)/s//\1/p')
+VERS=$(shell sed <sst -n -e '/version *= \"*\(.*\)\"/s//\1/p')
 
 MANDIR=/usr/share/man/man1
 BINDIR=/usr/bin
 
 DOCS    = README COPYING NEWS doc/HACKING doc/sst-doc.xml doc/sst-layer.xsl doc/sst.xml
-SOURCES = sst.py Makefile replay doc/makehelp.py control $(DOCS)
+SOURCES = sst Makefile replay doc/makehelp.py control $(DOCS)
 
-all: sst-$(VERS).tar.gz
+all: super-star-trek-$(VERS).tar.gz
 
 install: sst.6
-       cp sst.py $(BINDIR)
+       cp sst $(BINDIR)
        gzip <sst.6 >$(MANDIR)/sst.6.gz
 
 sst.6: doc/sst.xml
@@ -20,21 +23,35 @@ sst.6: doc/sst.xml
 sst.html: doc/sst.xml
        cd doc; xmlto html-nochunks sst.xml; mv sst.html ..
 
-sst-$(VERS).tar.gz: $(SOURCES) sst.6
-       mkdir sst-$(VERS)
-       cp $(SOURCES) sst-$(VERS)
-       tar -czf sst-$(VERS).tar.gz sst-$(VERS)
-       rm -fr sst-$(VERS)
-       ls -l sst-$(VERS).tar.gz
+sst-doc.html: doc/sst-doc.xml
+       xmlto xhtml-nochunks doc/sst-doc.xml
+
+super-star-trek-$(VERS).tar.gz: $(SOURCES) sst.6
+       tar --transform='s:^:super-star-trek-$(VERS)/:' --show-transformed-names -cvzf super-star-trek-$(VERS).tar.gz $(SOURCES) sst.6
 
 dist: sst-$(VERS).tar.gz
 
-pychecker:
-       @-pychecker --quiet --only --limit 50 sst.py
+check: pylint
+       @cd test >/dev/null; $(MAKE) --quiet
+
+reflow:
+       @black sst
+
+pylint:
+       @pylint --score=n sst
 
 clean:
-       rm -f sst.6 sst.html
-       rm -f *.6 MANIFEST index.html SHIPPER.*
+       rm -f sst.6 sst.html sst-doc.html
+       rm -f *.6 MANIFEST index.html
+
+NEWSVERSION=$(shell sed -n <NEWS '/^[0-9]/s/:.*//p' | head -1)
+
+SHIPPER = version=$(VERS) bkgimage=lpt.jpg
+
+release: super-star-trek-$(VERS).tar.gz sst.html sst-doc.html
+       @[ $(VERS) = $(NEWSVERSION) ] || { echo "Version mismatch!"; exit 1; }
+       shipper $(SHIPPER) | sh -e -x
 
-release: sst-$(VERS).tar.gz sst.html
-       shipper -u -m -t; make clean
+refresh: sst.html
+       @[ $(VERS) = $(NEWSVERSION) ] || { echo "Version mismatch!"; exit 1; }
+       shipper -N -w $(SHIPPER)  | sh -e -x