# For the NetBSD auto patching mechanism and compatibility environment # setup, original NetBSD sources a put into a NetBSD subdirectory. # If a file with the same name, but suffix ".patch" is in that directory, # that patch will be applied before use. # # The NBSDMDSRCS, NBSDMISRCS, NBSDORIGHDRS and NBSDSRCS variables must be set, # and bracketed by .include of Makefile.nbsd_begin and Makefile.nbsd_end # # Set up dependencies between the NetBSD source (in a NetBSD subdirectory) # and a file with a -nbsd.x suffix (where x is 'c' or 's'). The suffix # rules will then compile the file with the simulate NetBSD environment. NBSDSECTIONS= 1 2 3 4 5 6 7 8 9 # This .for statement forces evaluation of ${CWD} .for _cwd in ${CWD} .for _src in ${NBSDSRCS} .ifmake autopatch ${_cwd}/${_src:R}-nbsd.${_src:E}: ${_cwd}/NetBSD/${_src} _AUTOPATCH AUTOPATCHSRCS+= ${_cwd}/${_src:R}-nbsd.${_src:E} .else # !autopatch SRCS+= ${_src} .endif # autopatch .endfor .for _src in ${NBSDMDSRCS} .ifmake autopatch ${_cwd}/${_src:R}-nbsd.${_src:E}: ${_cwd}/NetBSD/${_src} _AUTOPATCH AUTOPATCHSRCS+= ${_cwd}/${_src:R}-nbsd.${_src:E} .else # !autopatch MDSRCS+= ${_src} .endif # autopatch .endfor .for _src in ${NBSDMISRCS} .ifmake autopatch ${_cwd}/${_src:R}-nbsd.${_src:E}: ${_cwd}/NetBSD/${_src} _AUTOPATCH AUTOPATCHSRCS+= ${_cwd}/${_src:R}-nbsd.${_src:E} .else # !autopatch MISRCS+= ${_src} .endif # autopatch .endfor .ifmake autopatch .for _src in ${NBSDHDRS} ${_cwd}/${_src}: ${_cwd}/NetBSD/${_src} _AUTOPATCH AUTOPATCHHDRS+= ${_cwd}/${_src} .endfor .endif # autopatch .for _sect in ${NBSDSECTIONS} .for _src in ${NBSDMAN${_sect}} .ifmake autopatch ${_cwd}/${_src}: ${_cwd}/NetBSD/${_src} _AUTOPATCH AUTOPATCHMAN+= ${_cwd}/${_src} .else # !autopatch MAN${_sect}+= ${_src} .endif # autopatch .endfor .endfor .endfor # _cwd