Module Name: src Committed By: dsl Date: Tue Aug 11 17:29:05 UTC 2009
Modified Files: src/lib/libc: Makefile Log Message: Change (slightly) the way NO_SRCS is processed, update big comment! Now the .c file is removed from SRCS for both .S and .c in NO_SRSC. The .c file is added to LSRCS for .S files in NO_SRCS. (.S files in SRCS have the same treatment - but also get compiled.) Allows vax build to be fixed. Also the previous version failed to add to LSRCS correctly. To generate a diff of this commit: cvs rdiff -u -r1.137 -r1.138 src/lib/libc/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libc/Makefile diff -u src/lib/libc/Makefile:1.137 src/lib/libc/Makefile:1.138 --- src/lib/libc/Makefile:1.137 Thu Jul 30 20:57:15 2009 +++ src/lib/libc/Makefile Tue Aug 11 17:29:04 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.137 2009/07/30 20:57:15 dsl Exp $ +# $NetBSD: Makefile,v 1.138 2009/08/11 17:29:04 dsl Exp $ # @(#)Makefile 8.2 (Berkeley) 2/3/94 # # All library objects contain sccsid strings by default; they may be @@ -91,20 +91,26 @@ .include "${.CURDIR}/yp/Makefile.inc" .endif -# Remove from SRCS the .c files for any .S files added by the MD makefiles. -# Any files added to NO_SRCS will also not be compiled -# (eg because another file generates the same entry point) -# Use the .c file to generate the lint library, but don't add to DPSRCS -# (since it would overwrite the .d file containing the foo.o: foo.S rules). -.for asm_file in ${SRCS:M*.S} ${NO_SRCS} -unwanted_file := ${SRCS:M${asm_file:.S=.c}} +# Remove from SRCS the .c files for any .S files added by the MD makefiles, +# also remove from SRCS the .c files for the .S and .c files in NO_SRCS. +# Add the .c file for .S files (in both variables) to LSRCS so that the +# 'normal' .c file for assembly files is used for the lint librray. +# +# Usage: +# Add .S files to NO_SRSC when another .S file provides the entry points. +# Add .c files to NO_SRSC when another .c file provides the entry points. +# (lint is run on all .c files in SRCS) + +.for check_file in ${SRCS:M*.S} ${NO_SRCS} +unwanted_file := ${SRCS:M${check_file:.S=.c}} .if "${unwanted_file}" != "" SRCS := ${SRCS:N${unwanted_file}} -LSRCS += ${unwanted_file} +.if "${unwanted_file}" != "${check_file}" +LSRCS := ${LSRCS} ${unwanted_file} +.endif .endif .endfor - NLS= C.msg Pig.msg ca.msg cs.msg de.msg es.msg fi.msg fr.msg nl.msg \ no.msg pl.msg sk.msg sv.msg