2015-10-20 13:51:49 +02:00
|
|
|
PROG = tbftss
|
|
|
|
|
2015-11-01 23:19:39 +01:00
|
|
|
VERSION = 0.3
|
2015-10-20 13:51:49 +02:00
|
|
|
|
2015-10-20 19:13:54 +02:00
|
|
|
CXXFLAGS += `sdl2-config --cflags` -DVERSION=$(VERSION) -DUNIX=1
|
2015-10-20 13:51:49 +02:00
|
|
|
CXXFLAGS += -DUNIX
|
|
|
|
CXXFLAGS += $(CFLAGS) -Wall -ansi -pedantic -Werror -Wstrict-prototypes
|
|
|
|
CXXFLAGS += -g -lefence
|
|
|
|
|
|
|
|
LIBS = `sdl2-config --libs` -lSDL2_mixer -lSDL2_image -lSDL2_ttf -lm
|
|
|
|
|
2015-10-22 08:08:03 +02:00
|
|
|
SEARCHPATH += src/ src/battle src/draw src/game src/galaxy src/json src/system src/test
|
2015-10-20 13:51:49 +02:00
|
|
|
vpath %.c $(SEARCHPATH)
|
|
|
|
vpath %.h $(SEARCHPATH)
|
|
|
|
|
|
|
|
DEPS += defs.h structs.h
|
|
|
|
|
|
|
|
OBJS += ai.o
|
|
|
|
OBJS += battle.o bullets.o
|
|
|
|
OBJS += challenges.o cJSON.o
|
|
|
|
OBJS += draw.o
|
2015-10-26 18:27:43 +01:00
|
|
|
OBJS += effects.o entities.o
|
2015-10-20 13:51:49 +02:00
|
|
|
OBJS += fighters.o fighterDefs.o
|
2015-11-01 23:19:39 +01:00
|
|
|
OBJS += galacticMap.o game.o grid.o
|
2015-10-20 13:51:49 +02:00
|
|
|
OBJS += hud.o
|
|
|
|
OBJS += init.o io.o
|
|
|
|
OBJS += load.o lookup.o
|
|
|
|
OBJS += main.o mission.o missionInfo.o
|
|
|
|
OBJS += objectives.o options.o
|
|
|
|
OBJS += player.o
|
|
|
|
OBJS += radar.o
|
|
|
|
OBJS += save.o sound.o starfield.o starSystems.o stats.o
|
2015-10-26 09:10:13 +01:00
|
|
|
OBJS += testMission.o textures.o text.o title.o transition.o triggers.o
|
2015-10-20 13:51:49 +02:00
|
|
|
OBJS += util.o
|
2015-10-26 18:27:43 +01:00
|
|
|
OBJS += waypoints.o widgets.o
|
2015-10-20 13:51:49 +02:00
|
|
|
|
2015-11-01 14:51:28 +01:00
|
|
|
DIST_FILES = data gfx manual music sound src LICENSE makefile README.md
|
|
|
|
|
2015-10-20 13:51:49 +02:00
|
|
|
# top-level rule to create the program.
|
|
|
|
all: $(PROG)
|
|
|
|
|
|
|
|
# compiling other source files.
|
|
|
|
%.o: %.c %.h $(DEPS)
|
|
|
|
$(CC) $(CXXFLAGS) -c $<
|
|
|
|
|
|
|
|
# linking the program.
|
|
|
|
$(PROG): $(OBJS)
|
|
|
|
$(CC) -o $(PROG) $(OBJS) $(LIBS)
|
2015-11-01 14:51:28 +01:00
|
|
|
|
|
|
|
# prepare an archive for the program
|
|
|
|
dist:
|
|
|
|
$(RM) -rf $(PROG)-$(VERSION)
|
|
|
|
mkdir $(PROG)-$(VERSION)
|
|
|
|
cp -r $(DIST_FILES) $(PROG)-$(VERSION)
|
|
|
|
git log --oneline master..v$(VERSION) >$(PROG)-$(VERSION)/CHANGELOG
|
2015-11-01 17:12:13 +01:00
|
|
|
tar czf $(PROG)-$(VERSION)-src.tar.gz $(PROG)-$(VERSION)
|
2015-11-01 17:15:53 +01:00
|
|
|
mkdir -p dist
|
2015-11-01 17:12:13 +01:00
|
|
|
mv $(PROG)-$(VERSION)-src.tar.gz dist
|
2015-11-01 14:51:28 +01:00
|
|
|
$(RM) -rf $(PROG)-$(VERSION)
|
2015-10-20 13:51:49 +02:00
|
|
|
|
|
|
|
# cleaning everything that can be automatically recreated with "make".
|
|
|
|
clean:
|
2015-10-30 07:48:31 +01:00
|
|
|
$(RM) $(OBJS) $(PROG)
|
2015-11-01 14:51:28 +01:00
|
|
|
|
|
|
|
.PHONY: dist
|