From b0dcf15d06cbe6e0c8d000898a1ad045920bd6f3 Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Wed, 12 Dec 2012 01:47:56 +0100 Subject: [PATCH] Generate developer docs with our local ldoc Signed-off-by: Tobias Ulmer --- doc/Makefile | 10 ++-- doc/{luadoc => developer}/Makefile | 33 ++++++------ doc/developer/config.ld | 16 ++++++ doc/ldoc/Makefile | 87 ++++++++++++++++++++++++++++++ doc/ldoc/ldoc.sh | 13 +++++ 5 files changed, 138 insertions(+), 21 deletions(-) rename doc/{luadoc => developer}/Makefile (83%) create mode 100644 doc/developer/config.ld create mode 100644 doc/ldoc/Makefile create mode 100644 doc/ldoc/ldoc.sh diff --git a/doc/Makefile b/doc/Makefile index 4068e7a..4a2fc92 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -25,12 +25,12 @@ # along with this program. If not, see . # -SUBDIRS = luadoc man manual +SUBDIRS = ldoc developer man manual TOPLEVEL = .. include $(TOPLEVEL)/make.vars -CLEAN_FILES = *~ documentation.tar.gz +CLEAN_FILES = documentation.tar.gz .PHONY: all e2commit install install-local clean local localdist uninstall \ doc @@ -66,11 +66,11 @@ doc: done $(MAKE) documentation.tar.gz -documentation.tar.gz: luadoc/luadoc.tar.gz \ +documentation.tar.gz: developer/e2factory.tar.gz \ man/man.tar.gz manual/manual.tar.gz rm -fr documentation - mkdir documentation - tar -C documentation -xzf luadoc/luadoc.tar.gz + mkdir -p documentation/developer + tar -C documentation/developer -xzf developer/e2factory.tar.gz tar -C documentation -xzf man/man.tar.gz tar -C documentation -xzf manual/manual.tar.gz cp $(TOPLEVEL)/Changelog documentation diff --git a/doc/luadoc/Makefile b/doc/developer/Makefile similarity index 83% rename from doc/luadoc/Makefile rename to doc/developer/Makefile index 25765e8..039e7e5 100644 --- a/doc/luadoc/Makefile +++ b/doc/developer/Makefile @@ -28,11 +28,11 @@ SUBDIRS = TOPLEVEL = ../.. -DIR = $(shell pwd) +LDOC = $(TOPLEVEL)/doc/ldoc/ldoc include $(TOPLEVEL)/make.vars -CLEAN_FILES = *~ luadoc.tar.gz +CLEAN_FILES = e2factory.tar.gz .PHONY: all e2commit install install-local clean local localdist uninstall \ doc @@ -62,31 +62,21 @@ install-local: $(MAKE) -C $$s $@ ;\ done -doc: luadoc.tar.gz +doc: gen-doc for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done -install-doc: doc - tar -C $(DOCDIR) -xzf luadoc.tar.gz +install-doc: for s in $(SUBDIRS) ; do \ - $(MAKE) -C $$s $@ ; \ + $(MAKE) -C $$s $@ ;\ done -luadoc.tar.gz: $(TOPLEVEL)/local/*.lua $(TOPLEVEL)/generic/*.lua - rm -fr luadoc - mkdir luadoc - (cd $(TOPLEVEL) ; luadoc -d $(DIR)/luadoc \ - local/*.lua \ - generic/*.lua) - tar -czf luadoc.tar.gz luadoc - -clean: +clean: clean-doc for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done rm -f $(CLEAN_FILES) - rm -fr luadoc check: for s in $(SUBDIRS) do ;\ @@ -98,3 +88,14 @@ localdist: $(MAKE) -C $$s $@ ;\ done +$(LDOC): + $(MAKE) -C $(TOPLEVEL)/doc/ldoc + +.PHONY: gen-doc +gen-doc: $(LDOC) + $(LDOC) . + tar -czf e2factory.tar.gz e2factory + +.PHONY: clean-doc +clean-doc: + rm -rf e2factory diff --git a/doc/developer/config.ld b/doc/developer/config.ld new file mode 100644 index 0000000..4b643c6 --- /dev/null +++ b/doc/developer/config.ld @@ -0,0 +1,16 @@ +project = "e2factory" +title = "e2factory Developer Documentation" +dir = "e2factory" +file = { "../../generic", + "../../local", + "../../global", + exclude = { + "../../generic/test_sha1.lua", + "../../generic/luafile_ll.c", + "../../generic/sha1.c", + "../../generic/e2-su-2.2.c", + "../../generic/e2util.c", + "../../generic/lsha1.c", + "../../local/linux32.c", + } +} diff --git a/doc/ldoc/Makefile b/doc/ldoc/Makefile new file mode 100644 index 0000000..2a1738e --- /dev/null +++ b/doc/ldoc/Makefile @@ -0,0 +1,87 @@ +SUBDIRS = +TOPLEVEL = ../.. + +include $(TOPLEVEL)/make.vars + +CLEAN_FILES = ldoc + +.PHONY: all install install-local clean local uninstall doc install-doc check \ + localdist + +all: ldoc + for s in $(SUBDIRS) ; do \ + $(MAKE) -C $$s $@ ;\ + done + +install: + for s in $(SUBDIRS) ; do \ + $(MAKE) -C $$s $@ ;\ + done + +uninstall: + for s in $(SUBDIRS) ; do \ + $(MAKE) -C $$s $@ ;\ + done + +local: + for s in $(SUBDIRS) ; do \ + $(MAKE) -C $$s $@ ;\ + done + +install-local: + for s in $(SUBDIRS) ; do \ + $(MAKE) -C $$s $@ ;\ + done + +doc: + for s in $(SUBDIRS) ; do \ + $(MAKE) -C $$s $@ ;\ + done + +install-doc: + for s in $(SUBDIRS) ; do \ + $(MAKE) -C $$s $@ ;\ + done + +clean: clean-lua-5.1.3 clean-luafilesystem-1.6.2 + for s in $(SUBDIRS) ; do \ + $(MAKE) -C $$s $@ ;\ + done + rm -f $(CLEAN_FILES) + +check: + for s in $(SUBDIRS) do ;\ + $(MAKE) -C $$s $@ ;\ + done + +localdist: + for s in $(SUBDIRS) do ;\ + $(MAKE) -C $$s $@ ;\ + done + +lua-5.1.3: + cp -Rp $(TOPLEVEL)/lua/lua-5.1.3 lua-5.1.3 + $(MAKE) -C lua-5.1.3/src clean + $(MAKE) -C lua-5.1.3/src all MYCFLAGS="\ + -DLUA_USE_POSIX -DLUA_USE_DLOPEN \ + -DLUA_PATH_DEFAULT='\"\"' \ + -DLUA_CPATH_DEFAULT='\"\"'" \ + MYLIBS="-Wl,-E -ldl" + +.PHONY: clean-lua-5.1.3 +clean-lua-5.1.3: + rm -rf lua-5.1.3 + +.PHONY: lfs +lfs: luafilesystem-1.6.2/src/lfs.so + +luafilesystem-1.6.2/src/lfs.so: + $(MAKE) -C luafilesystem-1.6.2 lib LUA_INC="$$PWD/lua-5.1.3/src" + +.PHONY: clean-luafilesystem-1.6.2 +clean-luafilesystem-1.6.2: + $(MAKE) -C luafilesystem-1.6.2 clean + +ldoc: lua-5.1.3 lfs ldoc.sh + sed -e "s|@LDOC_BASE@|$$PWD|" < ldoc.sh > ldoc + chmod a+x ldoc diff --git a/doc/ldoc/ldoc.sh b/doc/ldoc/ldoc.sh new file mode 100644 index 0000000..20d58a8 --- /dev/null +++ b/doc/ldoc/ldoc.sh @@ -0,0 +1,13 @@ +#!/bin/sh -e + +if [ -z "$LDOC_BASE" ]; then + LDOC_BASE="@LDOC_BASE@" +fi + +LUA_BIN="$LDOC_BASE/lua-5.1.3/src/lua" +LDOC_DIR="$LDOC_BASE/LDoc-1.2.0" +PL_DIR="$LDOC_BASE/Penlight-1.0.2" +LFS_DIR="$LDOC_BASE/luafilesystem-1.6.2" + +env LUA_PATH="$PL_DIR/lua/?.lua;$PL_DIR/lua/?/init.lua" \ + LUA_CPATH="$LFS_DIR/src/lfs.so" "$LUA_BIN" "$LDOC_DIR/ldoc.lua" $@ -- 2.39.5