-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
79 lines (60 loc) · 1.73 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
CC = gcc
CFLAGS = -c -Wall
PKGCONFIG=pkg-config
LDFLAGS = $(shell $(PKGCONFIG) --libs sdl2) $(shell $(PKGCONFIG) --libs SDL2_image) $(shell $(PKGCONFIG) --libs SDL2_ttf)
LIBS = $(shell $(PKGCONFIG) --cflags sdl2)
SOURCES = common.c \
player.c \
game_state.c \
winner.c \
controller.c \
game_play.c \
main_game.c \
game.c \
main.c
OBJECTS = $(SOURCES:.c=.o) $(RESFILE)
EXECUTABLE = ronda
prefix = $(DESTDIR)/usr
BINDIR = $(prefix)/bin
DATADIR = $(prefix)/share/ronda/
DESKTOPDIR = $(prefix)/share/applications
ICONDIR = $(prefix)/share/pixmaps
GFXDIR = $(DATADIR)/gfx/
FONTSDIR = $(DATADIR)/fonts/
CARDSDIR = $(DATADIR)/cards/
INPLACE =
ifndef INPLACE
CFLAGS = -c -Wall -DDATA_DIR=\"$(DATADIR)\"
endif
all: exec
debug: CFLAGS += -D_DEBUG -g
debug: exec
exec: $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(OBJECTS) -o $@ $(LIBS) $(LDFLAGS)
.c.o:
$(CC) $(CFLAGS) $< -o $@
ifdef RESFILE
$(RESFILE): win32/ronda.rc
$(WINDRES) -i $< -o $@
endif
install:
install -D -m755 ronda $(BINDIR)/ronda
install -d -m755 $(GFXDIR)
install -m755 data/gfx/* $(GFXDIR)
install -d -m755 $(FONTSDIR)
install -m755 data/fonts/* $(FONTSDIR)
install -d -m755 $(CARDSDIR)
install -m755 data/cards/* $(CARDSDIR)
install -D -m755 data/ronda.desktop $(DESKTOPDIR)/ronda.desktop
install -D -m775 data/ronda.png $(ICONDIR)/ronda.png
win32-installer: exec
mkdir -p dist/installer
cp win32/install.nsi dist/installer/install.nsi
cp -r win32/dlls dist/dlls
cp win32/ronda.ico dist/
makensis dist/installer/install.nsi
uninstall:
rm -rf $(BINDIR)/ronda $(DATADIR) $(ICONDIR)/ronda.png $(DESKTOPDIR)/ronda.desktop
clean:
rm -rf *.o ronda ronda.exe dist