diff options
Diffstat (limited to 'source4/build/make')
-rw-r--r-- | source4/build/make/rules.mk | 2 | ||||
-rw-r--r-- | source4/build/make/templates.mk | 42 |
2 files changed, 42 insertions, 2 deletions
diff --git a/source4/build/make/rules.mk b/source4/build/make/rules.mk index 27a214459a..f8df8f0b53 100644 --- a/source4/build/make/rules.mk +++ b/source4/build/make/rules.mk @@ -43,8 +43,6 @@ clean:: clean_pch @-find . -name '*.o' -exec rm -f '{}' \; @echo Removing hostcc objects @-find . -name '*.ho' -exec rm -f '{}' \; - @echo Removing binaries - @-rm -f $(BIN_PROGS) $(SBIN_PROGS) $(BINARIES) $(TORTURE_PROGS) @echo Removing libraries @-rm -f $(STATIC_LIBS) $(SHARED_LIBS) @-rm -f bin/static/*.a bin/shared/*.$(SHLIBEXT) bin/mergedobj/*.o diff --git a/source4/build/make/templates.mk b/source4/build/make/templates.mk index 25bdde09b4..eb6b584af2 100644 --- a/source4/build/make/templates.mk +++ b/source4/build/make/templates.mk @@ -22,6 +22,12 @@ define binary_link_template $(1): $(2) ; @echo Linking $$@ @$$(BNLD) $$(BNLD_FLAGS) $$(INTERN_LDFLAGS) -o $$@ $$(INSTALL_LINK_FLAGS) $(3) + +clean:: + @rm -f $(1) + +binaries:: $(1) + endef # Link a host-machine binary @@ -30,6 +36,12 @@ define host_binary_link_template $(1): $(2) ; @echo Linking $$@ @$$(HOSTLD) $$(HOSTLD_FLAGS) -L$${builddir}/bin/static -o $$@ $$(INSTALL_LINK_FLAGS) $(3) + +clean:: + rm -f $(1) + +binaries:: $(1) + endef # Create a prototype header @@ -109,3 +121,33 @@ endef # abspath for older makes abspath := $(shell cd $(1); pwd) + +define binary_install_template +inst@allbin:: $(1) installdirs + @mkdir -p $$(DESTDIR)$$(bindir) + @$$(SHELL) $$(srcdir)/script/installbin.sh \ + $$(INSTALLPERMS) \ + $$(DESTDIR)$$(BASEDIR) \ + $$(DESTDIR)$$(bindir) \ + $$(DESTDIR)$$(libdir) \ + $$(DESTDIR)$$(localstatedir) \ + $$< + +uninstallbin:: + @rm -f $$(DESTDIR)$$(bindir)/$(1) +endef + +define sbinary_install_template +installsbin:: $(1) installdirs + @mkdir -p $$(DESTDIR)$$(sbindir) + @$$(SHELL) $$(srcdir)/script/installbin.sh \ + $$(INSTALLPERMS) \ + $$(DESTDIR)$$(BASEDIR) \ + $$(DESTDIR)$$(sbindir) \ + $$(DESTDIR)$$(libdir) \ + $$(DESTDIR)$$(localstatedir) \ + $$< + +uninstallsbin:: + @rm -f $$(DESTDIR)$$(sbindir)/$(1) +endef |