-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
52 lines (43 loc) · 1.15 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
44
45
46
47
48
49
50
51
52
all: rein
VERSION := $(shell date +%y%m%d)
CFLAGS=$(shell pkg-config --cflags sdl2 --cflags luajit) -Wall -O3 -DVERSION=\"${VERSION}\"
LDFLAGS=$(shell pkg-config --libs sdl2 --libs luajit) -lm
# uncomment for system-wide install
# PREFIX=/usr/local
ifneq ($(PREFIX),)
DATADIR=-DDATADIR=\"$(PREFIX)/share/rein\"
install: rein
install -d -m 0755 $(DESTDIR)$(PREFIX)/bin
install -d -m 0755 $(DESTDIR)$(PREFIX)/share/rein
install -m 0755 rein $(DESTDIR)$(PREFIX)/bin
cp -r data/* $(DESTDIR)$(PREFIX)/share/rein
install -d -m 0755 $(DESTDIR)$(PREFIX)/share/pixmaps/
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/rein
rm -rf $(DESTDIR)$(PREFIX)/share/rein
endif
CFILES= \
src/platform.c \
src/stb_image.c \
src/lua-compat.c \
src/stb_image_resize.c \
src/bit.c \
src/utf.c \
src/thread.c \
src/main.c \
src/gfx.c \
src/stb_truetype.c \
src/system.c \
src/gfx_font.c \
src/net.c \
src/zvon.c \
src/zvon_mixer.c \
src/zvon_sfx.c \
src/synth.c
OFILES := $(patsubst %.c, %.o, $(CFILES))
$(OFILES): %.o : %.c
$(CC) -c $(<) $(I) $(CFLAGS) $(DATADIR) -o $(@)
rein: $(OFILES)
$(CC) $(CFLAGS) $(^) $(LDFLAGS) -o $(@)
clean:
$(RM) -f src/lua/*.o src/*.o rein