forked from DusteDdk/SDL-Ball
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (35 loc) · 1010 Bytes
/
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
ifndef PREFIX
PREFIX=/usr/local/
endif
DESTDIR?=$(PREFIX)share/games/sdl-ball/
DATADIR?=themes/
BINDIR=bin/
#append -DWITH_WIIUSE to compile with WIIUSE support!
#append -DNOSOUND to compile WITHOUT sound support
STRIP=strip
CXX?=g++
CXXFLAGS+=-Wall `sdl-config --cflags` -DDATADIR="\"$(DATADIR)\""
#append -lwiiuse to compile with WIIUSE support
#remove -lSDL_mixer if compiling with -DNOSOUND
LIBS+=-lGL -lGLU `sdl-config --libs` -lSDL_image -lSDL_ttf -lSDL_mixer
SOURCES=main.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=sdl-ball
all: $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CXX) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $@
$(STRIP) $@
.cpp.o:
$(CXX) -c $(CXXFLAGS) $< -o $@
clean:
rm -f *.o sdl-ball
install: $(EXECUTABLE) install-bin install-data
install-bin:
mkdir -p $(DESTDIR)
cp $(EXECUTABLE) $(DESTDIR)
ln -s $(DESTDIR)$(EXECUTABLE) $(PREFIX)$(BINDIR)
install-data:
mkdir -p $(DESTDIR)$(DATADIR)
cp -p -R themes/* $(DESTDIR)$(DATADIR)
remove:
rm -R ~/.config/sdl-ball