GNOME Bugzilla – Bug 99283
should improve example Makefile.am
Last modified: 2004-12-22 21:47:04 UTC
The example Makefile.am that comes with gtk-doc has some major flaws that aren't that easy to fix. I'd suggest a complete rewrite... To understand why I'm saying this, try to generate a dist tarball in a project that uses a Makefile.am based on the example. If you do this with automake >= 1.6, you'll notice that it fails for a couple of reasons. First, the example Makefile.am has some install hooks but it is missing uninstall targets for these. 'make dist' will complain that not all installed files are removed when people use 'make uninstall'. This is rather annoying and should definitely be fixed. Here are the lines I added in The GIMP: uninstall-local: (installfiles=`echo $(srcdir)/html/*`; \ for i in $$installfiles; do \ rm -f $(DESTDIR)$(TARGET_DIR)/`basename $$i`; \ done; \ rm -f $(DESTDIR)$(TARGET_DIR)/index.sgml) After this change, make dist proceeds but fails later since the rules from the example Makefile try to generate files in the source tree which is read-only if you use automake >= 1.6. This should probably be fixed as well.
Adding some bugs which are also about standard Makefile deficiencies as dependencies.
Some own patches; they have some drawbacks, just to give pinpoints to additional bugs/misfeatures: # s/EXTRA_DIST =/EXTRA_DIST +=/ # s/tmpl-build.stamp:/tmpl-build.stamp $(srcdir)/tmpl/*.sgml:/ # Prevent: No rule to make target `tmpl/*.sgml', needed by `sgml-build.stamp'. Stop. # Fixes gtk-doc-0.9/setting-up.txt/: # (Note that due to make being awkward the build # may fail the first time, but if you run make again it should work.) # s/gtkdoc-scanobj/gtkdoc-scangobj/ # Note that if your project is targeted at GTK+ 2.0 rather # than GTK+ 1.2.x, then you will have to change it so it # runs gtkdoc-scangobj rather than gtkdoc-scanobj. # s/: scan-build.stamp/ $(DOC_MODULE)-sections.txt &/ # Prevent: No rule to make target `$(DOC_MODULE)-sections.txt', needed by `distdir'. Stop. # s/gtkdoc-scan --module=/rm -f $(SCANOBJ_FILES) \&\& &/ # Do not forget to rebuild some files. # Create sgml/sgml/ to satisfy sgml/-based includes from sgml/MODULE-doc.top # Prevent: sgml.stamp defined both conditionally and unconditionally if ENABLE_GTK_DOC sgml.stamp: sgml/sgml sgml/sgml: @$(LN_S) ./ $@ endif
The new template makefile I am working on (gtk-doc.make in CVS), I have added the extra distclean and uninstall rules. I have a work around for the readonly source dir (chmod u+w), but it would be good to work out a real solution. With the new setup, it will be possible to have a short makefile in your module that includes the common part, so you don't need to maintain the common section.
*** This bug has been marked as a duplicate of 124438 ***