Minor refactor to simplify signal handler
[tetris.git] / Makefile
blob966a562c1f80a1696507de880f63b7310489e1ea
1 # Micro Tetris Makefile
2 # Remember to update the VERSION before a new release.
3 # -- " -- to set the DESTDIR env. variable when installing.
5 # Set CC and CFGLAGS in your local environment for a suitable
6 # compiler (tcc?) and CFLAGS (-Os -W -Wall -Werror).
8 VERSION = 1.4.0
9 CFG_OPTS ?= -DENABLE_SCORE -DENABLE_PREVIEW -DENABLE_HIGH_SCORE
10 CC ?= @gcc
11 CPPFLAGS += $(CFG_OPTS)
13 all: tetris
15 tetris.o: Makefile tetris.c
17 clean:
18 -@$(RM) tetris tetris.o
20 distclean: clean
21 -@$(RM) *.o *~
23 install: all
24 @install -D -m 0755 tetris $(DESTDIR)/bin/tetris
25 @touch /tmp/tetris.scores
26 @install -D -m 0664 /tmp/tetris.scores $(DESTDIR)/var/games/tetris.scores
28 uninstall:
29 -@$(RM) $(DESTDIR)/bin/tetris
31 dist:
32 @git archive --format=tar --prefix=tetris-$(VERSION)/ $(VERSION) | gzip >../tetris-$(VERSION).tar.gz
33 @(cd .. && md5sum tetris-$(VERSION).tar.gz > tetris-$(VERSION).tar.gz.md5)
34 @(cd .. && sha256sum tetris-$(VERSION).tar.gz > tetris-$(VERSION).tar.gz.sha256)
36 release: dist
37 @echo "Resulting release files in parent dir:"
38 @echo "=================================================================================================="
39 @for file in tetris-$(VERSION).tar.gz; do \
40 printf "%-33s Distribution tarball\n" $$file; \
41 printf "%-33s " $$file.md5; cat ../$$file.md5 | cut -f1 -d' '; \
42 printf "%-33s " $$file.sha256; cat ../$$file.sha256 | cut -f1 -d' '; \
43 done