1. HongboZhang
  2. ocaml

Commits

frisch  committed 3c385db

Reduce diff between Makefile and Makefile.nt, probably removing a few bugs. Generators are still missing for Windows. We should really factorize common parts of such makefiles...

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12601f963ae5c-01c2-4b8c-9fe0-0dff7051ff02

  • Participants
  • Parent commits c628c24
  • Branches master

Comments (0)

Files changed (2)

File ocamldoc/Makefile

View file
 OCAMLDOC_LIBCMA=odoc_info.cma
 OCAMLDOC_LIBCMI=odoc_info.cmi
 OCAMLDOC_LIBCMXA=odoc_info.cmxa
-OCAMLDOC_LIBA=odoc_info.a
+OCAMLDOC_LIBA=odoc_info.$(A)
 INSTALL_LIBDIR=$(OCAMLLIB)/ocamldoc
 INSTALL_CUSTOMDIR=$(INSTALL_LIBDIR)/custom
 INSTALL_BINDIR=$(OCAMLBIN)
 	odoc_texi.cmo \
 	odoc_dot.cmo \
 	odoc_gen.cmo \
-	odoc_args.cmo\
+	odoc_args.cmo \
 	odoc.cmo
 
 EXECMXFILES= $(EXECMOFILES:.cmo=.cmx)
 
 clean:: dummy
 	@rm -f *~ \#*\#
-	@rm -f $(OCAMLDOC) $(OCAMLDOC_OPT) *.cma *.cmxa *.cmo *.cmi *.cmx *.a *.o
+	@rm -f $(OCAMLDOC) $(OCAMLDOC_OPT) *.cma *.cmxa *.cmo *.cmi *.cmx *.$(A) *.$(O)
 	@rm -f odoc_parser.output odoc_text_parser.output
 	@rm -f odoc_lexer.ml odoc_text_lexer.ml odoc_see_lexer.ml odoc_ocamlhtml.ml
 	@rm -f odoc_parser.ml odoc_parser.mli odoc_text_parser.ml odoc_text_parser.mli
 	@rm -rf stdlib_man
