Skip to contentSkip to conversation

Separate install target into exec, udev and man sub-parts.

PATCH In review Jon Loeliger 1 participant 1 message Jun 30, 2009 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 2/5 Separate install target into exec, udev and man sub-parts.

With the separate install sub-parts, the udev install can be optional using the NO_INSTALL_UDEV option now.

---
 Makefile |   23 ++++++++++++++++++-----
 1 files changed, 18 insertions(+), 5 deletions(-)
Makefile +18 -5
index 589c453..8dbdf14 100644
@@ -72,6 +72,9 @@ Q=@
 NQ=@echo
 endif
 
+INSTALL_EXECS	:= crda
+INSTALL_MAN	:= crda.8.gz regdbdump.8.gz
+
 $(REG_BIN):
 	$(NQ) '  EXIST ' $(REG_BIN)
 	$(NQ)
@@ -113,12 +116,19 @@ verify: $(REG_BIN) regdbdump
 	@$(NQ) ' GZIP' $<
 	$(Q)gzip < $< > $@
 
-install: crda crda.8.gz regdbdump.8.gz
-	$(NQ) '  INSTALL  crda'
+
+install: install_execs install_udev install_man
+
+install_execs: $(INSTALL_EXECS)
 	$(Q)$(MKDIR) $(DESTDIR)/$(SBINDIR)
-	$(Q)$(INSTALL) -m 755 -t $(DESTDIR)/$(SBINDIR) crda
-	$(NQ) '  INSTALL  regdbdump'
-	$(Q)$(INSTALL) -m 755 -t $(DESTDIR)/$(SBINDIR) regdbdump
+	$(Q)for exec in $(INSTALL_EXECS) ; do \
+		echo "  INSTALL  $$exec" ; \
+		$(INSTALL) -m 755 -t $(DESTDIR)/$(SBINDIR) $$exec ; \
+		done
+
+.PHONY: install_udev
+install_udev:
+ifndef NO_INSTALL_UDEV
 	$(NQ) '  INSTALL  $(UDEV_LEVEL)regulatory.rules'
 	$(Q)$(MKDIR) $(DESTDIR)/$(UDEV_RULE_DIR)/
 	@# This removes the old rule you may have, we were not
@@ -129,6 +139,9 @@ install: crda crda.8.gz regdbdump.8.gz
 	$(Q)$(INSTALL) -m 644 -t \
 		$(DESTDIR)/$(UDEV_RULE_DIR)/ \
 		udev/$(UDEV_LEVEL)regulatory.rules
+endif
+
+install_man: $(INSTALL_MAN)
 	$(NQ) '  INSTALL  crda.8.gz'
 	$(Q)$(MKDIR) $(DESTDIR)$(MANDIR)/man8/
 	$(Q)$(INSTALL) -m 644 -t $(DESTDIR)/$(MANDIR)/man8/ crda.8.gz
Signature · 1 line
1.6.3.GIT