[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: listing all sources
From: |
Allan Clark |
Subject: |
Re: listing all sources |
Date: |
Fri, 26 Aug 2005 11:54:47 +0800 |
User-agent: |
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.11) Gecko/20050727 |
Trevor Woerner wrote:
I have a project with source files in multiple subdirectories: src,
tests, cfg. Doxygen will generate code documentation based on special
hints in the comments of the code files themselves (like javadoc, if
you're familiar with that mechanism).
I could just blindly have Doxygen run each time I run "make [<something>]":
all-local:: doxygen/html/index.html
But it would be nice if it only ran as required, in other words, only
when one of the project's sources is modified. Previously I had all
the sources in one directory (src) so this was easy:
doxygen/html/index.html: $(SOURCES)
$(DOXYGEN) Doxyfile
But if the sources are spread throughout the project is there any way
at any one location to dynamically know all the sources?
doxygen/html/index.html: $(SUBDIRS)/$(SOURCES)
$(DOXYGEN) Doxyfile
The recursive behavior of automake makes this difficult. What you can
do it alter Automake to provide in every Makefile (might be non-trivial):
.doxygen: $(SOURCES)
touch $@
... then, at top-level, you could enumerate your subdirs:
doxygen: src/.doxygen doc/.doxygen
doxygen ...
... with gnu-make, if you wanted to make the list of Doxygen dependents
automatic, you could:
doxygen: $(addsuffix /.doxygen,$(DIST_SUBDIRS))
doxygen ...
Alternatively, you could cause a filelist to be created from a
dependency on the Makefiles -- $(addsuffix /Makefile.am,$(DIST_SUBDIRS))
-- or even generate a file to be included in the top-level Makefile. ..
or just wimp out and:
doxygen: $(addsuffix /*.c,$(DIST_SUBDIRS)) $(addsuffix /*.h,$(DIST_SUBDIRS))
doxygen ...
Lemme know if it works...
Allan