blob: 37533bd961538ea36d859daecdaf118a020dcbd2 (
plain) (
blame)
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
44
45
46
47
48
49
50
|
# Copyright (c) 2019-2020, yzrh <yzrh@noema.org>
#
# SPDX-License-Identifier: Apache-2.0
src = main.c collision.c game.c input.c renderer.c
inc = extern.h game.h input.h renderer.h screen.h version.h
.ifdef GPIO
src += gpio.c
inc += gpio.h
.endif
obj = ${src:.c=.o}
PREFIX = /usr/local
CFLAGS = -O3 -march=native -pipe -flto=thin -Wall -Wno-unused-result
LDFLAGS = -Wl,-O3 -lpthread -lSDL2 -lSDL2_ttf
.ifdef SOUND
LDFLAGS += -lSDL2_mixer
.endif
LDFLAGS += -Wl,--as-needed
CFLAGS += -I/usr/local/include
LDFLAGS += -L/usr/local/lib
all: ${obj} ${inc}
${CC} ${LDFLAGS} -o snake ${obj}
clean:
rm -f snake ${obj}
install:
install -d ${PREFIX}/bin
install -d ${PREFIX}/share/snake
install snake ${PREFIX}/bin
install -m644 ../contrib/font.ttf ${PREFIX}/share/snake
install -m644 ../contrib/music.flac ${PREFIX}/share/snake
deinstall:
rm -f ${PREFIX}/bin/snake
rm -rf ${PREFIX}/share/snake
.PHONY: all clean install deinstall
|