]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/Makefile
tentative fix
[helm.git] / matita / Makefile
index 97158f9dd566a7c997380b51dd162f60978f58d4..e13b2d657deb13511e840755b47dcd872af9ced8 100644 (file)
@@ -41,7 +41,6 @@ MLI = \
        matitaScript.mli        \
        matitaMathView.mli      \
        matitaGui.mli           \
-       matitaAutoGui.cmo               \
        $(NULL)
 CMLI =                         \
        matitaTypes.mli         \
@@ -62,7 +61,7 @@ MAINCMLI =                    \
        gragrep.mli             \
        $(NULL)
 # objects for matita (GTK GUI)
-ML = buildTimeConf.ml matitaGeneratedGui.ml $(MLI:%.mli=%.ml)
+ML = buildTimeConf.ml matitaGeneratedGui.ml matitaAutoGui.ml $(MLI:%.mli=%.ml)
 # objects for matitac (batch compiler)
 CML = buildTimeConf.ml $(CMLI:%.mli=%.ml)
 MAINCML = $(MAINCMLI:%.mli=%.ml)
@@ -84,17 +83,8 @@ MAINCMOS = $(MAINCML:%.ml=%.cmo)
 CMXS = $(patsubst %.cmo,%.cmx,$(CMOS))
 CCMXS = $(patsubst %.cmo,%.cmx,$(CCMOS))
 MAINCMXS = $(patsubst %.cmo,%.cmx,$(MAINCMOS))
-$(CMOS): $(LIB_DEPS)
+$(CMOS) : $(LIB_DEPS)
 $(CMXOS): $(LIBX_DEPS)
-ifeq ($(MAKECMDGOALS),all)
-   $(CMOS:%.cmo=%.cmi): $(LIB_DEPS)
-endif
-ifeq ($(MAKECMDGOALS),)
-   $(CMOS:%.cmo=%.cmi): $(LIB_DEPS)
-endif
-ifeq ($(MAKECMDGOALS),opt)
-   $(CMOS:%.cmo=%.cmi): $(LIBX_DEPS)
-endif
 
 LIB_DEPS := $(shell $(OCAMLFIND) query -recursive -predicates "byte" -format "%d/%a" $(MATITA_REQUIRES))
 LIBX_DEPS := $(shell $(OCAMLFIND) query -recursive -predicates "native" -format "%d/%a" $(MATITA_REQUIRES))
@@ -408,21 +398,31 @@ depend.opt:
        $(H)echo "  OCAMLDEP -native"
        $(H)$(OCAMLDEP) -native *.ml *.mli > .depend.opt
 
-ifeq ($(MAKECMDGOALS),)
-  include .depend   
-endif
-
-ifeq ($(MAKECMDGOALS), all)
-  include .depend   
+# this should be sligtly better, since should work with 'make all opt'
+ifneq (,$(findstring all,$(MAKECMDGOALS)))
+  # if we 'make all opt' the deps for 'all' should be fine also for opt
+       # if we 'make opt all' it should not work...
+  TO_INCLUDE+=.depend
+  TO_DEPEND_ON=$(LIB_DEPS)
+else ifneq (,$(findstring opt,$(MAKECMDGOALS)))
+  TO_INCLUDE+=.depend.opt
+  TO_DEPEND_ON=$(LIBX_DEPS)
+else ifneq (,$(findstring world,$(MAKECMDGOALS)))
+  ifeq ($(HAVE_OCAMLOPT),yes)
+    TO_INCLUDE+=.depend.opt
+    TO_DEPEND_ON=$(LIBX_DEPS)
+  else
+    TO_INCLUDE+=.depend
+    TO_DEPEND_ON=$(LIB_DEPS)
+  endif
+else
+  TO_INCLUDE+=.depend
+  TO_DEPEND_ON=$(LIB_DEPS)
 endif
 
-ifeq ($(MAKECMDGOALS), opt)
-  include .depend.opt   
-endif
+$(MLI:%.mli=%.cmi) $(ML:%.ml=%.cmo) $(ML:%.ml=%.cmx): $(TO_DEPEND_ON)
 
-ifeq ($(MAKECMDGOALS), world)
-  include .depend.opt   
-endif
+include $(TO_INCLUDE)
 
 %.cmi: %.mli
        $(H)echo "  OCAMLC $<"