Skip to content

Commit

Permalink
Go back to xbuild based makefiles.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpobst committed Oct 29, 2010
1 parent ce391bf commit 84beac8
Show file tree
Hide file tree
Showing 5 changed files with 315 additions and 152 deletions.
99 changes: 82 additions & 17 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,17 +1,82 @@
SUBDIRS = \
Pinta.Resources \
Pinta.Core \
Pinta.Gui.Widgets \
System.Composition.ComponentModel \
Pinta.Effects \
Pinta.Tools \
Pinta

EXTRA_DIST = \
expansions.m4 \
lib/ICSharpCode.SharpZipLib.dll

# Targets

run:
(cd bin; mono --debug Pinta.exe)
BINDIR = $(srcdir)/bin

BINFILES = \
$(BINDIR)/Pinta.exe \
$(BINDIR)/Pinta.Core.dll \
$(BINDIR)/Pinta.Gui.Widgets.dll \
$(BINDIR)/Pinta.Resources.dll \
$(BINDIR)/System.ComponentModel.Composition.dll \
$(BINDIR)/Extensions/Pinta.Effects.dll \
$(BINDIR)/Extensions/Pinta.Tools.dll

RELEASE_FILE = $(PACKAGE)-$(VERSION)

# target: all - Default target: build
all: build

# target: run - Launch the uninstalled copy
run:
$(MONO) bin/Pinta.exe

# target: help - Display callable targets.
help:
egrep "^# target:" Makefile | sed 's/^# target:/make/'

# target: build - Build Pinta.
build: Pinta.sln
cd $(srcdir) && $(XBUILD) Pinta.sln
cd $(srcdir) && $(XBUILD) Pinta.Install.proj /target:CompileTranslations

# target: list - List source files.
list:
if ! git status > /dev/null 2> /dev/null ;\
then \
find . -type f -name *.cs | sed 's|./||' ;\
else \
git ls-files | grep '\.cs' ;\
fi

# target: clean - Default clean command: cleanobj and cleanbin
clean: cleanobj cleanbin

# target: distclean - Removes configure files.
distclean: clean
rm -f Makefile pinta config.status config.cache config.log configure.lineno config.status.lineno

# target: cleanall - Removes build files.
cleanall: distclean
rm -rf autom4te.cache
rm -f configure aclocal.m4 missing install-sh Makefile.in

