1 CXXFLAGS ?= -O2 -Wall -g
2 CXXFLAGS += `pkg-config --cflags sdl2 SDL2_image SDL2_mixer`
3 LIBS = `pkg-config --libs sdl2 SDL2_image SDL2_mixer`
4 OBJS = alien.o audio.o bullet.o cargo.o collectable.o engine.o explosion.o game.o graphics.o init.o intermission.o loadSave.o messages.o misc.o missions.o player.o resources.o script.o ship.o shop.o Starfighter.o title.o weapons.o
9 DATA = data gfx sound music
10 DATAFILES = data/* gfx/* sound/* music/*
13 BINDIR ?= $(PREFIX)/games/
14 DATADIR ?= $(PREFIX)/share/games/parallelrealities/
15 DOCDIR ?= $(PREFIX)/share/doc/$(PROG)/
17 # top-level rule to create the program.
22 # compiling other source files.
23 %.o: src/%.cpp src/*.h
24 $(CXX) $(CXXFLAGS) -c -DVERSION=\"$(VERSION)\" -DDATADIR=\"$(DATADIR)\" $<
26 # linking the program.
28 $(CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJS) -o $(PROG) $(LIBS)
30 # cleaning everything that can be automatically recreated with "make".
36 mkdir -p $(DESTDIR)$(BINDIR)
37 mkdir -p $(DESTDIR)$(DATADIR)
38 mkdir -p $(DESTDIR)$(DOCDIR)
40 install -m 755 $(PROG) $(DESTDIR)$(BINDIR)$(PROG)
41 cp -pr $(DATA) $(DESTDIR)$(DATADIR)
42 cp -p $(DOCS) $(DESTDIR)$(DOCDIR)
46 jpegoptim --strip-all gfx/*.jpg
49 rm -rf starfighter-$(VERSION)
50 mkdir starfighter-$(VERSION)
51 cp --parents -lt starfighter-$(VERSION) `git ls-files`
52 git log >starfighter-$(VERSION)/ChangeLog
53 tar czf starfighter-$(VERSION).tar.gz starfighter-$(VERSION)
54 rm -rf starfighter-$(VERSION)
56 .PHONY: all clean install optimise dist