Allow relative pathnames in SRCS, so as to enable building software
which includes more than one file with the same name, in different directories. For example, setting: SRCS+= foo/foo.c bar/foo.c baz/foo.c will now create separate objdirs 'foo', 'bar' and 'baz' for each of the sources in the list, and use those objdirs for the corresponding object files. Reviewed by: brooks, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D1984
This commit is contained in:
@@ -89,6 +89,16 @@ obj: .PHONY
|
||||
fi; \
|
||||
${ECHO} "${CANONICALOBJDIR} created for ${.CURDIR}"; \
|
||||
fi
|
||||
.for dir in ${SRCS:H:O:u}
|
||||
@if ! test -d ${CANONICALOBJDIR}/${dir}/; then \
|
||||
mkdir -p ${CANONICALOBJDIR}/${dir}; \
|
||||
if ! test -d ${CANONICALOBJDIR}/${dir}/; then \
|
||||
${ECHO} "Unable to create ${CANONICALOBJDIR}/${dir}."; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
${ECHO} "${CANONICALOBJDIR}/${dir} created for ${.CURDIR}"; \
|
||||
fi
|
||||
.endfor
|
||||
.endif
|
||||
|
||||
.if !target(objlink)
|
||||
|
||||
Reference in New Issue
Block a user