threads / patch / 143

patchMakefile uses installed commit-id

Subject: [PATCH] Makefile uses installed commit-id

## tl;dr

One message between Apr 19, 2005 and Apr 19, 2005. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Pavel Roskin· Apr 19, 2005, 17:28 UTC · lore
Hello!

Current git-pasky cannot be compiled properly unless it's already installed. The rule for creating gitversion.sh requires commit-id in the PATH, which won't be there until "make install" is run.

Also, commit-id runs gitXnormid.sh, which in turn runs cat-file. All of them should be from the current directory to avoid the requirement that git is installed before gitversion.sh is generated.

This patch adds "." to PATH when running commit-id. The patch is against current git-pasky.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Show changes to Makefile +2 −2
--- a/Makefile
+++ b/Makefile
@@ -46,11 +46,11 @@ $(LIB_FILE): $(LIB_OBJS)
 
 %.o: $(LIB_H)
 
-gitversion.sh: $(VERSION)
+gitversion.sh: $(VERSION) commit-id
 	@echo Generating gitversion.sh...
 	@rm -f $@
 	@echo "#!/bin/sh" > $@
-	@echo "echo \"$(shell cat $(VERSION)) ($(shell commit-id))\"" >> $@
+	@echo "echo \"$(shell cat $(VERSION)) ($(shell PATH=.:$$PATH ./commit-id))\"" >> $@
 	@chmod +x $@
 
 install: $(PROG) $(GEN_SCRIPT)
-- 
Regards,
Pavel Roskin

← back to recent threads