summaryrefslogtreecommitdiffstats
path: root/skeletons/Makefile.lou.erb
blob: bb2cec69fb54e2b26c5ae70224b791168494d9fd (plain)
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

# USER VAR
MAIN=file_name
LOUT_FILES=${MAIN}.lou
#

LOUT_MAIN=${MAIN}.lou
PSNAME=${MAIN}.ps
PDFNAME=${MAIN}.pdf

AWK=gawk
LOUT=lout
PS2PDF=ps2pdf

.SUFFIXES: .lout .lou

all: $(PSNAME) $(PDFNAME)

utf8_lat1:
	@( \
		echo '#! /bin/sh'; \
		echo 'file $$1 | grep UTF-8 >/dev/null'; \
		echo 'if [ $$? -eq 0 ]; then'; \
		echo '  iconv --from utf8 --to iso88591 $$1 > $$(basename $$1 .lou).lat1'; \
		echo 'else'; \
		echo '  cp $$1 $$(basename $$1 .lou).lat1'; \
		echo 'fi'; \
	) > utf8_lat1
	@chmod 755 utf8_lat1

$(PSNAME): utf8_lat1 $(LOUT_FILES)
	$(LOUT) -r3 -o $(PSNAME) $(LOUT_MAIN)

$(PDFNAME): $(PSNAME) 
	$(PS2PDF) $(PSNAME) 

clean:
	@rm *.ps *.ld *.li *.lix *.lat1 *~ utf8_lout utf8_lat1 2>/dev/null