-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (50 loc) · 1.59 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
PREFIX=/usr/local
DATADIR=$(PREFIX)/share/starvoyager
DOCDIR=$(PREFIX)/share/doc/starvoyager
BINDIR=$(PREFIX)/bin
VERSION=0.4.4
CPPC=c++
CC=cc
LIBS:=`sdl-config --libs` -lSDL_net -lstdc++
CFLAGS:=`sdl-config --cflags` -Wall -ggdb3
#CFLAGS:=`sdl-config --cflags` -ggdb3 -Wall -Werror -ansi -pedantic
PACKAGENAME=starvoyager-$(VERSION)-`uname -m`-`uname|tr [A-Z] [a-z]`.bin
.SUFFIXES: .c .cc
all: starvoyager
#Linking
starvoyager: alliance.o camera.o database.o error.o game.o interface.o presence.o ship.o sound.o ticker.o calc.o client.o equip.o frag.o graphic.o planet.o server.o sockhelper.o sv.o player.o os.o SDL_rotozoom.o SDL_gfxPrimitives.o
$(CC) -o starvoyager *.o $(LIBS)
#Include dependencies
*.o: *.h
#Compiling
SDL_rotozoom.o: SDL_rotozoom.c
$(CC) $(CFLAGS) -c -o SDL_rotozoom.o SDL_rotozoom.c
SDL_gfxPrimitives.o: SDL_gfxPrimitives.c
$(CC) $(CFLAGS) -c -o SDL_gfxPrimitives.o SDL_gfxPrimitives.c
.cc.o:
$(CPPC) $(CFLAGS) -DPOSIX -DVERSION=\"${VERSION}\" -DDATADIR=\"${DATADIR}\" -c -o $@ $<
#Installing
install: all
rm $(DATADIR) -rf
rm $(DOCDIR) -rf
mkdir -p $(BINDIR) $(DOCDIR) $(DATADIR)/gfx $(DATADIR)/snd
cp data/gfx/* $(DATADIR)/gfx/
cp data/snd/* $(DATADIR)/snd/
cp data/*.svd $(DATADIR)/
cp README FAQ LGPL manual.html LICENCE $(DOCDIR)/
cp starvoyager $(BINDIR)/
chmod 755 $(BINDIR)/starvoyager
#Uninstalling
uninstall:
rm -r $(DATADIR)
rm -r $(DOCDIR)
rm $(BINDIR)/starvoyager
#Clean
clean:
rm -f *.o
rm -f starvoyager
rm -f starvoyager-*
#Making a binary package
binary:
cp binpackage.sh $(PACKAGENAME)
tar czf - $(BINDIR)/starvoyager $(DATADIR) $(DOCDIR) >>$(PACKAGENAME)