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