File: Makefile

package info (click to toggle)
starvoyager 0.4.4-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,604 kB
  • sloc: cpp: 7,650; ansic: 825; makefile: 50; sh: 15
file content (69 lines) | stat: -rw-r--r-- 1,756 bytes parent folder | download | duplicates (3)
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
PREFIX=$(DESTDIR)/usr
DATADIR=$(PREFIX)/share/games/starvoyager
DOCDIR=$(PREFIX)/share/doc/starvoyager
BINDIR=$(PREFIX)/games
VERSION=0.4.4

CPPC=c++
CC=cc
LIBS := `sdl-config --libs` -lSDL_net -lstdc++ -lm $(LDFLAGS)
CFLAGS := `sdl-config --cflags` $(CFLAGS) $(CXXFLAGS)
#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 $^ $(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:  install-data install-bin


install-data: all
	rm $(DATADIR) -rf
	rm $(DOCDIR) -rf
	mkdir -p $(DOCDIR) $(DATADIR)/gfx $(DATADIR)/snd 
	cp data/gfx/* $(DATADIR)/gfx/
	cp data/snd/* $(DATADIR)/snd/
	cp data/*.svd $(DATADIR)/

install-bin: all
	rm $(DOCDIR) -rf
	mkdir -p $(BINDIR) $(DOCDIR)
	cp starvoyager $(BINDIR)/
	cp README FAQ manual.html $(DOCDIR)/
	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)