[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-sparse
Subject:    [PATCH]: clean up Makefile long lines
From:       "Christopher Li" <sparse () chrisli ! org>
Date:       2008-12-26 2:27:13
Message-ID: 70318cbf0812251827p2a294b9ar3a64f1d1b418be80 () mail ! gmail ! com
[Download RAW message or body]

On Thu, Dec 25, 2008 at 1:30 AM, Sam Ravnborg <sam@ravnborg.org> wrote:
>
> When you are patching the Makefile then I suggest breaking this line up somehow.
> Should be a follow-up patch.

Here is the follow-up patch.

Chris

["makefile-cleanup.patch.txt" (text/plain)]

Clean up Makefile long lines

Signed-Off-By: Christopher Li<sparse@chrisli.org>

Index: sparse.chrisl/Makefile
===================================================================
--- sparse.chrisl.orig/Makefile
+++ sparse.chrisl/Makefile
@@ -78,6 +78,17 @@ QUIET_LINK    = $(Q:@=@echo    '     LIN
 QUIET_INST_SH = $(Q:@=echo -n  '     INSTALL  ';)
 QUIET_INST    = $(Q:@=@echo -n '     INSTALL  ';)
 
+define INSTALL_CMD
+	$(Q)$(QUIET_INST_SH)install -v $1 $(DESTDIR)$2/$1 || exit 1;
+
+endef
+
+SED_PC_CMD = 's|@version@|$(VERSION)|g;		\
+	      s|@prefix@|$(PREFIX)|g;		\
+	      s|@libdir@|$(LIBDIR)|g;		\
+	      s|@includedir@|$(INCLUDEDIR)|g'
+
+
 all: $(PROGRAMS) sparse.pc
 
 install: $(INST_PROGRAMS) $(LIBS) $(LIB_H) sparse.pc
@@ -86,22 +97,14 @@ install: $(INST_PROGRAMS) $(LIBS) $(LIB_
 	$(Q)install -d $(DESTDIR)$(MAN1DIR)
 	$(Q)install -d $(DESTDIR)$(INCLUDEDIR)/sparse
 	$(Q)install -d $(DESTDIR)$(PKGCONFIGDIR)
-	$(Q)for f in $(INST_PROGRAMS); do \
-		$(QUIET_INST_SH)install -v $$f $(DESTDIR)$(BINDIR)/$$f || exit 1; \
-	done
-	$(Q)for f in $(INST_MAN1); do \
-		$(QUIET_INST_SH)install -m 644 -v $$f $(DESTDIR)$(MAN1DIR)/$$f || exit 1; \
-	done
-	$(Q)for f in $(LIBS); do \
-		$(QUIET_INST_SH)install -m 644 -v $$f $(DESTDIR)$(LIBDIR)/$$f || exit 1; \
-	done
-	$(Q)for f in $(LIB_H); do \
-		$(QUIET_INST_SH)install -m 644 -v $$f $(DESTDIR)$(INCLUDEDIR)/sparse/$$f || exit \
                1; \
-	done
-	$(QUIET_INST)install -m 644 -v sparse.pc $(DESTDIR)$(PKGCONFIGDIR)/sparse.pc
+	$(foreach f,$(INST_PROGRAMS),$(call INSTALL_CMD,$f,$(BINDIR)))
+	$(foreach f,$(INST_MAN1),$(call INSTALL_CMD,$f,$(MAN1DIR)))
+	$(foreach f,$(LIBS),$(call INSTALL_CMD,$f,$(LIBDIR)))
+	$(foreach f,$(LIB_H),$(call INSTALL_CMD,$f,$(INCLUDEDIR)/sparse))
+	$(call INSTALL_CMD,sparse.pc,$(PKGCONFIGDIR))
 
 sparse.pc: sparse.pc.in
-	$(QUIET_GEN)sed 's|@version@|$(VERSION)|g;s|@prefix@|$(PREFIX)|g;s|@libdir@|$(LIBDIR)|g;s|@includedir@|$(INCLUDEDIR)|g' \
sparse.pc.in > sparse.pc +	$(QUIET_GEN)sed $(SED_PC_CMD) sparse.pc.in > sparse.pc
 
 
 compile_EXTRA_DEPS = compile-i386.o


--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic