Merge pull request #3837 from Mailaender/makefile-fixes

Use the Makefile install rules for our packaging
This commit is contained in:
Paul Chote
2013-09-22 00:06:45 -07:00
12 changed files with 71 additions and 43 deletions

View File

@@ -5,12 +5,15 @@
language: c
# Make sure build dependencies are installed.
before_install:
- sudo apt-get update
install:
- sudo apt-get update && sudo apt-get install mono-gmcs cli-common-dev libsdl1.2debian libgl1-mesa-glx libopenal1 libfreetype6
- sudo apt-get install mono-gmcs cli-common-dev libsdl1.2debian libgl1-mesa-glx libopenal1 libfreetype6
# Run the build script which will automatically call RALint and ensure that the IDE project files are still valid.
script:
- make all
- make test
- xbuild
# Only watch the development branch.

View File

@@ -6,12 +6,21 @@
# to compile with development tools, run:
# make all
#
# to check the official mods for erroneous yaml files, run:
# make test
#
# to generate documentation aimed at modders, run:
# make docs
#
# to install, run:
# make [prefix=/foo] [bindir=/bar/bin] install
#
# to install with development tools, run:
# make [prefix=/foo] [bindir=/bar/bin] install-all
#
# to install Linux desktop files and icons:
# make install-shortcuts
#
# to uninstall, run:
# make uninstall
#
@@ -134,7 +143,6 @@ mod_ra_TARGET = mods/ra/OpenRA.Mods.RA.dll
mod_ra_KIND = library
mod_ra_DEPS = $(STD_MOD_DEPS) $(utility_TARGET) $(geoip_TARGET)
mod_ra_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(utility_TARGET) $(geoip_TARGET)
mod_ra_EXTRA_CMDS = mono --debug RALint.exe ra
PROGRAMS += mod_ra
mod_ra: $(mod_ra_TARGET)
@@ -144,7 +152,6 @@ mod_cnc_TARGET = mods/cnc/OpenRA.Mods.Cnc.dll
mod_cnc_KIND = library
mod_cnc_DEPS = $(STD_MOD_DEPS) $(mod_ra_TARGET)
mod_cnc_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(mod_ra_TARGET)
mod_cnc_EXTRA_CMDS = mono --debug RALint.exe cnc
PROGRAMS += mod_cnc
mod_cnc: $(mod_cnc_TARGET)
@@ -154,7 +161,6 @@ mod_d2k_TARGET = mods/d2k/OpenRA.Mods.D2k.dll
mod_d2k_KIND = library
mod_d2k_DEPS = $(STD_MOD_DEPS) $(mod_ra_TARGET) $(mod_cnc_TARGET)
mod_d2k_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(mod_ra_TARGET)
mod_d2k_EXTRA_CMDS = mono --debug RALint.exe d2k
PROGRAMS += mod_d2k
mod_d2k: $(mod_d2k_TARGET)
@@ -164,7 +170,6 @@ mod_ts_TARGET = mods/ts/OpenRA.Mods.TS.dll
mod_ts_KIND = library
mod_ts_DEPS = $(STD_MOD_DEPS) $(mod_ra_TARGET)
mod_ts_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(mod_ra_TARGET)
mod_ts_EXTRA_CMDS = mono --debug RALint.exe ts
PROGRAMS += mod_ts
mod_ts: $(mod_ts_TARGET)
@@ -187,14 +192,24 @@ OpenRA.Editor.Form1.resources:
editor: OpenRA.Editor.MapSelect.resources OpenRA.Editor.Form1.resources $(editor_TARGET)
# Analyses mod yaml for easy to detect errors
ralint_SRCS := $(shell find RALint/ -iname '*.cs')
ralint_TARGET = RALint.exe
ralint_SRCS := $(shell find OpenRA.Lint/ -iname '*.cs')
ralint_TARGET = OpenRA.Lint.exe
ralint_KIND = exe
ralint_DEPS = $(fileformats_TARGET) $(game_TARGET)
ralint_LIBS = $(COMMON_LIBS) $(ralint_DEPS)
PROGRAMS += ralint
ralint: $(ralint_TARGET)
test:
@mono --debug OpenRA.Lint.exe ra
@echo "OpenRA.Lint: ra mod yaml checks passed."
@mono --debug OpenRA.Lint.exe cnc
@echo "OpenRA.Lint: cnc mod yaml checks passed."
@mono --debug OpenRA.Lint.exe d2k
@echo "OpenRA.Lint: d2k mod yaml checks passed."
@mono --debug OpenRA.Lint.exe ts
@echo "OpenRA.Lint: ts mod yaml checks passed."
# Builds and exports tilesets from a bitmap
tsbuild_SRCS := $(shell find OpenRA.TilesetBuilder/ -iname '*.cs')
tsbuild_TARGET = OpenRA.TilesetBuilder.exe
@@ -218,8 +233,8 @@ tsbuild: OpenRA.TilesetBuilder.FormBuilder.resources OpenRA.TilesetBuilder.FormN
utility_SRCS := $(shell find OpenRA.Utility/ -iname '*.cs')
utility_TARGET = OpenRA.Utility.exe
utility_KIND = exe
utility_DEPS = $(fileformats_TARGET) $(game_TARGET)
utility_LIBS = $(COMMON_LIBS) $(utility_DEPS) thirdparty/ICSharpCode.SharpZipLib.dll System.Windows.Forms.dll
utility_DEPS = $(fileformats_TARGET) $(game_TARGET)
utility_LIBS = $(COMMON_LIBS) $(utility_DEPS) thirdparty/ICSharpCode.SharpZipLib.dll System.Windows.Forms.dll
PROGRAMS += utility
utility: $(utility_TARGET)
@@ -318,10 +333,8 @@ install-core: default
@echo 'DATADIR="$${ROOTDIR}/'"$(datadir)"'"' >> openra
@echo 'cd "$${DATADIR}/openra"' >> openra
@echo 'exec mono OpenRA.Game.exe "$$@"' >> openra
@$(INSTALL_DIR) "$(BIN_INSTALL_DIR)"
@$(INSTALL_PROGRAM) -m +rx openra "$(BIN_INSTALL_DIR)"
@-$(RM) openra
install-tools: tools
@@ -335,16 +348,33 @@ install-tools: tools
@echo 'DATADIR="$${ROOTDIR}/'"$(datadir)"'"' >> openra-editor
@echo 'cd "$${DATADIR}/openra"' >> openra-editor
@echo 'exec mono OpenRA.Editor.exe "$$@"' >> openra-editor
@$(INSTALL_DIR) "$(BIN_INSTALL_DIR)"
@$(INSTALL_PROGRAM) -m +rx openra-editor "$(BIN_INSTALL_DIR)"
@-$(RM) openra-editor
install-shortcuts: shortcuts
@$(INSTALL_DIR) "$(DESTDIR)$(datadir)/icons/"
@$(CP_R) packaging/linux/hicolor/ "$(DESTDIR)$(datadir)/icons"
@$(INSTALL_DIR) "$(DESTDIR)$(datadir)/applications"
@$(INSTALL_DATA) packaging/linux/openra.desktop "$(DESTDIR)$(datadir)/applications"
@$(INSTALL_DIR) "$(DESTDIR)$(datadir)/applications"
@$(INSTALL_DATA) packaging/linux/openra-editor.desktop "$(DESTDIR)$(datadir)/applications"
uninstall:
@-$(RM_R) "$(DATA_INSTALL_DIR)"
@-$(RM_F) "$(BIN_INSTALL_DIR)/openra"
@-$(RM_F) "$(BIN_INSTALL_DIR)/openra-editor"
@-$(RM_F) "$(DESTDIR)$(datadir)/applications/openra.desktop"
@-$(RM_F) "$(DESTDIR)$(datadir)/applications/openra-editor.desktop"
@-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/16x16/apps/openra.png"
@-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/32x32/apps/openra.png"
@-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/32x32/apps/openra-editor.png"
@-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/48x48/apps/openra.png"
@-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/48x48/apps/openra-editor.png"
@-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/64x64/apps/openra.png"
@-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/128x128/apps/openra.png"
help:
@echo to compile, run:
@@ -353,12 +383,21 @@ help:
@echo to compile with development tools, run:
@echo \ \ make all
@echo
@echo to check the official mods for erroneous yaml files, run:
@echo \ \ make test
@echo
@echo to generate documentation aimed at modders, run:
@echo \ \ make docs
@echo
@echo to install, run:
@echo \ \ make \[prefix=/foo\] \[bindir=/bar/bin\] install
@echo
@echo to install with development tools, run:
@echo \ \ make \[prefix=/foo\] \[bindir=/bar/bin\] install-all
@echo
@echo to install Linux desktop files and icons
@echo \ \ make install-shortcuts
@echo
@echo to uninstall, run:
@echo \ \ make uninstall
@echo

