| 1 |
Description: Install on standard debian path and add a DATADIR var for |
| 2 |
splitting the package. |
| 3 |
Author: Jose G. López <[email protected]> |
| 4 |
Last-Update: 2018-03-11 |
| 5 |
--- a/Makefile |
| 6 |
+++ b/Makefile |
| 7 |
@@ -1,45 +1,52 @@ |
| 8 |
CC=g++ |
| 9 |
CCFLAGS=-O2 -Wall |
| 10 |
-CFILES=game.cpp gamestate.cpp gui.cpp image.cpp main.cpp panel.cpp player.cpp resources.cpp screen.cpp sector.cpp sound.cpp tutorial.cpp utils.cpp TinyXML/tinyxml.cpp TinyXML/tinyxmlerror.cpp TinyXML/tinyxmlparser.cpp |
| 11 |
-HFILES=game.h gamestate.h gui.h image.h panel.h player.h resources.h screen.h sector.h sound.h tutorial.h utils.h common.h stdafx.h TinyXML/tinyxml.h |
| 12 |
-OFILES=game.o gamestate.o gui.o image.o panel.o player.o resources.o screen.o sector.o sound.o tutorial.o utils.o main.o TinyXML/tinyxml.o TinyXML/tinyxmlerror.o TinyXML/tinyxmlparser.o |
| 13 |
+CFILES=game.cpp gamestate.cpp gui.cpp image.cpp main.cpp panel.cpp player.cpp resources.cpp screen.cpp sector.cpp sound.cpp tutorial.cpp utils.cpp |
| 14 |
+HFILES=game.h gamestate.h gui.h image.h panel.h player.h resources.h screen.h sector.h sound.h tutorial.h utils.h common.h stdafx.h |
| 15 |
+OFILES=game.o gamestate.o gui.o image.o panel.o player.o resources.o screen.o sector.o sound.o tutorial.o utils.o main.o |
| 16 |
APP=gigalomania |
| 17 |
INC=`sdl2-config --cflags` |
| 18 |
LINKPATH=`sdl2-config --libs` -L/usr/X11R6/lib/ -L/usr/lib |
| 19 |
|
| 20 |
LIBS=-lSDL2_image -lSDL2_mixer |
| 21 |
|
| 22 |
+PREFIX = /usr/local |
| 23 |
+BINDIR = $(PREFIX)/games |
| 24 |
+SHAREDIR = $(PREFIX)/share |
| 25 |
+DATADIR = $(SHAREDIR)/$(APP) |
| 26 |
+ |
| 27 |
all: $(APP) |
| 28 |
|
| 29 |
$(APP): $(OFILES) $(HFILES) $(CFILES) |
| 30 |
$(CC) $(OFILES) $(CCFLAGS) $(LINKPATH) $(LIBS) -o $(APP) |
| 31 |
|
| 32 |
.cpp.o: |
| 33 |
- $(CC) $(CCFLAGS) -O2 $(INC) -c $< -o $@ |
| 34 |
+ $(CC) $(CCFLAGS) -O2 $(INC) -DDATADIR='"$(DATADIR)"' -c $< -o $@ |
| 35 |
|
| 36 |
# REMEMBER to update debian/dirs if the system directories that we use are changed!!! |
| 37 |
install: $(APP) |
| 38 |
- mkdir -p $(DESTDIR)/opt/gigalomania # -p so we don't fail if folder already exists |
| 39 |
- cp $(APP) $(DESTDIR)/opt/gigalomania |
| 40 |
- cp readme.html $(DESTDIR)/opt/gigalomania |
| 41 |
- cp -a gfx/ $(DESTDIR)/opt/gigalomania # -a need to copy permissions etc |
| 42 |
- cp -a islands/ $(DESTDIR)/opt/gigalomania |
| 43 |
- cp -a music/ $(DESTDIR)/opt/gigalomania |
| 44 |
- cp -a sound/ $(DESTDIR)/opt/gigalomania |
| 45 |
+ mkdir -p $(DESTDIR)/$(BINDIR) |
| 46 |
+ cp $(APP) $(DESTDIR)/$(BINDIR) |
| 47 |
+ mkdir -p $(DESTDIR)/$(SHAREDIR)/$(APP) |
| 48 |
+ cp readme.html $(DESTDIR)/$(SHAREDIR)/$(APP) |
| 49 |
+ cp -a gfx/ $(DESTDIR)/$(SHAREDIR)/$(APP) # -a need to copy permissions etc |
| 50 |
+ cp -a islands/ $(DESTDIR)/$(SHAREDIR)/$(APP) |
| 51 |
+ cp -a music/ $(DESTDIR)/$(SHAREDIR)/$(APP) |
| 52 |
+ cp -a sound/ $(DESTDIR)/$(SHAREDIR)/$(APP) |
| 53 |
# needed for DESTDIR option: |
| 54 |
- mkdir -p $(DESTDIR)/usr/share/applications |
| 55 |
- cp gigalomania.desktop $(DESTDIR)/usr/share/applications/ |
| 56 |
+ mkdir -p $(DESTDIR)/$(SHAREDIR)/applications |
| 57 |
+ cp gigalomania.desktop $(DESTDIR)/$(SHAREDIR)/applications/ |
| 58 |
#cp gigalomania_fullscreen.desktop $(DESTDIR)/usr/share/applications/ |
| 59 |
# needed for DESTDIR option: |
| 60 |
- mkdir -p $(DESTDIR)/usr/share/pixmaps |
| 61 |
- cp gigalomania64.png $(DESTDIR)/usr/share/pixmaps/ |
| 62 |
+ mkdir -p $(DESTDIR)/$(SHAREDIR)/pixmaps |
| 63 |
+ cp gigalomania64.png $(DESTDIR)/$(SHAREDIR)/pixmaps/ |
| 64 |
# REMEMBER to update debian/dirs if the system directories that we use are changed!!! |
| 65 |
|
| 66 |
uninstall: |
| 67 |
- rm -rf $(DESTDIR)/opt/gigalomania # -f so we don't fail if folder doesn't exist |
| 68 |
- rm -f $(DESTDIR)/usr/share/applications/gigalomania.desktop |
| 69 |
+ rm -f $(DESTDIR)/$(BINDIR)/$(APP) |
| 70 |
+ rm -rf $(DESTDIR)/$(SHAREDIR)/$(APP) |
| 71 |
+ rm -f $(DESTDIR)/$(SHAREDIR)/applications/gigalomania.desktop |
| 72 |
#rm -f $(DESTDIR)/usr/share/applications/gigalomania_fullscreen.desktop |
| 73 |
- rm -f $(DESTDIR)/usr/share/pixmaps/gigalomania64.png |
| 74 |
+ rm -f $(DESTDIR)/$(SHAREDIR)/pixmaps/gigalomania64.png |
| 75 |
|
| 76 |
install_maemo: $(APP) |
| 77 |
mkdir -p $(DESTDIR)/opt/gigalomania # -p so we don't fail if folder already exists |