2015-12-05 09:16:17 +01:00
|
|
|
PROG = tbftss
|
2015-11-24 23:46:52 +01:00
|
|
|
CC = gcc
|
2016-05-15 09:19:26 +02:00
|
|
|
PREFIX ?= /usr
|
|
|
|
BIN_DIR ?= $(PREFIX)/bin
|
|
|
|
DATA_DIR ?= /opt/$(PROG)
|
|
|
|
LOCALE_DIR = $(PREFIX)/share/locale
|
|
|
|
ICON_DIR = $(PREFIX)/share/icons/hicolor
|
|
|
|
DESKTOP_DIR = $(PREFIX)/share/applications
|
|
|
|
|
|
|
|
DESTDIR ?=
|
|
|
|
INST_BIN_DIR = $(DESTDIR)$(BIN_DIR)
|
|
|
|
INST_DATA_DIR = $(DESTDIR)$(DATA_DIR)
|
|
|
|
INST_LOCALE_DIR = $(DESTDIR)$(LOCALE_DIR)
|
|
|
|
INST_ICON_DIR = $(DESTDIR)$(ICON_DIR)
|
|
|
|
INST_DESKTOP_DIR = $(DESTDIR)$(DESKTOP_DIR)
|
2015-11-24 23:46:52 +01:00
|
|
|
|
|
|
|
SEARCHPATH += src/plat/unix
|
2018-04-29 17:44:06 +02:00
|
|
|
_OBJS += unixInit.o
|
2015-11-23 09:42:39 +01:00
|
|
|
|
|
|
|
include common.mk
|
2015-12-05 09:16:17 +01:00
|
|
|
|
2016-02-27 13:14:05 +01:00
|
|
|
CXXFLAGS += `sdl2-config --cflags` -DVERSION=$(VERSION) -DREVISION=$(REVISION) -DDATA_DIR=\"$(DATA_DIR)\" -DLOCALE_DIR=\"$(LOCALE_DIR)\"
|
2016-05-15 09:19:26 +02:00
|
|
|
CXXFLAGS += -Wall -Wempty-body -ansi -pedantic -Werror -Wstrict-prototypes -Werror=maybe-uninitialized -Warray-bounds
|
2015-12-05 09:16:17 +01:00
|
|
|
CXXFLAGS += -g -lefence
|
|
|
|
|
2017-08-26 14:00:51 +02:00
|
|
|
LDFLAGS += `sdl2-config --libs` -lSDL2_mixer -lSDL2_image -lSDL2_ttf -lm
|
2015-12-05 09:16:17 +01:00
|
|
|
|
2017-08-06 13:22:58 +02:00
|
|
|
SHARED_FILES = CHANGELOG LICENSE README.md data gfx manual music sound icons
|
2016-05-22 13:10:04 +02:00
|
|
|
DIST_FILES = $(SHARED_FILES) locale tbftss
|
2016-05-24 13:18:29 +02:00
|
|
|
SRC_DIST_FILES = $(SHARED_FILES) src makefile* common.mk
|
2015-12-05 09:16:17 +01:00
|
|
|
|
|
|
|
# linking the program.
|
|
|
|
$(PROG): $(OBJS)
|
2017-08-26 14:00:51 +02:00
|
|
|
$(CC) -o $@ $(OBJS) $(LDFLAGS)
|
2015-12-05 09:16:17 +01:00
|
|
|
|
|
|
|
install:
|
2016-05-15 09:19:26 +02:00
|
|
|
mkdir -p $(INST_BIN_DIR)
|
|
|
|
install -m 0755 $(PROG) $(INST_BIN_DIR)
|
|
|
|
mkdir -p $(INST_DATA_DIR)
|
|
|
|
cp -r data $(INST_DATA_DIR)
|
|
|
|
cp -r gfx $(INST_DATA_DIR)
|
|
|
|
cp -r manual $(INST_DATA_DIR)
|
|
|
|
cp -r music $(INST_DATA_DIR)
|
|
|
|
cp -r sound $(INST_DATA_DIR)
|
|
|
|
mkdir -p $(INST_ICON_DIR)/16x16/apps
|
|
|
|
mkdir -p $(INST_ICON_DIR)/32x32/apps
|
|
|
|
mkdir -p $(INST_ICON_DIR)/64x64/apps
|
|
|
|
mkdir -p $(INST_ICON_DIR)/128x128/apps
|
|
|
|
cp -p icons/$(PROG)-16x16.png $(INST_ICON_DIR)/16x16/apps/$(PROG).png
|
|
|
|
cp -p icons/$(PROG)-32x32.png $(INST_ICON_DIR)/32x32/apps/$(PROG).png
|
|
|
|
cp -p icons/$(PROG)-64x64.png $(INST_ICON_DIR)/64x64/apps/$(PROG).png
|
|
|
|
cp -p icons/$(PROG)-128x128.png $(INST_ICON_DIR)/128x128/apps/$(PROG).png
|
|
|
|
mkdir -p $(INST_DESKTOP_DIR)
|
|
|
|
cp -p icons/$(PROG).desktop $(INST_DESKTOP_DIR)
|
2015-12-05 09:16:17 +01:00
|
|
|
|
2016-02-28 16:29:21 +01:00
|
|
|
@for f in $(LOCALE_MO); do \
|
|
|
|
lang=`echo $$f | sed -e 's/^locale\///;s/\.mo$$//'`; \
|
2016-05-15 09:19:26 +02:00
|
|
|
mkdir -p $(INST_LOCALE_DIR)/$$lang/LC_MESSAGES; \
|
|
|
|
cp -v $$f $(INST_LOCALE_DIR)/$$lang/LC_MESSAGES/$(PROG).mo; \
|
2016-02-28 16:29:21 +01:00
|
|
|
done
|
|
|
|
|
2015-12-05 09:16:17 +01:00
|
|
|
uninstall:
|
2016-04-25 08:45:34 +02:00
|
|
|
$(RM) $(BIN_DIR)/$(PROG)
|
|
|
|
$(RM) -rf $(DATA_DIR)
|
|
|
|
$(RM) $(ICON_DIR)/16x16/apps/$(PROG).png
|
|
|
|
$(RM) $(ICON_DIR)/32x32/apps/$(PROG).png
|
|
|
|
$(RM) $(ICON_DIR)/64x64/apps/$(PROG).png
|
|
|
|
$(RM) $(ICON_DIR)/128x128/apps/$(PROG).png
|
|
|
|
$(RM) $(DESKTOP_DIR)/$(PROG).desktop
|
2016-02-28 16:29:21 +01:00
|
|
|
|
|
|
|
@for f in $(LOCALE_MO); do \
|
|
|
|
lang=`echo $$f | sed -e 's/^locale\///;s/\.mo$$//'`; \
|
2016-04-25 08:45:34 +02:00
|
|
|
$(RM) -v $(LOCALE_DIR)/$$lang/LC_MESSAGES/$(PROG).mo; \
|
2016-02-28 16:29:21 +01:00
|
|
|
done
|
2015-12-05 09:16:17 +01:00
|
|
|
|
|
|
|
# prepare an archive for the program
|
|
|
|
dist:
|
|
|
|
$(RM) -rf $(PROG)-$(VERSION)
|
|
|
|
mkdir $(PROG)-$(VERSION)
|
|
|
|
cp -r $(DIST_FILES) $(PROG)-$(VERSION)
|
2016-05-22 13:10:04 +02:00
|
|
|
tar czf $(PROG)-$(VERSION)-$(REVISION).linux-x86.tar.gz $(PROG)-$(VERSION)
|
|
|
|
mkdir -p dist
|
|
|
|
mv $(PROG)-$(VERSION)-$(REVISION).linux-x86.tar.gz dist
|
|
|
|
$(RM) -rf $(PROG)-$(VERSION)
|
|
|
|
|
|
|
|
# prepare an archive for the program
|
|
|
|
src-dist:
|
|
|
|
$(RM) -rf $(PROG)-$(VERSION)
|
|
|
|
mkdir $(PROG)-$(VERSION)
|
|
|
|
cp -r $(SRC_DIST_FILES) $(PROG)-$(VERSION)
|
2016-06-02 10:51:10 +02:00
|
|
|
git log --pretty=format:"%h%x09%an%x09%ad%x09%s" --date=short >$(PROG)-$(VERSION)/CHANGELOG.raw
|
2015-12-05 09:16:17 +01:00
|
|
|
tar czf $(PROG)-$(VERSION)-$(REVISION).src.tar.gz $(PROG)-$(VERSION)
|
|
|
|
mkdir -p dist
|
|
|
|
mv $(PROG)-$(VERSION)-$(REVISION).src.tar.gz dist
|
|
|
|
$(RM) -rf $(PROG)-$(VERSION)
|
|
|
|
|
|
|
|
.PHONY: dist
|