View File

@@ -8,8 +8,8 @@
<ProjectGuid>{F9FA4D9F-2302-470A-8A07-6E37F488C124}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RALint</RootNamespace>
<AssemblyName>RALint</AssemblyName>
<RootNamespace>OpenRA</RootNamespace>
<AssemblyName>OpenRA.Lint</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
@@ -36,7 +36,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\</OutputPath>
<OutputPath>..</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@@ -70,7 +70,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="RALint.cs" />
<Compile Include="YamlChecker.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">

View File

@@ -14,21 +14,21 @@ using OpenRA;
using OpenRA.FileFormats;
using OpenRA.Traits;
namespace RALint
namespace OpenRA.Lint
{
static class RALint
static class YamlChecker
{
static int errors = 0;
static void EmitError(string e)
{
Console.WriteLine("RALint(1,1): Error: {0}", e);
Console.WriteLine("OpenRA.Lint(1,1): Error: {0}", e);
++errors;
}
static void EmitWarning(string e)
{
Console.WriteLine("RALint(1,1): Warning: {0}", e);
Console.WriteLine("OpenRA.Lint(1,1): Warning: {0}", e);
}
static int Main(string[] args)

View File

@@ -43,7 +43,6 @@
<CustomCommands>
<CustomCommands>
<Command type="AfterBuild" command="cp ${TargetFile} ../mods/cnc" workingdir="${ProjectDir}" />
<Command type="AfterBuild" command="mono RALint.exe cnc" workingdir="${ProjectDir}/../" />
</CustomCommands>
</CustomCommands>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>

View File

@@ -43,7 +43,6 @@
<CustomCommands>
<CustomCommands>
<Command type="AfterBuild" command="cp ${TargetFile} ../mods/d2k" workingdir="${ProjectDir}" />
<Command type="AfterBuild" command="mono RALint.exe d2k" workingdir="${ProjectDir}/../" />
</CustomCommands>
</CustomCommands>
<DefineConstants>DEBUG;</DefineConstants>

View File

@@ -44,7 +44,6 @@
<CustomCommands>
<Command type="AfterBuild" command="cp ../thirdparty/FuzzyLogicLibrary.dll ../" workingdir="${ProjectDir}" />
<Command type="AfterBuild" command="cp ${TargetFile} ../mods/ra" workingdir="${ProjectDir}" />
<Command type="AfterBuild" command="mono RALint.exe ra" workingdir="${ProjectDir}/../" />
</CustomCommands>
</CustomCommands>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>

View File

@@ -21,7 +21,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Editor", "OpenRA.Edi
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.TilesetBuilder", "OpenRA.TilesetBuilder\OpenRA.TilesetBuilder.csproj", "{1A8E50CC-EE32-4E57-8842-0C39C8EA7541}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RALint", "RALint\RALint.csproj", "{F9FA4D9F-2302-470A-8A07-6E37F488C124}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Lint", "OpenRA.Lint\OpenRA.Lint.csproj", "{F9FA4D9F-2302-470A-8A07-6E37F488C124}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Utility", "OpenRA.Utility\OpenRA.Utility.csproj", "{F33337BE-CB69-4B24-850F-07D23E408DDF}"
EndProject

View File

@@ -15,22 +15,17 @@ ROOTDIR=root
# Clean up
rm -rf $ROOTDIR
# Game files
mkdir -p $ROOTDIR/usr/bin/
cp -T openra-bin $ROOTDIR/usr/bin/openra
cp -T openra-editor-bin $ROOTDIR/usr/bin/openra-editor
mkdir -p $ROOTDIR/usr/share/openra/
cp -R $BUILTDIR/* "$ROOTDIR/usr/share/openra/" || exit 3
cd ../..
# Copy files for OpenRA.Game.exe and OpenRA.Editor.exe as well as all dependencies.
make install-all prefix="/usr" DESTDIR="$PWD/packaging/linux/$ROOTDIR"
# Launch scripts (executed by Desura)
cp ../../*.sh "$ROOTDIR/usr/share/openra/" || exit 3
cp *.sh "$PWD/packaging/linux/$ROOTDIR/usr/share/openra/" || exit 3
# Desktop Icons
mkdir -p $ROOTDIR/usr/share/applications/
cp *.desktop "$ROOTDIR/usr/share/applications/"
# Icons and .desktop files
make install-shortcuts
mkdir -p $ROOTDIR/usr/share/icons/
cp -r hicolor $ROOTDIR/usr/share/icons/
cd packaging/linux
(
echo "Building Debian package."

View File

@@ -1,3 +0,0 @@
#!/bin/sh
cd /usr/share/openra
mono OpenRA.Game.exe "$@"

View File

@@ -1,3 +0,0 @@
#!/bin/sh
cd /usr/share/openra
mono OpenRA.Editor.exe "$@"