Commits

Anonymous committed 5620b55

http://code.google.com/p/mochiweb/issues/detail?id=23 use edoc:application, switch to an explicit make doc phase

  • Participants
  • Parent commits 0576010

Comments (0)

Files changed (3)

 all:
-	(cd src;$(MAKE))
+	(cd src;$(MAKE) all)
+
+edoc:
+	(cd src;$(MAKE) edoc)
 
 test:
 	(cd src;$(MAKE) test)

File src/Makefile

 include ../support/include.mk
 
+APPLICATION=mochiweb
+DOC_OPTS={dir,\"../doc\"}
+
 all: $(EBIN_FILES)
 
 debug:
 clean:
 	rm -rf $(EBIN_FILES)
 
+edoc:
+	$(ERL) -noshell -pa ../ebin \
+		-eval "edoc:application($(APPLICATION), \".\", [$(DOC_OPTS)])" \
+		-s init stop
+
 test: all
-	$(ERL) -noshell -pa ../ebin -s mochiweb test -s init stop
+	$(ERL) -noshell -pa ../ebin -s $(APPLICATION) test -s init stop

File support/include.mk

 endif
 
 EBIN_DIR := ../ebin
-DOC_DIR  := ../doc
 EMULATOR := beam
 
 ERL_SOURCES := $(wildcard *.erl)
 ERL_HEADERS := $(wildcard *.hrl) $(wildcard ../include/*.hrl)
 ERL_OBJECTS := $(ERL_SOURCES:%.erl=$(EBIN_DIR)/%.$(EMULATOR))
-ERL_DOCUMENTS := $(ERL_SOURCES:%.erl=$(DOC_DIR)/%.html)
 ERL_OBJECTS_LOCAL := $(ERL_SOURCES:%.erl=./%.$(EMULATOR))
 APP_FILES := $(wildcard *.app)
-EBIN_FILES = $(ERL_OBJECTS) $(ERL_DOCUMENTS) $(APP_FILES:%.app=../ebin/%.app)
-EBIN_FILES_NO_DOCS = $(ERL_OBJECTS) $(APP_FILES:%.app=../ebin/%.app)
+EBIN_FILES = $(ERL_OBJECTS) $(APP_FILES:%.app=../ebin/%.app)
 MODULES = $(ERL_SOURCES:%.erl=%)
 
 ../ebin/%.app: %.app
 
 ./%.$(EMULATOR): %.erl
 	$(ERLC) $(ERLC_FLAGS) -o . $<
-
-$(DOC_DIR)/%.html: %.erl
-	$(ERL) -noshell -run edoc file $< -run init stop
-	mv *.html $(DOC_DIR)