Received: by taz.hyperreal.com (8.8.4/V2.0) id TAA03872; Mon, 31 Mar 1997 19:14:10 -0800 (PST) Received: from paris.ics.uci.edu by taz.hyperreal.com (8.8.4/V2.0) with SMTP id TAA03851; Mon, 31 Mar 1997 19:14:06 -0800 (PST) Received: from kiwi.ics.uci.edu by paris.ics.uci.edu id aa04097; 31 Mar 97 19:11 PST To: new-httpd@hyperreal.com Subject: [PATCH] broken modules/Makefile (again) In-reply-to: Your message of "Sun, 30 Mar 1997 23:06:24 EST." <199703310406.XAA19644@postman.osf.org> Date: Mon, 31 Mar 1997 19:11:17 -0800 From: "Roy T. Fielding" Message-ID: <9703311911.aa04097@paris.ics.uci.edu> Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@hyperreal.com >Yes, I think separate rule for each module is the way to go. >It's kinda ugly, awk doesn't let you have 's inside of "" strings, >e.g. printf "AUX_FLAGS='$(MOD_CFLAGS)'" >(I found the ugly sprintf/q work around in the awk faq). awk isn't portable either. The following patch will do the same, but without as much uglyness. I also tested it with additional module directories (which made the @echo linking ... bogus). If HPsUX make doesn't support $@, then it ain't make. .....Roy Index: Configure =================================================================== RCS file: /export/home/cvs/apache/src/Configure,v retrieving revision 1.85 diff -c -r1.85 Configure *** Configure 1997/03/25 20:21:20 1.85 --- Configure 1997/04/01 03:04:57 *************** *** 571,577 **** cat Makefile.config >> Makefile sed -e "s#@@Configuration@@#$file#" "$makefile_tmpl" >>Makefile awk >>Makefile <$tmpfile \ ! '($3 ~ /modules\//) { printf "%s: modules/last-built ; @echo linking %s\n\n", $3, $3}' cat Makefile.config ../support/Makefile.tmpl > ../support/Makefile cat << EOF > modules/Makefile --- 571,577 ---- cat Makefile.config >> Makefile sed -e "s#@@Configuration@@#$file#" "$makefile_tmpl" >>Makefile awk >>Makefile <$tmpfile \ ! '($3 ~ /modules\//) { printf "%s: modules/last-built\n\n", $3, $3}' cat Makefile.config ../support/Makefile.tmpl > ../support/Makefile cat << EOF > modules/Makefile *************** *** 593,619 **** 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 --- 593,622 ---- awk >> modules/Makefile < $tmpfile '\ BEGIN {printf "MODULES="} \ ! ($3 ~ /modules\//) {split ($3, pp, "/"); printf "%s ", 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" ! \$(MODULES): ForceMe ! (cd \$@; \$(MAKE) CC=\$(CC) AUX_CFLAGS='\$(MOD_CFLAGS)' RANLIB='\$(RANLIB)') ! ForceMe: EOF + + awk >>modules/Makefile <$tmpfile \ + '($3 ~ /modules\//) { split ($3, pp, "/"); \ + printf "%s_clean:\n\t(cd %s; $(MAKE) clean)\n\n", pp[2], pp[2]}' +