]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/contribs/LAMBDA-TYPES/Makefile
librarian: retrieval of buildable files speeded up a lot
[helm.git] / helm / software / matita / contribs / LAMBDA-TYPES / Makefile
1 include ../Makefile.defs
2
3 H=@
4 S=-s
5
6 MATITAOPTIONS=$(MATITAUSEROPTIONS) -onepass
7
8 LOG = log.txt
9
10 DIRS = Legacy-2 Base-2 LambdaDelta-2
11
12 SILENTMAKE = $(H)$(MAKE) $(S) --no-print-directory H=$(H) S=$(S)
13
14 MAS = $(shell find $(DIRS) -mindepth 2 -name "*.ma")
15
16 all: depends
17         $(H)$(RM) $(LOG)
18         $(SILENTMAKE) build
19
20 opt all.opt: depends
21         $(H)$(RM) $(LOG)
22         $(SILENTMAKE) build.opt
23
24 %.build.opt:
25         $(SILENTMAKE) $(patsubst %.mma, %.ma, $(shell find $* -name "*.mma"))
26         $(H)echo $*/theory.ma `$(BIN)matitadep.opt -stdout $*/theory.ma` >> depends
27
28 build: $(DIRS:%=%.build.opt)
29         $(H)$(BIN)matitac $(MATITAOPTIONS) 2>> $(LOG)
30         $(H)$(RM) depends
31
32 build.opt: $(DIRS:%=%.build.opt)
33         $(H)$(BIN)matitac.opt $(MATITAOPTIONS) 2>> $(LOG)
34         $(H)$(RM) depends
35
36 clean:
37         $(H)$(BIN)matitaclean $(MATITAOPTIONS)
38         $(H)rm -f $(MAS) depends
39
40 clean.opt:
41         $(H)$(BIN)matitaclean.opt $(MATITAOPTIONS)
42         $(H)rm -f $(MAS) depends
43
44 clean.ma:
45         $(H)$(BIN)matitaclean.opt $(MATITAOPTIONS) $(MAS)
46         $(H)$(RM) $(MAS) depends
47
48 clean.mma:
49 #       $(H)for FILE in */*.mma ; do if [ -e ../LambdaDelta-1/$${FILE/.mma/.ma} ] ; then true ; else rm $$FILE ; fi done
50
51 depend:
52         @echo matitadep
53         $(H)$(BIN)matitadep $(foreach DIR, $(DIRS), -exclude $(DIR)/theory.ma)
54         $(H)cat $(DIRS:%=%/depends) >> depends
55
56 depend.opt:
57         @echo matitadep.opt
58         $(H)$(BIN)matitadep.opt $(foreach DIR, $(DIRS), -exclude $(DIR)/theory.ma)
59         $(H)cat $(DIRS:%=%/depends) >> depends
60
61 depends: depend.opt
62
63 %.ma: %.mma
64         $(H)$(BIN)matitac.opt $(MATITAOPTIONS) $(word 3,$(shell grep -h $< */depends)) `$(BIN)matitadep.opt -stdout $<` 2>> $(LOG)
65         $(H)$(BIN)matitac.opt $(MATITAOPTIONS) -dump $@ $< 2>> $(LOG)
66         $(H)echo $@ `$(BIN)matitadep.opt -stdout $@` >> depends
67
68 $(foreach DIR, $(DIRS), $(eval include $(DIR)/.depend))