# uuid sources
.PATH: ${.CURDIR}/uuid
+CWD := ${.CURDIR}/uuid
# uuid/uuid.h is now installed by xnu
UUIDHDRS = uuidP.h
UUIDFROMMAN = libuuid.3.in
UUIDTOMAN = uuid.3.in
-UUIDMAN3 = uuid_clear.3.in uuid_compare.3.in uuid_copy.3.in uuid_generate.3.in \
- uuid_is_null.3.in uuid_parse.3.in uuid_unparse.3.in
+UUIDMAN3 = uuid_clear.3.in uuid_compare.3.in uuid_copy.3.in \
+ uuid_generate.3.in uuid_is_null.3.in uuid_parse.3.in \
+ uuid_unparse.3.in
PRIVUUID_INSTHDRS += ${.CURDIR}/uuid/namespace.h
+# This .for statement forces evaluation of ${CWD}
+.for _cwd in ${CWD}
+
.for _src in ${UUIDSRCS}
-${SYMROOT}/${_src:R}-uuid.${_src:E}: uuidsrc/${_src} _AUTOPATCHSYM
+.ifmake autopatch
+${_cwd}/${_src:R}-uuid.${_src:E}: ${_cwd}/uuidsrc/${_src} _AUTOPATCH
+AUTOPATCHSRCS+= ${_cwd}/${_src:R}-uuid.${_src:E}
+.else # !autopatch
MISRCS+= ${_src}
-AUTOPATCHSRCS+= ${SYMROOT}/${_src:R}-uuid.${_src:E}
+.endif # autopatch
.endfor
+.ifmake autopatch
.for _src in ${UUIDHDRS}
-${SYMROOT}/${_src}: uuidsrc/${_src} _AUTOPATCHSYM
-AUTOPATCHHDRS+= ${SYMROOT}/${_src}
+${_cwd}/${_src}: ${_cwd}/uuidsrc/${_src} _AUTOPATCH
+AUTOPATCHHDRS+= ${_cwd}/${_src}
.endfor
+.endif # autopatch
.for _src in ${UUIDMAN3}
-${_src:R}-uuid.${_src:E}: uuidsrc/${_src} _AUTOPATCH
+.ifmake autopatch
+${_cwd}/${_src:R}-uuid.${_src:E}: ${_cwd}/uuidsrc/${_src} _AUTOPATCH
+AUTOPATCHMAN+= ${_cwd}/${_src:R}
+.else # !autopatch
MAN3+= ${_src:R}
-AUTOPATCHMAN+= ${_src:R}
+.endif # autopatch
.endfor
-${UUIDTOMAN:R}-uuid.${UUIDTOMAN:E}: uuidsrc/${UUIDFROMMAN} _AUTOPATCH
+MLINKS+= uuid_generate.3 uuid_generate_random.3 \
+ uuid_generate.3 uuid_generate_time.3
+
+MLINKS+= uuid_unparse.3 uuid_unparse_lower.3 \
+ uuid_unparse.3 uuid_unparse_upper.3
+
+.ifmake autopatch
+${_cwd}/${UUIDTOMAN:R}-uuid.${UUIDTOMAN:E}: ${_cwd}/uuidsrc/${UUIDFROMMAN} _AUTOPATCH
+AUTOPATCHMAN+= ${_cwd}/${UUIDTOMAN:R}
+.else # !autopatch
MAN3+= ${UUIDTOMAN:R}
-AUTOPATCHMAN+= ${UUIDTOMAN:R}
+.endif # autopatch
+
+.endfor # _cwd