From 649fc1d12d7be943b5ab964b9dac0670797d9057 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Remko=20Tron=C3=A7on?= <git@el-tramo.be>
Date: Fri, 26 Jun 2009 20:03:07 +0200
Subject: Added a 'make install-swift' target.


diff --git a/Makefile b/Makefile
index f56cfbc..7a03078 100644
--- a/Makefile
+++ b/Makefile
@@ -50,11 +50,7 @@ include QA/Makefile.inc
 all: $(TARGETS)
 
 .PHONY: install
-install: install-dirs $(INSTALL_TARGETS)
-
-.PHONY: install-dirs
-install-dirs:
-	install -d $(includedir) $(libdir)
+install: $(INSTALL_TARGETS)
 
 .PHONY: coverage
 coverage:
@@ -62,6 +58,7 @@ coverage:
 
 .PHONY: clean
 clean: clean-deps $(CLEAN_TARGETS)
+
 	-$(RM) $(CLEANFILES) *.gcov
 	-find . -name "*.gcda" -exec rm {} \;
 	-find . -name "*.gcno" -exec rm {} \;
diff --git a/Makefile.config.in b/Makefile.config.in
index f0c5b1f..7124484 100644
--- a/Makefile.config.in
+++ b/Makefile.config.in
@@ -8,6 +8,7 @@ exec_prefix=@exec_prefix@
 bindir=@bindir@
 libdir=@libdir@
 includedir=@includedir@
+datadir=@datadir@
 
 @SET_MAKE@
 MM=@MM@
diff --git a/Swift/Makefile.inc b/Swift/Makefile.inc
index 8646f2a..ab677af 100644
--- a/Swift/Makefile.inc
+++ b/Swift/Makefile.inc
@@ -1,3 +1,10 @@
 include Swift/Controllers/Makefile.inc
 include Swift/QtUI/Makefile.inc
 include Swift/Packaging/Debian/Makefile.inc
+
+INSTALL_TARGETS += install-swift
+
+.PHONY: install-swift
+install-swift: qt
+	install -d $(DESTDIR)$(bindir)
+	install Swift/QtUI/swift $(DESTDIR)$(bindir)
diff --git a/Swiften/Makefile.inc b/Swiften/Makefile.inc
index d5bf0f5..0ed7bab 100644
--- a/Swiften/Makefile.inc
+++ b/Swiften/Makefile.inc
@@ -51,10 +51,11 @@ $(SWIFTEN_TARGET): $(SWIFTEN_OBJECTS)
 
 .PHONY: install-swiften
 install-swiften: $(SWIFTEN_TARGET) $(SWIFTEN_HEADERS)
-	install -d $(includedir)/Swiften/3rdParty
-	rsync -a 3rdParty/Boost/boost $(includedir)/Swiften/3rdParty/Boost
-	for header in $(SWIFTEN_HEADERS); do headerdir=$(includedir)/`dirname $$header`; echo $$header install -d $$headerdir; install $$header $$headerdir; done
-	install $(SWIFTEN_TARGET) $(libdir)
+	install -d $(DESTDIR)$(includedir) $(DESTDIR)$(libdir)
+	install -d $(DESTDIR)$(includedir)/Swiften/3rdParty
+	rsync -a 3rdParty/Boost/boost $(DESTDIR)$(includedir)/Swiften/3rdParty/Boost
+	for header in $(SWIFTEN_HEADERS); do headerdir=$(includedir)/`dirname $$header`; echo $$header install -d $(DESTDIR)$$headerdir; install $$header $(DESTDIR)$$headerdir; done
+	install $(SWIFTEN_TARGET) $(DESTDIR)$(libdir)
 
 include Swiften/QA/Makefile.inc
 include Swiften/Examples/Makefile.inc
-- 
cgit v0.10.2-6-g49f6