File: Makefile

package info (click to toggle)
stex 1.2.1%2Bgit20171204.g5e4f0ca-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 604 kB
  • sloc: makefile: 108; sh: 61
file content (58 lines) | stat: -rw-r--r-- 2,470 bytes parent folder | download | duplicates (4)
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
50
51
52
53
54
55
56
57
58
VERSION=1.2

# override PREFIX, Scheme, and LIB as necessary
PREFIX=/usr

# scheme executable
Scheme=$(PREFIX)/bin/scheme

# target location for stex
LIB=$(PREFIX)/lib/stex$(VERSION)

m := $(shell echo '(machine-type)' | $(Scheme) -q)

Install=./sbin/install

exec = $m/scheme-prep $m/html-prep $m/fixbibtex

all: $(exec)

$m/scheme-prep: src/dsm.ss src/preplib.ss src/script.ss src/scheme-prep.ss
	if [ ! -d $m ] ; then mkdir $m ; fi
	sed -e 's;^#! /usr/bin/scheme --program;#! $(Scheme) --program;' src/scheme-prep.ss > $m/scheme-prep.ss
	echo '(reset-handler abort) (library-directories (quote "src::$m")) (compile-imported-libraries #t) (generate-wpo-files #t) (compile-program "$m/scheme-prep.ss") (compile-whole-program "$m/scheme-prep.wpo" "$m/scheme-prep")' | $(Scheme) -q
	chmod 755 $m/scheme-prep

$m/html-prep: src/dsm.ss src/preplib.ss src/script.ss src/html-prep.ss
	if [ ! -d $m ] ; then mkdir $m ; fi
	sed -e 's;^#! /usr/bin/scheme --program;#! $(Scheme) --program;' src/html-prep.ss > $m/html-prep.ss
	echo '(reset-handler abort) (library-directories (quote "src::$m")) (compile-imported-libraries #t) (generate-wpo-files #t) (compile-program "$m/html-prep.ss") (compile-whole-program "$m/html-prep.wpo" "$m/html-prep")' | $(Scheme) -q
	chmod 755 $m/html-prep

$m/fixbibtex: src/fixbibtex.ss
	-if [ ! -d $m ] ; then mkdir $m ; fi
	sed -e 's;^#! /usr/bin/scheme --program;#! $(Scheme) --program;' src/fixbibtex.ss > $m/fixbibtex.ss
	echo '(reset-handler abort) (library-directories (quote "src::$m")) (compile-imported-libraries #t) (generate-wpo-files #t) (compile-program "$m/fixbibtex.ss") (compile-whole-program "$m/fixbibtex.wpo" "$m/fixbibtex")' | $(Scheme) -q
	chmod 755 $m/fixbibtex

install: $(exec)
	$(Install) -o root -g root -m 755 -d $(LIB)
	$(Install) -o root -g root -m 755 -d $(LIB)/inputs
	$(Install) -o root -g root -m 644 inputs/* $(LIB)/inputs
	$(Install) -o root -g root -m 755 -d $(LIB)/gifs
	$(Install) -o root -g root -m 644 gifs/* $(LIB)/gifs
	$(Install) -o root -g root -m 755 -d $(LIB)/math
	$(Install) -o root -g root -m 644 math/* $(LIB)/math
	$(Install) -o root -g root -m 755 -d $(LIB)/$m
	$(Install) -o root -g root -m 644 $(exec) $(LIB)/$m
	(umask 022; sed -e 's;^LIB=.*;LIB=$(LIB);' Mf-stex > $(LIB)/Mf-stex)
	(umask 022; sed -e 's;include ~/stex/Mf-stex;include $(LIB)/Mf-stex;' Makefile.template > $(LIB)/Makefile.template)

uninstall:
	/bin/rm -rf $(LIB)

clean:
	/bin/rm -f Make.out

distclean: clean
	/bin/rm -rf $m