From 073cf999c0f167478f5c7d302e1e02ea6187e611 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 7 Mar 2008 23:59:34 +0100 Subject: Use make macro for module installation. (This used to be commit 45d252fd9b3df4f1221a23cece78b673a55dfc7c) --- source4/build/make/rules.mk | 11 +++++++++++ source4/build/smb_build/makefile.pm | 8 +------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/source4/build/make/rules.mk b/source4/build/make/rules.mk index bce30ffc06..6bb9247df8 100644 --- a/source4/build/make/rules.mk +++ b/source4/build/make/rules.mk @@ -152,6 +152,17 @@ installplugins:: endef +define shared_module_install_template +installplugins:: bin/modules/$(1)/$(2) + @echo Installing$(2) as $$(DESTDIR)$$(modulesdir)/$(1)/$(2) + @mkdir -p $$(DESTDIR)$$(modulesdir)/$(1)/ + @cp bin/modules/$(1)/$(2) $$(DESTDIR)$$(modulesdir)/$(1)/$(2) +uninstallplugins:: + @echo Uninstalling $$(DESTDIR)$$(modulesdir)/$(1)/$(2) + @-rm $$(DESTDIR)$$(modulesdir)/$(1)/$(2) + +endef + ############################################################################### # File types ############################################################################### diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index bff307d775..6d879ff02b 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -122,13 +122,7 @@ sub SharedModule($$) $sane_subsystem =~ s/^lib//; $self->output("PLUGINS += $ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}\n"); - $self->output("installplugins:: $ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}\n"); - $self->output("\t\@echo Installing $ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME} as \$(DESTDIR)\$(modulesdir)/$sane_subsystem/$ctx->{LIBRARY_REALNAME}\n"); - $self->output("\t\@mkdir -p \$(DESTDIR)\$(modulesdir)/$sane_subsystem/\n"); - $self->output("\t\@cp $ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME} \$(DESTDIR)\$(modulesdir)/$sane_subsystem/$ctx->{LIBRARY_REALNAME}\n"); - $self->output("uninstallplugins::\n"); - $self->output("\t\@echo Uninstalling \$(DESTDIR)\$(modulesdir)/$sane_subsystem/$ctx->{LIBRARY_REALNAME}\n"); - $self->output("\t\@-rm \$(DESTDIR)\$(modulesdir)/$sane_subsystem/$ctx->{LIBRARY_REALNAME}\n"); + $self->output("\$(eval \$(call shared_module_install_template,$sane_subsystem, $ctx->{LIBRARY_REALNAME}))\n"); $self->output("$ctx->{NAME}_OUTPUT = $ctx->{OUTPUT}\n"); $self->_prepare_list($ctx, "FULL_OBJ_LIST"); -- cgit