Simon Josefsson wrote: > The sys_socket module uses mostlyclean-local: > > mostlyclean-local: > -rmdir sys 2>/dev/null > > This makes it difficult for other modules to do the same. I get: > > Makefile:817: warning: overriding commands for target `mostlyclean-local' > Makefile:712: warning: ignoring old commands for target `mostlyclean-local' > > How about this solution?
I agree about the problem. I committed a fix similar to yours, but that doesn't throw away stderr output. Bruno 2006-06-23 Simon Josefsson <[EMAIL PROTECTED]> Bruno Haible <[EMAIL PROTECTED]> * gnulib-tool (func_emit_lib_Makefile_am): Define MOSTLYCLEANDIRS. Emit mostlyclean-local rule. (func_emit_tests_Makefile_am): Likewise. * modules/sys_socket (Makefile.am): Use MOSTLYCLEANDIRS. diff -c -3 -r1.112 gnulib-tool *** gnulib-tool 9 May 2006 02:38:16 -0000 1.112 --- gnulib-tool 23 Jun 2006 19:26:18 -0000 *************** *** 749,754 **** --- 749,755 ---- echo "BUILT_SOURCES =" echo "SUFFIXES =" echo "MOSTLYCLEANFILES =" + echo "MOSTLYCLEANDIRS =" echo "CLEANFILES =" echo "DISTCLEANFILES =" echo "MAINTAINERCLEANFILES =" *************** *** 777,782 **** --- 778,791 ---- fi done echo + echo "mostlyclean-local:" + echo " @test -z \"\$(MOSTLYCLEANDIRS)\" || \\" + echo " for dir in \$(MOSTLYCLEANDIRS); do \\" + echo " if test -d \$\$dir; then \\" + echo " echo \"rmdir \$\$dir\"; rmdir \$\$dir; \\" + echo " fi; \\" + echo " done" + echo echo "# Makefile.am ends here" } *************** *** 818,823 **** --- 827,833 ---- echo "BUILT_SOURCES =" echo "SUFFIXES =" echo "MOSTLYCLEANFILES =" + echo "MOSTLYCLEANDIRS =" echo "CLEANFILES =" echo "DISTCLEANFILES =" echo "MAINTAINERCLEANFILES =" *************** *** 848,853 **** --- 858,871 ---- echo "clean-local:" echo " rm -rf SunWS_cache" echo + echo "mostlyclean-local:" + echo " @test -z \"\$(MOSTLYCLEANDIRS)\" || \\" + echo " for dir in \$(MOSTLYCLEANDIRS); do \\" + echo " if test -d \$\$dir; then \\" + echo " echo \"rmdir \$\$dir\"; rmdir \$\$dir; \\" + echo " fi; \\" + echo " done" + echo echo "# Makefile.am ends here" } diff -c -3 -r1.2 sys_socket *** modules/sys_socket 19 Jun 2006 11:18:39 -0000 1.2 --- modules/sys_socket 23 Jun 2006 19:26:18 -0000 *************** *** 21,29 **** cp $(srcdir)/socket_.h [EMAIL PROTECTED] mv [EMAIL PROTECTED] $@ MOSTLYCLEANFILES += sys/socket.h sys/socket.h-t ! ! mostlyclean-local: ! -rmdir sys 2>/dev/null Include: #include <sys/types.h> --- 21,27 ---- cp $(srcdir)/socket_.h [EMAIL PROTECTED] mv [EMAIL PROTECTED] $@ MOSTLYCLEANFILES += sys/socket.h sys/socket.h-t ! MOSTLYCLEANDIRS += sys Include: #include <sys/types.h>