Add Makefile.doc.template

main
Michael Hayes 15 years ago
parent 7ee5ceba5d
commit 3c9984fac2

@ -17,14 +17,9 @@ CLEANTEST = $(addsuffix .cleantest, $(APPS))
TESTMAKEFILES = $(addsuffix /Makefile.test, $(APPS))
APPMAKEFILES = $(addsuffix /Makefile, $(APPS))
DOCMAKEFILES = $(addsuffix /doc/Makefile, $(APPS))
APPFILEDEPS = $(addsuffix /file_dependencies.pdf, $(APPS))
APPMODULEDEPS = $(addsuffix /module_dependencies.pdf, $(APPS))
APPMAKEFILEDEPS = $(addsuffix /makefile_dependencies.pdf, $(APPS))
APPBUILDDEPS = $(addsuffix /build_dependencies.pdf, $(APPS))
APPCALLGRAPHS = $(addsuffix /callgraph.pdf, $(APPS))
all: testmakefiles appmakefiles apps test appfiledeps appmoduledeps appmakefiledeps appbuilddeps appcallgraphs
all: testmakefiles appmakefiles apps test docs
clean: cleanapps cleantest
@ -32,45 +27,19 @@ testmakefiles: $(TESTMAKEFILES)
appmakefiles: $(APPMAKEFILES)
docs: $(DOCMAKEFILES)
../%/doc/Makefile: Makefile.doc.template Makefile makemake.py
mkdir -p $(dir $@)
(cd $(dir $@)/..; ../../etc/makemake.py --relpath --template ../../etc/Makefile.doc.template . . ../../utils ../../fonts ../../drivers ../../drivers/avr > doc/Makefile)
../%/Makefile.test: Makefile.test.template Makefile
(cd $(dir $@); ../../etc/makemake.py --cc="gcc" --cflags="" --relpath --objext=-test.o --template ../../etc/Makefile.test.template . . ../../utils ../../drivers ../../drivers/test > Makefile.test)
../%/Makefile: Makefile.template Makefile makemake.py
(cd $(dir $@); ../../etc/makemake.py --cc="avr-gcc" --cflags="-Os -mmcu=atmega32u2" --relpath --template ../../etc/Makefile.template . . ../../utils ../../fonts ../../drivers ../../drivers/avr > Makefile)
appfiledeps: $(APPFILEDEPS)
appmoduledeps: $(APPMODULEDEPS)
appmakefiledeps: $(APPMAKEFILEDEPS)
appbuilddeps: $(APPBUILDDEPS)
appcallgraphs: $(APPCALLGRAPHS)
../%/file_dependencies.pdf: ../%/files.d
./graphdeps.py $< --out $@
../%/module_dependencies.pdf: ../%/modules.d
./graphdeps.py $< --modules --out $@
../%/makefile_dependencies.pdf: ../%/Makefile
./graphdeps.py $< --out $@
../%/build_dependencies.pdf: ../%/Makefile
./graphdeps.py $< --out $@ --showops
../%/callgraph.pdf: ../%/callgraph.d
(cd $(dir $@); ../../etc/graphdeps.py --calls --modules $(notdir $<) --out $(notdir $@))
../%/files.d: ../%/Makefile
(cd $(dir $@); ../../etc/makemake.py --relpath --files . . ../../drivers ../../drivers/avr ../../utils --exclude system.h > files.d)
../%/modules.d: ../%/Makefile
(cd $(dir $@); ../../etc/makemake.py --relpath --modules . . ../../drivers ../../drivers/avr ../../utils --exclude system > modules.d)
../%/callgraph.d: ../%/Makefile
(cd $(dir $@); ../../etc/makemake.py --cc="avr-gcc" --cflags="-Os -mmcu=atmega32u2" --relpath --calls . . ../../drivers ../../drivers/avr ../../utils --exclude system > callgraph.d)
# Compile all the applications.
apps: $(MAKEAPPS)

@ -0,0 +1,41 @@
# File: Makefile
# Author: M. P. Hayes, UCECE
# Date: 11 Sep 2010
# Descr: Makefile for @PROJECT@ docs
DEL = rm
all: file_dependencies.pdf module_dependencies.pdf makefile_dependencies.pdf build_dependencies.pdf callgraph.pdf
file_dependencies.pdf: files.d
../../../etc/graphdeps.py $< --out $@
module_dependencies.pdf: modules.d
../../../etc/graphdeps.py $< --modules --out $@
makefile_dependencies.pdf: ../Makefile
../../../etc/graphdeps.py $< --out $@
build_dependencies.pdf: ../Makefile
../../../etc/graphdeps.py $< --out $@ --showops
callgraph.pdf: callgraph.d
../../../etc/graphdeps.py --calls --modules $< --out $@ --showops
files.d: ../Makefile
(cd ..; ../../etc/makemake.py --relpath --files . . ../../drivers ../../drivers/avr ../../utils --exclude system.h > doc/files.d)
modules.d: ../Makefile
(cd ..; ../../etc/makemake.py --relpath --modules . . ../../drivers ../../drivers/avr ../../utils --exclude system > doc/modules.d)
callgraph.d: ../Makefile
(cd ..; ../../etc/makemake.py --cc="avr-gcc" --cflags="-Os -mmcu=atmega32u2" --relpath --calls . . ../../drivers ../../drivers/avr ../../utils --exclude system.h > doc/callgraph.d)
# Clean: delete derived files.
.PHONY: clean
clean:
-$(DEL) *.d *.pdf

@ -1,5 +1,5 @@
#!/usr/bin/python
"""graphdeps V0.08
"""graphdeps V0.09
Copyright (c) 2011 Michael P. Hayes, UC ECE, NZ
Usage: graphdeps Makefile
@ -48,7 +48,7 @@ def node_output (dotfile, name, options):
if options.debug:
print >> sys.stderr, 'Node', name
if not options.fullpaths:
if not options.calls and not options.fullpaths:
name = os.path.basename (name)
# Should check if creating a duplicate although graphviz will
@ -95,6 +95,9 @@ def edge_output (dotfile, target, dep, indirect):
def dep_output (dotfile, target, dep, modules, options):
if not options.calls and not options.fullpaths:
dep = os.path.basename (dep)
if options.debug:
print >> sys.stderr, target, '::', dep
@ -105,8 +108,6 @@ def dep_output (dotfile, target, dep, modules, options):
if indirect:
dep = dep[1:]
# dep = node_output (dotfile, dep, options)
(file, ext) = os.path.splitext (target)
if not options.showops:
@ -139,6 +140,11 @@ def target_output (dotfile, target, targets, modules, options, seen = {}):
print >> sys.stderr, target, ':', deps
for dep in deps:
if dep == '':
continue
if not targets.has_key (dep):
node_output (dotfile, dep, options)
if targets.has_key (dep) and target != dep:
target_output (dotfile, dep, targets, modules, options, seen)

Loading…
Cancel
Save