File: Manager

package info (click to toggle)
whizzytex 1.3.0-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,132 kB
  • ctags: 472
  • sloc: lisp: 3,297; sh: 1,522; makefile: 259
file content (109 lines) | stat: -rw-r--r-- 2,891 bytes parent folder | download
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
ORIGIN=1.3.0 
VERSION=$(ORIGIN)

# Url of sources
URL=http://pauillac.inria.fr/whizzytex

# Command to retreive new versions
WGET=wget --cache off --timestamping

# Short-cut variables
WHIZZY=whizzytex
ODIR=$(WHIZZY)-$(ORIGIN)
VDIR=$(WHIZZY)-$(VERSION)
OTAR=$(ODIR).tgz
VTAR=$(VDIR).tgz
OFILE=$(ODIR)/VERSION
VFILE=$(WHIZZY).version
OTAG=$(ODIR)/.VERSION_$(ORIGIN)
VTAG=$(VDIR)/.VERSION_$(VERSION)

# Command to recursively call itself
MANAGER=whizzytex/Manager
REMAKE=$(MAKE) -f $(MANAGER)


help: link
	@echo 'Usage: '; echo
	@echo '  $(REMAKE) upgrade    # to build the most recent version'
	@echo '  $(REMAKE) xxx        # to build the experimental version'
	@echo '  $(REMAKE) download   # to retreive version <version>'
	@echo '  $(REMAKE) downgrade  # to rebuild  version <version>'
	@echo; echo 'Then, most likely as superuser: '; echo
	@echo '  umask 022  '          
	@echo '  $(REMAKE) uninstall  # if a previously version was installed'
	@echo '  $(REMAKE) install '
	@echo; echo 'Finally: '; echo
	@echo '  $(REMAKE) clean'

.PHONY: link
link:
	@if ! test -e whizzytex; then \
	  echo 'Creating the link whizzytex to current version $(ODIR)'; \
	  ln -s $(ODIR) $(WHIZZY); \
	elif ! test -L whizzytex; then echo \
	  'whizzytex exists but is not a symbolic link to current version'; \
	  false; \
	elif ! test -f $(MANAGER); then \
	  echo 'Strangely, $(MANAGER) does not exists'; false; \
	fi

.PHONY: $(VFILE)
$(VFILE):
	$(WGET) $(URL)/$@

$(VTAR): 
	$(WGET) $(URL)/$(VTAR)
$(VTAG): $(VTAR) 
	cd whizzytex; make clean
	gunzip -c $(VTAR) | tar -xvf -
	touch -r $(VTAR) $(VTAG)
	if test ! -f $(VDIR)/Makefile.config \
	        -o $(WHIZZY)/Makefile -ef $(VDIR)/Makefile && \
	   test "`head -1 $(WHIZZY)/Makefile.config`" \
	     != "`head -1 $(VDIR)/Makefile.config.in`"; \
	then \
	  echo 'WARNING: Configuration has changed. Running ./configure...'; \
	  cd $(VDIR); ./configure; \
	elif test ! $(WHIZZY)/Makefile.config -ef $(VDIR)/Makefile.config; \
	then \
	    echo 'Copying old configuration to Makefile.config;'; \
	    echo 'You need to check Makefile.config or reconfigure;'; \
	    cp $(WHIZZY)/Makefile.config $(VDIR)/Makefile.config; \
	fi
	rm -f $(WHIZZY)
	ln -s $(VDIR) $(WHIZZY)

show-versions: $(VFILE) $(OFILE) 
	@echo "Running version `cat $(OFILE)` ---`stat $(OFILE)|grep Modify:`"
	@echo "Current version `cat $(VFILE)` ---`stat $(VFILE)|grep Modify:`"
	
upgrade: link $(VFILE)
	$(REMAKE) VERSION=`cat $(VFILE)` ORIGIN=`cat $(OFILE)` \
	   download downgrade 

download: 
	$(WGET) $(URL)/$(VTAR)

downgrade: $(VTAG) build

build:
	cd whizzytex; make all

install:
	cd whizzytex; make install

uninstall:
	cd whizzytex; make uninstall

clean:
	cd whizzytex; make clean

xxx:
	$(REMAKE) VERSION=xxx download downgrade

.PHONY: help whizzytex-version show-versions
.PHONY: upgrade download update download unpack version repack 
.PHONY: build install clean