summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/build/make/rules.mk11
-rw-r--r--source4/build/smb_build/makefile.pm8
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");