2012-12-09 17:02:58 +01:00
|
|
|
CXXFLAGS ?= -O2 -Wall -g
|
2015-03-12 16:41:23 +01:00
|
|
|
CXXFLAGS += `pkg-config --cflags sdl2 SDL2_image SDL2_mixer`
|
2013-09-30 16:52:43 +02:00
|
|
|
LIBS = `pkg-config --libs sdl2 SDL2_image SDL2_mixer`
|
2016-01-05 02:17:06 +01:00
|
|
|
OBJS = alien.o audio.o bullet.o cargo.o collectable.o colors.o cutscene.o engine.o event.o explosion.o game.o gfx.o intermission.o loadSave.o messages.o misc.o missions.o player.o renderer.o resources.o screen.o ship.o shop.o Starfighter.o title.o weapons.o window.o
|
2012-12-09 17:02:58 +01:00
|
|
|
|
2015-06-20 17:58:37 +02:00
|
|
|
VERSION = 1.4.1-dev
|
2012-12-09 17:02:58 +01:00
|
|
|
PROG = starfighter
|
|
|
|
DOCS = docs/*
|
2015-04-20 19:05:28 +02:00
|
|
|
DATA = data gfx sound music
|
|
|
|
DATAFILES = data/* gfx/* sound/* music/*
|
2012-12-09 17:02:58 +01:00
|
|
|
|
|
|
|
PREFIX ?= /usr
|
|
|
|
BINDIR ?= $(PREFIX)/games/
|
|
|
|
DATADIR ?= $(PREFIX)/share/games/parallelrealities/
|
|
|
|
DOCDIR ?= $(PREFIX)/share/doc/$(PROG)/
|
|
|
|
|
|
|
|
# top-level rule to create the program.
|
|
|
|
ALL = $(PROG)
|
|
|
|
|
|
|
|
all: $(ALL)
|
|
|
|
|
|
|
|
# compiling other source files.
|
2013-07-11 14:24:37 +02:00
|
|
|
%.o: src/%.cpp src/*.h
|
2015-02-26 17:09:28 +01:00
|
|
|
$(CXX) $(CXXFLAGS) -c -DVERSION=\"$(VERSION)\" -DDATADIR=\"$(DATADIR)\" $<
|
2012-12-09 17:02:58 +01:00
|
|
|
|
|
|
|
# linking the program.
|
|
|
|
$(PROG): $(OBJS)
|
|
|
|
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJS) -o $(PROG) $(LIBS)
|
|
|
|
|
|
|
|
# cleaning everything that can be automatically recreated with "make".
|
|
|
|
clean:
|
|
|
|
$(RM) $(OBJS) $(ALL)
|
|
|
|
|
|
|
|
# install
|
|
|
|
install: $(ALL)
|
|
|
|
mkdir -p $(DESTDIR)$(BINDIR)
|
|
|
|
mkdir -p $(DESTDIR)$(DATADIR)
|
|
|
|
mkdir -p $(DESTDIR)$(DOCDIR)
|
|
|
|
|
|
|
|
install -m 755 $(PROG) $(DESTDIR)$(BINDIR)$(PROG)
|
2015-06-25 02:32:47 +02:00
|
|
|
cp -r $(DATA) $(DESTDIR)$(DATADIR)
|
|
|
|
cp $(DOCS) $(DESTDIR)$(DOCDIR)
|
2012-12-09 17:02:58 +01:00
|
|
|
|
|
|
|
optimise:
|
|
|
|
advpng -z gfx/*.png
|
|
|
|
jpegoptim --strip-all gfx/*.jpg
|
|
|
|
|
|
|
|
dist:
|
|
|
|
rm -rf starfighter-$(VERSION)
|
|
|
|
mkdir starfighter-$(VERSION)
|
|
|
|
cp --parents -lt starfighter-$(VERSION) `git ls-files`
|
|
|
|
git log >starfighter-$(VERSION)/ChangeLog
|
|
|
|
tar czf starfighter-$(VERSION).tar.gz starfighter-$(VERSION)
|
|
|
|
rm -rf starfighter-$(VERSION)
|
|
|
|
|
2015-02-26 17:22:57 +01:00
|
|
|
.PHONY: all clean install optimise dist
|