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).
9 CFG_OPTS ?
= -DENABLE_SCORE
-DENABLE_PREVIEW
-DENABLE_HIGH_SCORE
11 CPPFLAGS
+= $(CFG_OPTS
)
15 tetris.o
: Makefile tetris.c
18 -@
$(RM
) tetris tetris.o
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
29 -@
$(RM
) $(DESTDIR
)/bin
/tetris
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
)
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
' '; \