Makefile can now generate documentation.
This commit is contained in:
parent
2300b6ef13
commit
06da2162fd
2 changed files with 13 additions and 7 deletions
20
Makefile
20
Makefile
|
@ -15,17 +15,20 @@ justnukeit_OBJS= \
|
||||||
justnukeit_INCS=sdl
|
justnukeit_INCS=sdl
|
||||||
justnukeit_LIBS=graphics unix threads bigarray sdl sdlloader sdlttf
|
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))
|
CMI=$(patsubst %.mli,%.cmi,$(MLI))
|
||||||
CMO=$(patsubst %.ml,%.cmo,$(MODULES:=.ml))
|
CMO=$(patsubst %.ml,%.cmo,$(ML))
|
||||||
CMX=$(patsubst %.ml,%.cmx,$(MODULES:=.ml))
|
CMX=$(patsubst %.ml,%.cmx,$(ML))
|
||||||
|
|
||||||
OCAMLDEP=ocamldep
|
OCAMLDEP=ocamldep
|
||||||
OCAMLOPT=ocamlopt
|
OCAMLOPT=ocamlopt
|
||||||
OCAMLC=ocamlc
|
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
|
define PROGRAM_template
|
||||||
ALL_OBJS += $($(1)_OBJS)
|
ALL_OBJS += $($(1)_OBJS)
|
||||||
|
@ -42,6 +45,9 @@ $(foreach prog,$(PROGRAMS),$(eval $(call PROGRAM_template,$(prog))))
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: $(PROGRAMS)
|
all: $(PROGRAMS)
|
||||||
|
|
||||||
|
doc:
|
||||||
|
ocamldoc $(INCS) -d doc -html $(ML) $(MLI)
|
||||||
|
|
||||||
%.cmi: %.mli
|
%.cmi: %.mli
|
||||||
@echo -n -e "\x1B[31;1m"
|
@echo -n -e "\x1B[31;1m"
|
||||||
@echo "[I] $<"
|
@echo "[I] $<"
|
||||||
|
@ -75,8 +81,8 @@ all: $(PROGRAMS)
|
||||||
clean:
|
clean:
|
||||||
rm -f $(PROGRAMS) *~ *.cm* *.o *.a *.so .depend *.cmxa *.cma
|
rm -f $(PROGRAMS) *~ *.cm* *.o *.a *.so .depend *.cmxa *.cma
|
||||||
|
|
||||||
.depend: $(MODULES:=.ml)
|
.depend: $(ML) $(MLI)
|
||||||
$(OCAMLDEP) $(MODULES:=.ml) $(MODULES:=.mli) > .depend
|
$(OCAMLDEP) $(ML) $(MLI) > .depend
|
||||||
@echo ""
|
@echo ""
|
||||||
|
|
||||||
|
|
||||||
|
|
0
doc/README
Normal file
0
doc/README
Normal file
Loading…
Reference in a new issue