Skip to content

Commit

Permalink
Dynamically change tclshX.X to install version
Browse files Browse the repository at this point in the history
When performing a `make install` we use sed to edit-in-place the installed
files, amending the bangpath and other references to tclsh to the specific
version found in the TCLSH environment variable.
  • Loading branch information
nugget committed Jul 18, 2014
1 parent efaa5b3 commit 4c7f51a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Makefile
Expand Up @@ -14,7 +14,7 @@ TARGET?= $(LIB)/$(PACKAGE)
UID?= 0
GID?= 0

TCLSH?= tclsh8.6
TCLSH?= tclsh8.5

all:

Expand All @@ -27,6 +27,7 @@ install-package:
@install -o $(UID) -g $(GID) -m 0755 -d $(TARGET)
@echo " Copying $(FILES)"
@install -o $(UID) -g $(GID) -m 0644 $(FILES) $(TARGET)
@sed -i '' -e's/tclsh.\../$(TCLSH)/' $(TARGET)/*
@if test -f config.tcl; then install -o $(UID) -g $(GID) -m 0644 config.tcl $(TARGET); echo " Copying config.tcl"; fi
@echo " Generating pkgIndex.tcl"
@cd $(TARGET) && echo "pkg_mkIndex -- ." | $(TCLSH)
Expand All @@ -38,4 +39,5 @@ make uninstall-package:
install-git-hook:
@echo "Installing fogbugz-git-hook to $(BIN)"
@install -o $(UID) -g $(UID) -m 0755 tools/fogbugz-git-hook $(BIN)/
@sed -i '' -e's/tclsh.\../$(TCLSH)/' $(BIN)/fogbugz-git-hook

0 comments on commit 4c7f51a

Please sign in to comment.