2014-03-15 16:59:03 +00:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
# -*- makefile -*-
|
|
|
|
|
|
|
|
#############################################################################
|
|
|
|
#
|
|
|
|
# GNU Make Debian package makefile for SRB2
|
|
|
|
#
|
|
|
|
# Copyright (C) 1998-2010 by Callum Dickinson
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# This file most likely will not need to be modified to make
|
|
|
|
# branches of SRB2 capable of making their own Debian packages,
|
|
|
|
# instead look at the /debian/control file for configuration.
|
|
|
|
#
|
|
|
|
#############################################################################
|
|
|
|
|
|
|
|
# Uncomment this to turn on verbose mode.
|
|
|
|
#export DH_VERBOSE=1
|
|
|
|
|
|
|
|
# user/group of to-be-installed files
|
|
|
|
ROOT_USER := 0
|
|
|
|
ROOT_GROUP := 0
|
|
|
|
|
|
|
|
# determine cross-compile (may need some work)
|
|
|
|
CROSS_COMPILE_BUILD := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
|
|
|
|
CROSS_COMPILE_HOST := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
|
|
|
|
CROSS_COMPILE := $(shell test "$(CROSS_COMPILE_BUILD)" != "$(CROSS_COMPILE_HOST)" && echo "$(CROSS_COMPILE_HOST)")
|
|
|
|
|
|
|
|
MKDIR = mkdir -p
|
|
|
|
MAKE = make
|
|
|
|
INSTALL = install -o $(ROOT_USER) -g $(ROOT_GROUP) -m 644
|
|
|
|
MV = mv
|
|
|
|
RM = rm -rf
|
|
|
|
STRIPARGS = --strip-unneeded
|
|
|
|
ifdef CROSS_COMPILE
|
|
|
|
STRIP = $(CROSS_COMPILE_HOST)-strip $(STRIPARGS)
|
|
|
|
else
|
|
|
|
STRIP = strip $(STRIPARGS)
|
|
|
|
endif
|
|
|
|
DIR := $(shell pwd)
|
|
|
|
|
|
|
|
# FIXME: hate hate hate head/tail hack :(
|
|
|
|
CONTROLF = $(DIR)/debian/control
|
|
|
|
PACKAGE = srb2
|
|
|
|
DBGPKG = $(PACKAGE)-dbg
|
|
|
|
TITLE = Sonic Robo Blast 2
|
|
|
|
SECTION = Games/Action
|
|
|
|
EXENAME = srb2
|
|
|
|
DBGNAME = debug/$(EXENAME)
|
|
|
|
|
2018-11-26 19:40:59 +00:00
|
|
|
PKGDIR = usr/games/SRB2
|
2014-03-15 16:59:03 +00:00
|
|
|
DBGDIR = usr/lib/debug/$(PKGDIR)
|
2016-02-06 23:08:53 +00:00
|
|
|
PIXMAPS_DIR = usr/share/pixmaps
|
|
|
|
DESKTOP_DIR = usr/share/applications
|
2014-03-15 16:59:03 +00:00
|
|
|
PREFIX = $(shell test "$(CROSS_COMPILE_BUILD)" != "$(CROSS_COMPILE_HOST)" && echo "PREFIX=$(CROSS_COMPILE_HOST)")
|
|
|
|
OS = LINUX=1
|
|
|
|
NONX86 = $(shell test "`echo $(CROSS_COMPILE_HOST) | grep 'i[3-6]86'`" || echo "NONX86=1")
|
2016-02-06 17:31:37 +00:00
|
|
|
MAKEARGS = $(OS) $(NONX86) $(PREFIX) EXENAME=$(EXENAME) DBGNAME=$(DBGNAME) SDL_PKGCONFIG=sdl2 PNG_PKGCONFIG=libpng NOOBJDUMP=1
|
2014-03-15 16:59:03 +00:00
|
|
|
MENUFILE1 = ?package($(PACKAGE)):needs="X11" section="$(SECTION)"
|
|
|
|
MENUFILE2 = title="$(TITLE)" command="/$(PKGDIR)/$(PACKAGE)"
|
|
|
|
# FIXME pkg-config dir hacks
|
2016-02-06 22:25:27 +00:00
|
|
|
export PKG_CONFIG_LIBDIR = /usr/lib/$(CROSS_COMPILE_HOST)/pkgconfig
|
2014-03-15 16:59:03 +00:00
|
|
|
BINDIR := $(DIR)/bin/Linux/Release
|
2016-02-06 22:25:27 +00:00
|
|
|
LDFLAGS += "-Wl,-rpath=/usr/lib/$(CROSS_COMPILE_HOST)"
|
2018-11-27 06:26:44 +00:00
|
|
|
|
2018-11-26 19:40:59 +00:00
|
|
|
# FIXME some libgme-dev packages don't use pkg-config yet, so include the linker flag ourselves
|
2018-11-27 06:26:44 +00:00
|
|
|
PKG_CONFIG?=pkg-config
|
|
|
|
LIBGME_PKGCONFIG?=libgme
|
|
|
|
LIBGME_LDFLAGS?=$(shell $(PKG_CONFIG) $(LIBGME_PKGCONFIG) --libs)
|
|
|
|
|
|
|
|
ifeq ($(LIBGME_LDFLAGS),)
|
2018-11-26 12:45:41 +00:00
|
|
|
MAKEARGS += LIBGME_LDFLAGS=-lgme
|
2018-11-27 06:26:44 +00:00
|
|
|
endif
|
2014-03-15 16:59:03 +00:00
|
|
|
|
|
|
|
build:
|
|
|
|
$(MKDIR) $(BINDIR)/debug
|
|
|
|
$(MAKE) -C $(DIR)/src $(MAKEARGS)
|
|
|
|
$(STRIP) $(BINDIR)/$(EXENAME)
|
|
|
|
|
|
|
|
binary-indep:
|
|
|
|
# only here to kill Lintian warning
|
|
|
|
echo "no need to do any arch-independent stuff"
|
|
|
|
|
|
|
|
binary-arch:
|
2016-02-06 23:08:53 +00:00
|
|
|
# create ddirs
|
2014-03-15 16:59:03 +00:00
|
|
|
$(MKDIR) $(DIR)/debian/tmp/$(PKGDIR) $(DIR)/debian/tmp/$(DBGDIR)
|
2016-02-06 23:08:53 +00:00
|
|
|
$(MKDIR) $(DIR)/debian/tmp/$(PKGDIR) $(DIR)/debian/tmp/$(DESKTOP_DIR)
|
|
|
|
$(MKDIR) $(DIR)/debian/tmp/$(PKGDIR) $(DIR)/debian/tmp/$(PIXMAPS_DIR)
|
|
|
|
# install main binaries
|
2014-03-15 16:59:03 +00:00
|
|
|
$(INSTALL) $(BINDIR)/$(EXENAME) $(DIR)/debian/tmp/$(PKGDIR)/$(PACKAGE)
|
|
|
|
$(INSTALL) $(BINDIR)/$(DBGNAME) $(DIR)/debian/tmp/$(DBGDIR)/$(PACKAGE)
|
2016-02-06 22:41:53 +00:00
|
|
|
# Install desktop file and banner image
|
|
|
|
$(INSTALL) $(DIR)/srb2.png $(DIR)/debian/tmp/usr/share/pixmaps
|
|
|
|
$(INSTALL) $(DIR)/debian/srb2.desktop $(DIR)/debian/tmp/usr/share/applications
|
2014-03-15 16:59:03 +00:00
|
|
|
# add compiled binaries to include-binaries
|
|
|
|
echo $(BINDIR)/$(EXENAME) >> $(DIR)/debian/source/include-binaries
|
|
|
|
echo $(BINDIR)/$(EXENAME) >> $(DIR)/debian/source/include-binaries
|
|
|
|
# Generate install folder files
|
|
|
|
echo $(PKGDIR) > $(DIR)/debian/$(PACKAGE).install
|
2016-02-07 03:17:14 +00:00
|
|
|
echo $(DESKTOP_DIR) >> $(DIR)/debian/$(PACKAGE).install
|
|
|
|
echo $(PIXMAPS_DIR) >> $(DIR)/debian/$(PACKAGE).install
|
2014-03-15 16:59:03 +00:00
|
|
|
echo $(DBGDIR) > $(DIR)/debian/$(DBGPKG).install
|
2018-11-27 16:05:34 +00:00
|
|
|
# Launchpad only calls binary-arch, so just move everything up
|
|
|
|
#binary: binary-arch
|
2014-03-15 16:59:03 +00:00
|
|
|
# Generate .desktop specifications
|
|
|
|
echo "`echo '$(MENUFILE1)\\'`" > $(DIR)/debian/menu
|
|
|
|
echo " `echo '$(MENUFILE2)'`" >> $(DIR)/debian/menu
|
|
|
|
dh_testdir
|
|
|
|
dh_testroot
|
|
|
|
dh_installchangelogs
|
|
|
|
dh_installdocs
|
|
|
|
# dh_installexamples
|
|
|
|
dh_install --sourcedir=$(DIR)/debian/tmp
|
|
|
|
dh_installmenu
|
|
|
|
# dh_installdebconf
|
|
|
|
# dh_installlogrotate
|
|
|
|
# dh_installemacsen
|
|
|
|
# dh_installpam
|
|
|
|
# dh_installmime
|
|
|
|
# dh_python
|
|
|
|
# dh_installinit
|
|
|
|
# dh_installcron
|
|
|
|
# dh_installinfo
|
|
|
|
# dh_installman
|
|
|
|
# dh_link
|
|
|
|
dh_compress
|
|
|
|
dh_fixperms
|
|
|
|
# dh_perl
|
|
|
|
# dh_makeshlibs
|
|
|
|
dh_installdeb
|
|
|
|
-dh_shlibdeps
|
|
|
|
dh_gencontrol
|
|
|
|
dh_md5sums
|
|
|
|
dh_builddeb
|
|
|
|
|
2018-11-27 16:05:34 +00:00
|
|
|
binary: binary-arch
|
|
|
|
|
2014-03-15 16:59:03 +00:00
|
|
|
clean:
|
|
|
|
$(MAKE) -C $(DIR)/src $(MAKEARGS) clean cleandep
|
|
|
|
$(RM) $(BINDIR)/*
|
|
|
|
$(RM) $(DIR)/debian/$(PACKAGE)/*
|
|
|
|
$(RM) $(DIR)/debian/$(DBGPKG)/*
|
|
|
|
$(RM) $(DIR)/debian/tmp/*
|
|
|
|
$(RM) $(DIR)/debian/$(PACKAGE).install
|
|
|
|
$(RM) $(DIR)/debian/$(DBGPKG).install
|
|
|
|
$(RM) $(DIR)/debian/menu
|
|
|
|
$(RM) $(DIR)/debian/files
|
|
|
|
$(RM) $(DIR)/debian/source/include-binaries
|
|
|
|
|
2018-11-27 16:05:34 +00:00
|
|
|
.PHONY: all clean binary binary-indep build
|