-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (31 loc) · 1.05 KB
/
Copy pathMakefile
File metadata and controls
42 lines (31 loc) · 1.05 KB
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
# Makefile para el intérprete de REC
PANDOC := $(shell pandoc -v 2> /dev/null)
FUENTES := $(shell find . -type f -name '*.hs' -or -name '*.lhs')
.PHONY: info clean clean-doc doc
# Compilar con GCH
make:
ghc -O Main.lhs -fno-warn-tabs -o rec
# Eliminar tabulaciones en los archivos fuente
destab:
$(foreach f, ${FUENTES}, expand ${f} > ${f}.expanded; mv ${f}.expanded ${f};)
# Generar la documentación a nivel de código (con Haddock)
doc:
haddock -h --optghc=-fno-warn-tabs -o doc/ref Main.lhs -t "Ecuaciones recursivas - Lenguaje Rec"
# Generar la documentación adjunta
ifdef PANDOC
info: Main.htm doc/manual.es.htm doc/manual.en.htm doc/manual.fr.htm
else
info:
$(error Se necesita Pandoc para generar la documentación)
endif
%.htm: %.md
pandoc --from=markdown -s --to=html5 $< -o $@
%.htm: %.lhs
pandoc --from=markdown+lhs -s --to=html5 $< -o $@
# Borrar archivos intermedios generados por GHC
clean:
$(RM) REC/*.hi EDA/*.hi REC/*.o EDA/*.o Main.hi Main.o
# Borra la documentación generada
clean-doc:
$(RM) -r doc/ref
$(RM) Main.htm doc/*.htm