1 # For the FreeBSD auto patching mechanism and compatibility environment
2 # setup, original FreeBSD sources a put into a FreeBSD subdirectory.
3 # If a file with the same name, but suffix ".patch" is in that directory,
4 # that patch will be applied before use.
6 # The FBSDMDSRCS, FBSDMISRCS, FBSDORIGHDRS and FBSDSRCS variables must be set,
7 # and bracketed by .include of Makefile.fbsd_begin and Makefile.fbsd_end
9 # Set up dependencies between the FreeBSD source (in a FreeBSD subdirectory)
10 # and a file with a -fbsd.x suffix (where x is 'c' or 's'). The suffix
11 # rules will then compile the file with the simulate FreeBSD environment.
13 FBSDSECTIONS= 1 2 3 4 5 6 7 8 9
15 # This .for statement forces evaluation of ${_cwd}
18 .for _src in ${FBSDSRCS}
20 ${_cwd}/${_src:R}-fbsd.${_src:E}: ${_cwd}/FreeBSD/${_src} _AUTOPATCH
21 AUTOPATCHSRCS+= ${_cwd}/${_src:R}-fbsd.${_src:E}
27 .for _src in ${FBSDMDSRCS}
29 ${_cwd}/${_src:R}-fbsd.${_src:E}: ${_cwd}/FreeBSD/${_src} _AUTOPATCH
30 AUTOPATCHSRCS+= ${_cwd}/${_src:R}-fbsd.${_src:E}
36 .for _src in ${FBSDMISRCS}
38 ${_cwd}/${_src:R}-fbsd.${_src:E}: ${_cwd}/FreeBSD/${_src} _AUTOPATCH
39 AUTOPATCHSRCS+= ${_cwd}/${_src:R}-fbsd.${_src:E}
45 # FBSDPATCHSRCS are for source that need patching, but don't build
46 # in base variant (only in other variants)
48 .for _src in ${FBSDPATCHSRCS}
49 ${_cwd}/${_src:R}-fbsd.${_src:E}: ${_cwd}/FreeBSD/${_src} _AUTOPATCH
50 AUTOPATCHSRCS+= ${_cwd}/${_src:R}-fbsd.${_src:E}
55 .for _src in ${FBSDHDRS}
56 ${_cwd}/${_src}: ${_cwd}/FreeBSD/${_src} _AUTOPATCH
57 AUTOPATCHHDRS+= ${_cwd}/${_src}
61 .for _sect in ${FBSDSECTIONS}
62 .for _src in ${FBSDMAN${_sect}}
64 ${_cwd}/${_src}: ${_cwd}/FreeBSD/${_src} _AUTOPATCH
65 AUTOPATCHMAN+= ${_cwd}/${_src}