# target: cleanbin - Removes built files.
cleanbin:
rm -rvf $(BINDIR)/*

# target: cleanobj - Removes temporary build files.
cleanobj:
find $(srcdir)/ -type d -name obj | xargs rm -rvf

# target: install - Installs Pinta.
install: pinta $(BINFILES)
cd $(srcdir) && $(XBUILD) /target:Install /property:InstallPrefix=$(DESTDIR)$(prefix) Pinta.Install.proj
$(INSTALL_SCRIPT) pinta $(DESTDIR)$(prefix)/bin/$(PACKAGE)

# target: uninstall - Uninstalls Pinta.
uninstall:
$(XBUILD) /target:Uninstall /property:InstallPrefix=$(DESTDIR)$(prefix) Pinta.Install.proj

# target: release - Default release type: releasetar
release: releasetar

# target: releasetar - Make a release tarball.
releasetar: $(BINFILES)
cd $(BINDIR) && tar -czf ../$(RELEASE_FILE).tgz --exclude=*mdb *

# target: releasezip - Make a release zip file.
releasezip: $(BINFILES)
cd $(BINDIR) && zip -r ../$(RELEASE_FILE).zip * -x "*.mdb"

EXTRA_DIST = Pinta Pinta.Core Pinta.Effects Pinta.Gui.Widgets Pinta.Resources Pinta.Tools po Tarball System.ComponentModel.Composition xdg \
license-mit.txt license-pdn.txt readme.txt todo.txt Pinta.sln Pinta.Install.proj

.PHONY: install uninstall cleanall cleanbin cleanobj release releasetar releasezip
57 changes: 0 additions & 57 deletions Makefile.include

This file was deleted.

115 changes: 115 additions & 0 deletions Pinta.Install.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">

<!-- Set some paths -->
<PropertyGroup>
<OutputPath>bin</OutputPath>
<InstallPrefix>/usr/local</InstallPrefix>
</PropertyGroup>

<!-- All of our translation files (po) -->
<ItemGroup>
<Translation Include="po/messages-ca.po">
<Code>ca</Code>
</Translation>
<Translation Include="po/messages-cs.po">
<Code>cs</Code>
</Translation>
<Translation Include="po/messages-de.po">
<Code>de</Code>
</Translation>
<Translation Include="po/messages-el.po">
<Code>el</Code>
</Translation>
<Translation Include="po/messages-es.po">
<Code>es</Code>
</Translation>
<Translation Include="po/messages-fi.po">
<Code>fi</Code>
</Translation>
<Translation Include="po/messages-fr.po">
<Code>fr</Code>
</Translation>
<Translation Include="po/messages-he.po">
<Code>he</Code>
</Translation>
<Translation Include="po/messages-hr.po">
<Code>hr</Code>
</Translation>
<Translation Include="po/messages-it.po">
<Code>it</Code>
</Translation>
<Translation Include="po/messages-ja.po">
<Code>ja</Code>
</Translation>
<Translation Include="po/messages-ko.po">
<Code>ko</Code>
</Translation>
<Translation Include="po/messages-ru.po">
<Code>ru</Code>
</Translation>
<Translation Include="po/messages-sk.po">
<Code>sk</Code>
</Translation>
<Translation Include="po/messages-th.po">
<Code>th</Code>
</Translation>
<Translation Include="po/messages-tr.po">
<Code>tr</Code>
</Translation>
<Translation Include="po/messages-uk.po">
<Code>uk</Code>
</Translation>
</ItemGroup>

<!-- Run msgfmt on our translation (po) files -->
<Target Name="CompileTranslations"
Inputs="@(Translation)"
Outputs="$(OutputPath)/locale/%(Translation.Code)/LC_MESSAGES/pinta.mo">

<MakeDir Directories="$(OutputPath)/locale/%(Translation.Code)/LC_MESSAGES" />
<Exec Command='msgfmt "@(Translation)" -o "$(OutputPath)/locale/%(Translation.Code)/LC_MESSAGES/pinta.mo"' />
</Target>

<!-- Reference all of our assemblies -->
<ItemGroup>
<BinFile Include="$(OutputPath)/*.exe" />
<BinFile Include="$(OutputPath)/*.dll" />
<ExtensionFile Include="$(OutputPath)/Extensions/*.dll" />
</ItemGroup>

<!-- Install everything for Pinta -->
<Target Name="Install">
<Copy SourceFiles="@(BinFile)" DestinationFolder="$(InstallPrefix)/lib/pinta" />
<Copy SourceFiles="@(ExtensionFile)" DestinationFolder="$(InstallPrefix)/lib/pinta/Extensions" />
<MakeDir Directories="$(InstallPrefix)/bin" />
<Copy SourceFiles="$(OutputPath)/locale/%(Translation.Code)/LC_MESSAGES/pinta.mo" DestinationFolder="$(InstallPrefix)/share/locale/%(Translation.Code)/LC_MESSAGES" />
<Copy SourceFiles="xdg/pinta.1" DestinationFolder="$(InstallPrefix)/share/man/man1" />
<Copy SourceFiles="xdg/pinta.desktop" DestinationFolder="$(InstallPrefix)/share/applications" />
<Copy SourceFiles="xdg/pinta.xpm" DestinationFolder="$(InstallPrefix)/share/pixmaps" />
<Copy SourceFiles="xdg/16x16/pinta.png" DestinationFolder="$(InstallPrefix)/share/icons/hicolor/16x16/apps" />
<Copy SourceFiles="xdg/22x22/pinta.png" DestinationFolder="$(InstallPrefix)/share/icons/hicolor/22x22/apps" />
<Copy SourceFiles="xdg/24x24/pinta.png" DestinationFolder="$(InstallPrefix)/share/icons/hicolor/24x24/apps" />
<Copy SourceFiles="xdg/32x32/pinta.png" DestinationFolder="$(InstallPrefix)/share/icons/hicolor/32x32/apps" />
<Copy SourceFiles="xdg/96x96/pinta.png" DestinationFolder="$(InstallPrefix)/share/icons/hicolor/96x96/apps" />
<Copy SourceFiles="xdg/scalable/pinta.svg" DestinationFolder="$(InstallPrefix)/share/icons/hicolor/scalable/apps" />
<Exec Command='gzip -f "$(InstallPrefix)/share/man/man1/pinta.1"' />
</Target>

<!-- Uninstall everything for Pinta -->
<Target Name="Uninstall">
<Exec Command='rm -rf "$(InstallPrefix)/lib/pinta"' />
<Delete Files="$(InstallPrefix)/bin/pinta" />
<Delete Files="$(InstallPrefix)/share/locale/%(Translation.Code)/LC_MESSAGES/pinta.mo" />
<Delete Files="$(InstallPrefix)/share/man/man1/pinta.1" />
<Delete Files="$(InstallPrefix)/share/man/man1/pinta.1.gz" />
<Delete Files="$(InstallPrefix)/share/applications/pinta.desktop" />
<Delete Files="$(InstallPrefix)/share/pixmaps/pinta.xpm" />
<Delete Files="$(InstallPrefix)/share/icons/hicolor/16x16/apps/pinta.png" />
<Delete Files="$(InstallPrefix)/share/icons/hicolor/22x22/apps/pinta.png" />
<Delete Files="$(InstallPrefix)/share/icons/hicolor/24x24/apps/pinta.png" />
<Delete Files="$(InstallPrefix)/share/icons/hicolor/32x32/apps/pinta.png" />
<Delete Files="$(InstallPrefix)/share/icons/hicolor/96x96/apps/pinta.png" />
<Delete Files="$(InstallPrefix)/share/icons/hicolor/scalable/apps/pinta.svg" />
</Target>
</Project>
Loading

0 comments on commit 84beac8

Please sign in to comment.