-	@rm -f generators/*.cm[aiox] generators/*.[ao] generators/*.cmx[as]
+	@rm -f generators/*.cm[aiox] generators/*.$(A) generators/*.$(O) generators/*.cmx[as]
 
 depend::
 	$(OCAMLYACC) odoc_text_parser.mly

File ocamldoc/Makefile.nt

View file
 
 include ../config/Makefile
 
-CAMLRUN =../boot/ocamlrun
+# Various commands and dir
+##########################
+CAMLRUN=../boot/ocamlrun
 OCAMLC   = ../ocamlcomp.sh
 OCAMLOPT = ../ocamlcompopt.sh
-OCAMLLEX =$(CAMLRUN) ../boot/ocamllex
-OCAMLYACC=../boot/ocamlyacc
-
+OCAMLDEP = $(CAMLRUN) ../tools/ocamldep
+OCAMLLEX = $(CAMLRUN) ../boot/ocamllex
+OCAMLYACC= ../boot/ocamlyacc
 OCAMLLIB = $(LIBDIR)
 OCAMLBIN = $(BINDIR)
 
 
 INCLUDES=$(INCLUDES_DEP) $(INCLUDES_NODEP)
 
-COMPFLAGS=$(INCLUDES)
+COMPFLAGS=$(INCLUDES) -warn-error A
 LINKFLAGS=$(INCLUDES) -nostdlib
 
 CMOFILES= odoc_config.cmo \
 CMXFILES= $(CMOFILES:.cmo=.cmx)
 CMIFILES= $(CMOFILES:.cmo=.cmi)
 
-EXECMOFILES=$(CMOFILES)\
-	odoc_dag2html.cmo\
-	odoc_to_text.cmo\
-	odoc_ocamlhtml.cmo\
-	odoc_html.cmo\
-	odoc_man.cmo\
+EXECMOFILES=$(CMOFILES) \
+	odoc_dag2html.cmo \
+	odoc_to_text.cmo \
+	odoc_ocamlhtml.cmo \
+	odoc_html.cmo \
+	odoc_man.cmo \
 	odoc_latex_style.cmo \
-	odoc_latex.cmo\
-	odoc_texi.cmo\
-	odoc_dot.cmo\
-	odoc_gen.cmo\
-	odoc_args.cmo\
+	odoc_latex.cmo \
+	odoc_texi.cmo \
+	odoc_dot.cmo \
+	odoc_gen.cmo \
+	odoc_args.cmo \
 	odoc.cmo
 
 
 	$(OCAMLSRCDIR)/typing/printtyp.cmo \
 	$(OCAMLSRCDIR)/typing/includecore.cmo \
 	$(OCAMLSRCDIR)/typing/typetexp.cmo \
-	$(OCAMLSRCDIR)/typing/parmatch.cmo \
 	$(OCAMLSRCDIR)/typing/typedtree.cmo \
+	$(OCAMLSRCDIR)/typing/parmatch.cmo \
 	$(OCAMLSRCDIR)/typing/stypes.cmo \
+	$(OCAMLSRCDIR)/typing/cmt_format.cmo \
 	$(OCAMLSRCDIR)/typing/typecore.cmo \
 	$(OCAMLSRCDIR)/typing/includeclass.cmo \
 	$(OCAMLSRCDIR)/typing/typedecl.cmo \
 $(OCAMLDOC_LIBCMXA): $(LIBCMXFILES)
 	$(OCAMLOPT) -a -o $@ $(LINKFLAGS) $(OCAMLCMXFILES) $(LIBCMXFILES)
 
+# Parsers and lexers dependencies :
+###################################
+odoc_text_parser.ml: odoc_text_parser.mly
+odoc_text_parser.mli: odoc_text_parser.mly
+
+odoc_parser.ml:	odoc_parser.mly
+odoc_parser.mli:odoc_parser.mly
+
+odoc_text_lexer.ml: odoc_text_lexer.mll
+
+odoc_lexer.ml:odoc_lexer.mll
+
+odoc_ocamlhtml.ml: odoc_ocamlhtml.mll
+
+odoc_see_lexer.ml: odoc_see_lexer.mll
+
+
 # generic rules :
 #################
 
-.SUFFIXES: .mli .ml .cmi .cmo .cmx
+.SUFFIXES: .mll .mly .ml .mli .cmo .cmi .cmx .cmxs
 
-.mli.cmi:
+.ml.cmo:
 	$(OCAMLC) $(OCAMLPP) $(COMPFLAGS) -c $<
 
-.ml.cmo:
+.mli.cmi:
 	$(OCAMLC) $(OCAMLPP) $(COMPFLAGS) -c $<
 
 .ml.cmx:
 	$(OCAMLOPT) $(OCAMLPP) $(COMPFLAGS) -c $<
 
-odoc_text_parser.ml odoc_text_parser.mli: odoc_text_parser.mly
-	$(OCAMLYACC) odoc_text_parser.mly
+.ml.cmxs:
+	$(OCAMLOPT) -shared -o $@ $(OCAMLPP) $(COMPFLAGS) $<
 
-odoc_parser.ml odoc_parser.mli: odoc_parser.mly
-	$(OCAMLYACC) odoc_parser.mly
+.mll.ml:
+	$(OCAMLLEX) $<
 
-odoc_text_lexer.ml: odoc_text_lexer.mll
-	$(OCAMLLEX) odoc_text_lexer.mll
+.mly.ml:
+	$(OCAMLYACC) -v $<
 
-odoc_lexer.ml: odoc_lexer.mll
-	$(OCAMLLEX) odoc_lexer.mll
-
-odoc_ocamlhtml.ml: odoc_ocamlhtml.mll
-	$(OCAMLLEX) odoc_ocamlhtml.mll
-
-odoc_see_lexer.ml: odoc_see_lexer.mll
-	$(OCAMLLEX) odoc_see_lexer.mll
+.mly.mli:
+	$(OCAMLYACC) -v $<
 
 # Installation targets
 ######################
 install: dummy
 	$(MKDIR) -p $(INSTALL_BINDIR)
 	$(MKDIR) -p $(INSTALL_LIBDIR)
-	$(CP) $(OCAMLDOC) $(INSTALL_BINDIR)/$(OCAMLDOC).exe
+	$(CP) $(OCAMLDOC) $(INSTALL_BINDIR)/$(OCAMLDOC)$(EXE)
 	$(CP) ocamldoc.hva *.cmi $(OCAMLDOC_LIBCMA) $(INSTALL_LIBDIR)
 	$(CP) $(INSTALL_MLIS) $(INSTALL_CMIS) $(INSTALL_LIBDIR)
 
 installopt_really:
 	$(MKDIR) -p $(INSTALL_BINDIR)
 	$(MKDIR) -p $(INSTALL_LIBDIR)
-	$(CP) $(OCAMLDOC_OPT) $(INSTALL_BINDIR)/$(OCAMLDOC_OPT).exe
+	$(CP) $(OCAMLDOC_OPT) $(INSTALL_BINDIR)/$(OCAMLDOC_OPT)$(EXE)
 	$(CP) ocamldoc.hva $(OCAMLDOC_LIBA) $(OCAMLDOC_LIBCMXA) $(INSTALL_LIBDIR)
 	$(CP) $(INSTALL_MLIS) $(INSTALL_CMIS) $(INSTALL_LIBDIR)
 
 	@rm -f odoc_parser.output odoc_text_parser.output
 	@rm -f odoc_lexer.ml odoc_text_lexer.ml odoc_see_lexer.ml odoc_ocamlhtml.ml
 	@rm -f odoc_parser.ml odoc_parser.mli odoc_text_parser.ml odoc_text_parser.mli
+	@rm -rf stdlib_man
+	@rm -f generators/*.cm[aiox] generators/*.$(A) generators/*.$(O) generators/*.cmx[as]
 
 depend::
-	rm -f .depend
 	$(OCAMLYACC) odoc_text_parser.mly
 	$(OCAMLYACC) odoc_parser.mly
 	$(OCAMLLEX) odoc_text_lexer.mll
 	$(OCAMLLEX) odoc_lexer.mll
+	$(OCAMLLEX) odoc_ocamlhtml.mll
+	$(OCAMLLEX) odoc_see_lexer.mll
 	$(OCAMLDEP) $(INCLUDES_DEP) *.mll *.mly *.ml *.mli > .depend
 
 dummy: