summaryrefslogtreecommitdiff
path: root/source4/Makefile
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-06-26 11:51:22 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-06-26 11:51:22 +0200
commitd4172dac2c122bc2cf5f419d5687168468a9a141 (patch)
tree7ac493c04fd720da9c3a83d93f43bb4cf2272ff5 /source4/Makefile
parent0507e03c5260dc6a1e634dffd54931beaa32b870 (diff)
downloadsamba-d4172dac2c122bc2cf5f419d5687168468a9a141.tar.gz
samba-d4172dac2c122bc2cf5f419d5687168468a9a141.tar.bz2
samba-d4172dac2c122bc2cf5f419d5687168468a9a141.zip
Use make magic for installing/uninstalling binaries.
(This used to be commit 97b724417fc8110f7c591779b0c17bd072be304f)
Diffstat (limited to 'source4/Makefile')
-rw-r--r--source4/Makefile14
1 files changed, 14 insertions, 0 deletions
diff --git a/source4/Makefile b/source4/Makefile
index 1a1a56fc63..3c2efe35af 100644
--- a/source4/Makefile
+++ b/source4/Makefile
@@ -246,6 +246,20 @@ uninstall:: uninstallbin uninstallman uninstallmisc uninstalllib uninstallheader
uninstallmisc::
#FIXME
+$(DESTDIR)$(bindir)/%: bin/% installdirs
+ @mkdir -p $(@D)
+ @echo Installing $(@F) as $@
+ @if test -f $@; then; rm -f $@.old; mv $@ $@.old; fi
+ @cp $< $@
+ @chmod $(INSTALLPERMS) $@
+
+$(DESTDIR)$(sbindir)/%: bin/% installdirs
+ @mkdir -p $(@D)
+ @echo Installing $(@F) as $@
+ @if test -f $@; then; rm -f $@.old; mv $@ $@.old; fi
+ @cp $< $@
+ @chmod $(INSTALLPERMS) $@
+
uninstallbin::
@$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(sbindir) $(DESTDIR)$(libdir) $(DESTDIR)$(localstatedir) $(DESTDIR)$(SBIN_PROGS)
@$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) $(DESTDIR)$(localstatedir) $(DESTDIR)$(BIN_PROGS)