include ../Makefile.defs
+DIR=$(shell basename $$PWD)
+
H=@
MATITAOPTIONS=$(MATITAUSEROPTIONS) -onepass
LOG = log.txt
-DIRS = Legacy-2 Base-2 LambdaDelta-2
-
-SILENTMAKE = $(H)$(MAKE) H=$(H) -s --no-print-directory
+MMAS = $(shell find -name "*.mma")
+MAS = $(MMAS:%.mma=%.ma)
-MAS = $(patsubst %.mma, %.ma, $(shell find $(DIRS) -name "*.mma"))
-
-all: depends
+$(DIR) all:
$(H)$(RM) $(LOG)
- $(SILENTMAKE) build
-
-opt all.opt: depends
- $(H)$(RM) $(LOG)
- $(SILENTMAKE) build.opt
-
-%.build.opt:
- $(SILENTMAKE) $(patsubst %.mma, %.ma, $(shell find $* -name "*.mma"))
- $(H)echo $*/theory.ma `$(BIN)matitadep.opt -stdout $*/theory.ma` >> depends
-
-build: $(DIRS:%=%.build.opt)
$(H)$(BIN)matitac $(MATITAOPTIONS) 2>> $(LOG)
- $(H)$(RM) depends
-
-build.opt: $(DIRS:%=%.build.opt)
+$(DIR).opt opt all.opt:
+ $(H)$(RM) $(LOG)
$(H)$(BIN)matitac.opt $(MATITAOPTIONS) 2>> $(LOG)
- $(H)$(RM) depends
+
+%.ma %.mma:
+ $(H)$(RM) $(LOG)
+ $(H)$(BIN)matitac $(MATITAOPTIONS) $@ 2>> $(LOG)
+%.ma.opt:
+ $(H)$(RM) $(LOG)
+ $(H)$(BIN)matitac.opt $(MATITAOPTIONS) $*.ma 2>> $(LOG)
+%.mma.opt:
+ $(H)$(RM) $(LOG)
+ $(H)$(BIN)matitac.opt $(MATITAOPTIONS) $*.mma 2>> $(LOG)
clean:
$(H)$(BIN)matitaclean $(MATITAOPTIONS)
- $(H)rm -f $(MAS) depends
-
+ $(H)$(RM) $(MAS)
clean.opt:
$(H)$(BIN)matitaclean.opt $(MATITAOPTIONS)
- $(H)rm -f $(MAS) depends
-
-clean.ma:
- $(H)$(BIN)matitaclean.opt $(MATITAOPTIONS) $(MAS)
- $(H)$(RM) $(MAS) depends
-
-
-clean.mma:
-# $(H)for FILE in */*.mma ; do if [ -e ../LambdaDelta-1/$${FILE/.mma/.ma} ] ; then true ; else rm $$FILE ; fi done
+ $(H)$(RM) $(MAS)
depend:
- @echo matitadep
- $(H)$(BIN)matitadep $(foreach DIR, $(DIRS), -exclude $(DIR)/theory.ma)
- $(H)cat $(DIRS:%=%/depends) >> depends
-
+ $$(H)(BIN)matitadep $(MATITAOPTIONS)
depend.opt:
- @echo matitadep.opt
- $(H)$(BIN)matitadep.opt $(foreach DIR, $(DIRS), -exclude $(DIR)/theory.ma)
- $(H)cat $(DIRS:%=%/depends) >> depends
-
-depends: depend.opt
-
-%.ma: %.mma
- $(H)$(BIN)matitac.opt $(MATITAOPTIONS) $(word 3,$(shell grep -h $< */depends)) `$(BIN)matitadep.opt -stdout $<` 2>> $(LOG)
- $(H)$(BIN)matitac.opt $(MATITAOPTIONS) -dump $@ $< 2>> $(LOG)
- $(H)echo $@ `$(BIN)matitadep.opt -stdout $@` >> depends
+ $(H)$(BIN)matitadep.opt $(MATITAOPTIONS)
-$(foreach DIR, $(DIRS), $(eval include $(DIR)/.depend))
+ifneq ($(strip $(MAS)),)
+clean.ma:
+ $(H)$(BIN)matitaclean.opt $(MATITAOPTIONS) $(MAS)
+ $(H)$(RM) $(MAS)
+else
+clean.ma:
+ $(H)echo no files to clean
+endif