-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (43 loc) · 1.26 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
.PHONY: all clean install tags
# order matters, at least db-basic-ilf-rest
TCLFILES=\
tcllib/entry.tcl \
tcllib/db.tcl \
tcllib/basic.tcl \
tcllib/ilf.tcl \
tcllib/control.tcl \
tcllib/csv.tcl \
tcllib/gui.tcl \
tcllib/bibtex.tcl \
tcllib/html.tcl \
tcllib/memo.tcl \
tcllib/nlm.tcl \
tcllib/rtf.tcl \
tcllib/tex.tcl
TODAY=`date +"%Y-%m-%d"`
BASETCLFILES=$(TCLFILES:tcllib/%=%)
all: tcllib/pkgIndex.tcl tclbib_compressed.tcl
tclbib_compressed.tcl: tclbib.tcl $(TCLFILES)
echo '#!/bin/sh' > $@
echo '# tclbib (c) F.A. Meineke 1997-2004, revised 2024' >> $@
echo '# This file is generated. Do not edit this file!' >> $@
echo '# The next line restarts using wish \\' >> $@
echo 'exec wish "$$0" "$$@"' >> $@
cat $(TCLFILES) tclbib.tcl | sed \
-e 's/^ *//' \
-e 's/\([^[]\) \+/\1 /g' \
-e 's/^ *//' \
-e 's/^#.*//' \
-e 's/;#.*//' \
-e 's/ *$$//' \
-e 's/^lappend auto_path.*//' \
-e 's/^exec wish.*//' \
-e '/^$$/d' \
-e "s/^set version .*/set version \"${TODAY}\"/" >> $@
chmod +x tclbib_compressed.tcl
tcllib/pkgIndex.tcl: $(TCLFILES)
(cd tcllib; echo "pkg_mkIndex . ${BASETCLFILES} "| tclsh)
install: all
cp -u tclbib_compressed.tcl $(HOME)/bin/tclbib.tcl
clean:
rm -f tclbib_compressed.tcl *.il[1-4] tcllib/pkgIndex.tcl