[gtkada] cosmetic suggestions in Makefiles

Nicolas Boulenguez nicolas at debian.org
Mon Mar 10 22:48:25 CET 2014


Hello.
You may be interested in a few cosmetic suggestions.

"./configure --help" claims that it handles CPPFLAGS, but
src/Makefile.in ignores them.  The patch below should fix that.

--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,6 +1,7 @@
 all: dirs libs tools
 
 CFLAGS = -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS \
+ @CPPFLAGS@ \
  @CFLAGS@ -Wall @GTK_CFLAGS@ -I.. $(FPIC)
 
 GETTEXT_INTL=@GETTEXT_INTL@


The distclean target
- forgets to clean a few generated files
- forgets to clean a generated  directory
- cleans gtkada_install_static*.gpr (which are not generated).
I have written
"if test -e Makefile; then $(MAKE) distclean; fi" instead of "-$(MAKE) clean"
and "rm -f" instead of "-rm -f"
to see unexpected failures.

--- a/Makefile.in
+++ b/Makefile.in
@@ -64,6 +64,11 @@
 distclean: mostlyclean-generic
 	-${RM} config.cache config.log config.status
 	-$(MAKE) -C $(testgtk_dir) distclean
+	if test -e $(doc_dir)/Makefile; then $(MAKE) -C $(doc_dir) distclean; fi
+# projects/Makefile has no distclean target.
+	if test -e $(projects_dir)/Makefile; then $(MAKE) -C $(projects_dir) clean; fi
+	if test -e po/Makefile; then $(MAKE) -C po distclean; fi
+# src_dir has to come the last because it removes src/Makefile.common
 	-$(MAKE) -C $(src_dir) distclean
 
 mostlyclean: mostlyclean-generic
--- a/docs/Makefile.in
+++ b/docs/Makefile.in
@@ -19,3 +19,4 @@
 distclean::
 	${MAKE} -C gtkada_rm distclean
 	${MAKE} -C gtkada_ug clean
+	$(RM) Makefile
--- a/docs/gtkada_ug/Makefile
+++ b/docs/gtkada_ug/Makefile
@@ -34,7 +34,7 @@
 	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
 
 clean:
-	-rm -rf $(BUILDDIR)/*
+	rm -rf $(BUILDDIR)
 
 html:
 	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
--- a/projects/Makefile
+++ b/projects/Makefile
@@ -37,6 +37,6 @@
 endif
 
 clean: force
-	${RM} *.gpr 
+	$(RM) gtkada_install_dynamic_gl.gpr gtkada_install_dynamic.gpr gtkada.pc
 
 force:
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -120,13 +120,13 @@
 	$(MAKE) -C gnome clean
 	$(MAKE) -C tools clean
 
-distclean: force
+distclean: force clean
 	-${RM} Makefile
 	$(MAKE) -C gtkextra distclean
 	$(MAKE) -C opengl distclean
 	$(MAKE) -C gnome distclean
 	$(MAKE) -C tools distclean
-	-$(RM) Makefile.common
+	$(RM) Makefile.common config.h
 
 ## Find the list of bindings that are not up-to-date
 bindings_not_up_to_date:



More information about the gtkada mailing list