git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Install tools with "make install-tools".

From
Junio C Hamano <junkio@cox.net>
Date
Jul 23, 2005, 02:09 UTC
Message-ID
<7vll3y6zov.fsf@assigned-by-dhcp.cox.net>

Match the main Makefile by separating COPTS from CFLAGS, defining INSTALL, prefix, and bin. Add a new target 'install-tools' to the main Makefile to install them.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 Makefile       |    4 ++++
 tools/Makefile |   13 +++++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)
b0189708a35914c504e7bfa8914d1f5ff029a3a4
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -195,12 +195,16 @@ test: all
 doc:
 	$(MAKE) -C Documentation all
 
+install-tools:
+	$(MAKE) -C tools install
+
 install-doc:
 	$(MAKE) -C Documentation install
 
 clean:
 	rm -f *.o mozilla-sha1/*.o ppc/*.o $(PROG) $(LIB_FILE)
 	rm -f git-core-*.tar.gz git-core.spec
+	$(MAKE) -C tools/ clean
 	$(MAKE) -C Documentation/ clean
 
 backup: clean
diff --git a/tools/Makefile b/tools/Makefile
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -1,6 +1,14 @@
+#
+# Make Linus git-tools
+#
 CC=gcc
-CFLAGS=-Wall -O2
+COPTS=-O2
+CFLAGS=-g $(COPTS) -Wall
+INSTALL=install
 HOME=$(shell echo $$HOME)
+prefix=$(HOME)
+bin=$(prefix)/bin
+# dest=
 
 PROGRAMS=mailsplit mailinfo
 SCRIPTS=applymbox applypatch
@@ -8,7 +16,8 @@ SCRIPTS=applymbox applypatch
 all: $(PROGRAMS)
 
 install: $(PROGRAMS) $(SCRIPTS)
-	cp -f $(PROGRAMS) $(SCRIPTS) $(HOME)/bin/
+	$(INSTALL) -m755 -d $(dest)$(bin)
+	$(INSTALL) $(PROGRAMS) $(SCRIPTS) $(dest)$(bin)
 
 clean:
 	rm -f $(PROGRAMS) *.o
Message 1 of 1 in “Install tools with "make install-tools".”
  1. Install tools with "make install-tools".Junio C Hamano, Jul 23, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.