]> git.e2factory.org Git - e2factory.git/commitdiff
Generate developer docs with our local ldoc
authorTobias Ulmer <tu@emlix.com>
Wed, 12 Dec 2012 00:47:56 +0000 (01:47 +0100)
committerTobias Ulmer <tu@emlix.com>
Tue, 26 Feb 2013 18:07:12 +0000 (19:07 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
doc/Makefile
doc/developer/Makefile [moved from doc/luadoc/Makefile with 83% similarity]
doc/developer/config.ld [new file with mode: 0644]
doc/ldoc/Makefile [new file with mode: 0644]
doc/ldoc/ldoc.sh [new file with mode: 0644]

index 4068e7a1ca96a5c7ad2763d380661c4154b5221f..4a2fc92d8dd1b08dc4e019340e5ec019d6c7e614 100644 (file)
 #  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-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
similarity index 83%
rename from doc/luadoc/Makefile
rename to doc/developer/Makefile
index 25765e87594a736e5e12ddfd7619a362687f5ead..039e7e5d355bc44d4ee43a75e2279459bbb95120 100644 (file)
 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 (file)
index 0000000..4b643c6
--- /dev/null
@@ -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 (file)
index 0000000..2a1738e
--- /dev/null
@@ -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 (file)
index 0000000..20d58a8
--- /dev/null
@@ -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" $@