tbftss/common.mk

83 lines
2.1 KiB
Makefile
Raw Normal View History

2015-10-20 13:51:49 +02:00
PROG = tbftss
TARGET = $(PROG)$(EXEEXT)
VERSION = 0.4
REVISION = $(shell date +"%y%m%d")
2015-11-02 20:17:55 +01:00
DEBUG = 0
2015-10-20 13:51:49 +02:00
2015-11-23 09:42:39 +01:00
CXXFLAGS += `sdl2-config --cflags` -DVERSION=$(VERSION) -DREVISION=$(REVISION) -DDEBUG=$(DEBUG)
CXXFLAGS += -Wall -ansi -pedantic -Werror -Wstrict-prototypes
2015-10-20 13:51:49 +02:00
CXXFLAGS += -g -lefence
LIBS := `sdl2-config --libs` -lSDL2_mixer -lSDL2_image -lSDL2_ttf -lm
2015-10-20 13:51:49 +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-11-09 23:46:57 +01:00
OBJS += effects.o entities.o extractionPoint.o
2015-11-16 18:23:56 +01:00
OBJS += fighters.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
2015-11-23 15:52:11 +01:00
OBJS += init.o input.o io.o items.o
2015-10-20 13:51:49 +02:00
OBJS += load.o lookup.o
OBJS += main.o messageBox.o mission.o missionInfo.o
2015-10-20 13:51:49 +02:00
OBJS += objectives.o options.o
OBJS += player.o
OBJS += radar.o rope.o
OBJS += save.o script.o sound.o starfield.o starSystems.o stats.o
OBJS += testMission.o textures.o text.o title.o transition.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
DIST_FILES = data gfx manual music sound src LICENSE makefile* common.mk README.md CHANGELOG
2015-11-01 14:51:28 +01:00
2015-10-20 13:51:49 +02:00
# top-level rule to create the program.
all: $(TARGET)
2015-10-20 13:51:49 +02:00
# compiling other source files.
%.o: %.c %.h $(DEPS)
2015-11-23 09:42:39 +01:00
$(CC) $(CFLAGS) $(CXXFLAGS) -c $<
2015-10-20 13:51:49 +02:00
# linking the program.
$(TARGET): $(OBJS)
$(CC) -o $@ $(OBJS) $(LIBS)
install:
cp $(TARGET) $(BIN_DIR)
mkdir -p $(DATA_DIR)
cp -r data $(DATA_DIR)
cp -r gfx $(DATA_DIR)
cp -r manual $(DATA_DIR)
cp -r music $(DATA_DIR)
cp -r sound $(DATA_DIR)
uninstall:
$(RM) $(BIN_DIR)/$(TARGET)
$(RM) -rf $(DATA_DIR)
2015-11-23 09:42:39 +01:00
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)
2015-11-18 07:51:17 +01:00
git log --oneline --decorate >$(PROG)-$(VERSION)/CHANGELOG.raw
2015-11-14 15:45:19 +01:00
tar czf $(PROG)-$(VERSION).$(REVISION)-src.tar.gz $(PROG)-$(VERSION)
2015-11-01 17:15:53 +01:00
mkdir -p dist
$(RM) -rf dist/*
2015-11-14 15:45:19 +01:00
mv $(PROG)-$(VERSION).$(REVISION)-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:
$(RM) $(OBJS) $(TARGET)
2015-11-01 14:51:28 +01:00
.PHONY: dist