httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy T. Fielding" <field...@kiwi.ICS.UCI.EDU>
Subject Re: [PATCH] "make clean" bombs if no subdirectory modules are used
Date Fri, 21 Mar 1997 10:39:14 GMT
In message <333262B7.6201DD56@topsail.org>, Chuck Murcko writes:
>What I have here is the generic BSD make. It looks like the %.build is
>expanding OK, just that the target seems to be an orphan. It looks like
>a .SUFFIX problem.
>
>What if you just do this?
>
>clean:
>        (if [ "$(MODULES)" != "" ]; then\
>             for dir in $(MODULES); do \
>                cd $$dir; $(MAKE) clean; \
>                cd ..; \
>             done \
>         fi)
>
>and you can do the same for the default target if that's also a problem
>when $(MODULES) is empty.

That's what I tried to do first -- it doesn't work because the shell
interprets the entire command and pukes on the "unexpected ;" before
it executes the if.

Here is another version that may be more portable with old makes.

.....Roy

Index: Configure
===================================================================
RCS file: /export/home/cvs/apache/src/Configure,v
retrieving revision 1.82
diff -c -r1.82 Configure
*** Configure	1997/03/18 10:23:53	1.82
--- Configure	1997/03/21 10:35:24
***************
*** 590,609 ****
  
  awk >> modules/Makefile < $tmpfile '\
     BEGIN {printf "MODULES="} \
!    ($3 ~ /modules\//) {split ($3, pp, "/"); printf "%s ", pp[2]} \
     END {printf "\n"}'
  cat << EOF >> modules/Makefile
  
! default:
! 	(for dir in \$(MODULES); do \\
! 		cd \$\$dir; \\
! 		\$(MAKE) CC=\$(CC) AUX_CFLAGS='\$(MOD_CFLAGS)' RANLIB='\$(RANLIB)'; \\
! 		cd ..; \\
! 	done)
! 
! clean:	
! 	(for dir in \$(MODULES); do \\
! 		cd \$\$dir; \$(MAKE) clean; \\
! 		cd ..; \\
! 	done)
  EOF
--- 590,616 ----
  
  awk >> modules/Makefile < $tmpfile '\
     BEGIN {printf "MODULES="} \
!    ($3 ~ /modules\//) {split ($3, pp, "/"); printf "%s.build ", pp[2]} \
     END {printf "\n"}'
+ 
+ awk >> modules/Makefile < $tmpfile '\
+    BEGIN {printf "CLEANERS="} \
+    ($3 ~ /modules\//) {split ($3, pp, "/"); printf "%s.clean ", pp[2]} \
+    END {printf "\n"}'
+ 
  cat << EOF >> modules/Makefile
  
! default: \$(MODULES)
! 	@echo "done building module subdirectories"
! 
! clean: \$(CLEANERS)
! 	@echo "done cleaning module subdirectories"
! 
! .SUFFIXES: .build .clean
! 
! \$(MODULES):
! 	(cd \$*; \$(MAKE) CC=\$(CC) AUX_CFLAGS='\$(MOD_CFLAGS)' RANLIB='\$(RANLIB)')
! 
! \$(CLEANERS):
! 	(cd \$*; \$(MAKE) clean)
  EOF

Mime
View raw message