Makefile can now generate documentation.

This commit is contained in:
Glenn Y. Rolland 2008-02-28 10:43:59 +01:00
parent 2300b6ef13
commit 06da2162fd
2 changed files with 13 additions and 7 deletions

View file

@ -15,17 +15,20 @@ justnukeit_OBJS= \
justnukeit_INCS=sdl
justnukeit_LIBS=graphics unix threads bigarray sdl sdlloader sdlttf
MODULES=$(patsubst %.mli,%,$(wildcard *.mli)) $(patsubst %.ml,%,$(wildcard *.ml))
MLI=$(wildcard *.mli)
ML=$(wildcard *.ml)
CMI=$(patsubst %.ml,%.cmi,$(MODULES:=.ml))
CMO=$(patsubst %.ml,%.cmo,$(MODULES:=.ml))
CMX=$(patsubst %.ml,%.cmx,$(MODULES:=.ml))
CMI=$(patsubst %.mli,%.cmi,$(MLI))
CMO=$(patsubst %.ml,%.cmo,$(ML))
CMX=$(patsubst %.ml,%.cmx,$(ML))
OCAMLDEP=ocamldep
OCAMLOPT=ocamlopt
OCAMLC=ocamlc
OPTS=-w A -g -thread -I +sdl -ccopt -L+sdl
INCS=-I +sdl
LIBS=-ccopt -L+sdl
OPTS=-w A -g -thread $(INCS) $(LIBS)
define PROGRAM_template
ALL_OBJS += $($(1)_OBJS)
@ -42,6 +45,9 @@ $(foreach prog,$(PROGRAMS),$(eval $(call PROGRAM_template,$(prog))))
.PHONY: all
all: $(PROGRAMS)
doc:
ocamldoc $(INCS) -d doc -html $(ML) $(MLI)
%.cmi: %.mli
@echo -n -e "\x1B[31;1m"
@echo "[I] $<"
@ -75,8 +81,8 @@ all: $(PROGRAMS)
clean:
rm -f $(PROGRAMS) *~ *.cm* *.o *.a *.so .depend *.cmxa *.cma
.depend: $(MODULES:=.ml)
$(OCAMLDEP) $(MODULES:=.ml) $(MODULES:=.mli) > .depend
.depend: $(ML) $(MLI)
$(OCAMLDEP) $(ML) $(MLI) > .depend
@echo ""

0
doc/README Normal file
View file