chiark / gitweb /
build system: debian/copyright file
[chiark-tcl-applet.git] / Makefile
index 05911432b1d51e7c43e465222609425fe11acd79..603b24ea623f859d99633ca19af3bebd9285f122 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,8 @@
 
+# Copyright 2016,2020 Ian Jackson
+# SPDX-License-Identifier: GPL-3.0-or-later
+# There is NO WARRANTY.
+
 INSTALL ?= install
 INSTALL_SCRIPT ?= $(INSTALL) -m 755
 
@@ -12,11 +16,21 @@ sharedir=$(prefix)/share/$p
 SCRIPTS += xbatmon-simple-tray
 TCLLIBS += $(addsuffix .tcl, applet args subproc utils)
 
-all:
+SEDDED_SCRIPTS= $(addprefix tmp/, $(SCRIPTS))
+
+all:   $(SEDDED_SCRIPTS)
+
+tmp:
+       mkdir -p tmp
+
+tmp/%: % tmp
+       sed '1,/^source/ s#^set lib \.#set lib $(sharedir)#' $* >$@
+       chmod +x $@
 
-install:
+install: all
        $(INSTALL) -d $(addprefix $(DESTDIR), $(bindir) $(sharedir))
-       $(INSTALL_SCRIPT) $(SCRIPTS) $(DESTDIR)$(bindir)
+       $(INSTALL_SCRIPT) $(SEDDED_SCRIPTS) $(DESTDIR)$(bindir)
        $(INSTALL) $(TCLLIBS) $(DESTDIR)$(sharedir)
 
 clean:
+       rm -rf tmp