chiark / gitweb /
TopGit: small Makefile nitpichink
authorAntonio Ospite <ospite@studenti.unina.it>
Fri, 24 Oct 2008 10:54:24 +0000 (12:54 +0200)
committerPetr Baudis <pasky@suse.cz>
Fri, 7 Nov 2008 21:24:03 +0000 (22:24 +0100)
Make 'prefix' replacement more explicit using ?=

Use simple substitution assignment := when there are some expansions in
place.  This is a good practice to speed up builds, maybe not particularly
useful with such a simple Makefile.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Makefile

index 2c627afbaab085c72f58257399edca8da4d77fb5..3ce39a5633f4a7bab6b3835f6169d1b23e78cefd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,16 +1,16 @@
-prefix = $(HOME)
-bindir = $(prefix)/bin
-cmddir = $(prefix)/libexec/topgit
-sharedir = $(prefix)/share/topgit
-hooksdir = $(cmddir)/hooks
+prefix ?= $(HOME)
+bindir := $(prefix)/bin
+cmddir := $(prefix)/libexec/topgit
+sharedir := $(prefix)/share/topgit
+hooksdir := $(cmddir)/hooks
 
 
-commands_in = $(wildcard tg-*.sh)
+commands_in := $(wildcard tg-*.sh)
 hooks_in = hooks/pre-commit.sh
 
-commands_out = $(patsubst %.sh,%,$(commands_in))
-hooks_out = $(patsubst %.sh,%,$(hooks_in))
-help_out = $(patsubst %.sh,%.txt,$(commands_in))
+commands_out := $(patsubst %.sh,%,$(commands_in))
+hooks_out := $(patsubst %.sh,%,$(hooks_in))
+help_out := $(patsubst %.sh,%.txt,$(commands_in))
 
 all::  tg $(commands_out) $(hooks_out) $(help_out)