]>
Commit | Line | Data |
---|---|---|
9385eb3d A |
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. | |
5 | # | |
6 | # The FBSDMDSRCS, FBSDMISRCS, FBSDORIGHDRS and FBSDSRCS variables must be set, | |
7 | # and bracketed by .include of Makefile.fbsd_begin and Makefile.fbsd_end | |
8 | # | |
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. | |
12 | ||
13 | FBSDSECTIONS= 1 2 3 4 5 6 7 8 9 | |
14 | ||
b5d655f7 A |
15 | # This .for statement forces evaluation of ${_cwd} |
16 | .for _cwd in ${CWD} | |
17 | ||
9385eb3d | 18 | .for _src in ${FBSDSRCS} |
224c7076 | 19 | .ifmake autopatch |
b5d655f7 A |
20 | ${_cwd}/${_src:R}-fbsd.${_src:E}: ${_cwd}/FreeBSD/${_src} _AUTOPATCH |
21 | AUTOPATCHSRCS+= ${_cwd}/${_src:R}-fbsd.${_src:E} | |
224c7076 | 22 | .else # !autopatch |
9385eb3d | 23 | SRCS+= ${_src} |
224c7076 | 24 | .endif # autopatch |
9385eb3d A |
25 | .endfor |
26 | ||
27 | .for _src in ${FBSDMDSRCS} | |
224c7076 | 28 | .ifmake autopatch |
b5d655f7 A |
29 | ${_cwd}/${_src:R}-fbsd.${_src:E}: ${_cwd}/FreeBSD/${_src} _AUTOPATCH |
30 | AUTOPATCHSRCS+= ${_cwd}/${_src:R}-fbsd.${_src:E} | |
224c7076 | 31 | .else # !autopatch |
9385eb3d | 32 | MDSRCS+= ${_src} |
224c7076 | 33 | .endif # autopatch |
9385eb3d A |
34 | .endfor |
35 | ||
36 | .for _src in ${FBSDMISRCS} | |
224c7076 | 37 | .ifmake autopatch |
b5d655f7 A |
38 | ${_cwd}/${_src:R}-fbsd.${_src:E}: ${_cwd}/FreeBSD/${_src} _AUTOPATCH |
39 | AUTOPATCHSRCS+= ${_cwd}/${_src:R}-fbsd.${_src:E} | |
224c7076 | 40 | .else # !autopatch |
9385eb3d | 41 | MISRCS+= ${_src} |
224c7076 | 42 | .endif # autopatch |
9385eb3d A |
43 | .endfor |
44 | ||
224c7076 A |
45 | # FBSDPATCHSRCS are for source that need patching, but don't build |
46 | # in base variant (only in other variants) | |
47 | .ifmake autopatch | |
48 | .for _src in ${FBSDPATCHSRCS} | |
b5d655f7 A |
49 | ${_cwd}/${_src:R}-fbsd.${_src:E}: ${_cwd}/FreeBSD/${_src} _AUTOPATCH |
50 | AUTOPATCHSRCS+= ${_cwd}/${_src:R}-fbsd.${_src:E} | |
224c7076 A |
51 | .endfor |
52 | .endif # autopatch | |
53 | ||
54 | .ifmake autopatch | |
59e0d9fe | 55 | .for _src in ${FBSDHDRS} |
b5d655f7 A |
56 | ${_cwd}/${_src}: ${_cwd}/FreeBSD/${_src} _AUTOPATCH |
57 | AUTOPATCHHDRS+= ${_cwd}/${_src} | |
9385eb3d | 58 | .endfor |
224c7076 | 59 | .endif # autopatch |
9385eb3d A |
60 | |
61 | .for _sect in ${FBSDSECTIONS} | |
62 | .for _src in ${FBSDMAN${_sect}} | |
224c7076 | 63 | .ifmake autopatch |
b5d655f7 A |
64 | ${_cwd}/${_src}: ${_cwd}/FreeBSD/${_src} _AUTOPATCH |
65 | AUTOPATCHMAN+= ${_cwd}/${_src} | |
224c7076 A |
66 | .else # !autopatch |
67 | MAN${_sect}+= ${_src} | |
68 | .endif # autopatch | |
9385eb3d A |
69 | .endfor |
70 | .endfor | |
b5d655f7 A |
71 | |
72 | .endfor # _cwd |