-build.opt: $(MAS)
- $(H)echo Legacy-2/theory.ma `$(BIN)matitadep.opt -stdout Legacy-2/theory.ma` >> depends
-# $(H)echo Base-2/theory.ma `$(BIN)matitadep.opt -stdout Base-2/theory.ma` >> depends
- $(H)$(BIN)matitac.opt $(MATITAOPTIONS) 2> /dev/null
- $(H)rm depends
+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)
+ $(H)$(BIN)matitac.opt $(MATITAOPTIONS) 2>> $(LOG)
+ $(H)$(RM) depends