]> git.saurik.com Git - apple/libc.git/blob - Makefile.fbsd_end
Libc-320.1.3.tar.gz
[apple/libc.git] / Makefile.fbsd_end
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
15 .if !target(_FBSDPATCH)
16 _FBSDPATCH: .USE
17 @if [ -f ${.ALLSRC}.patch ]; then \
18 echo cp ${.ALLSRC} ${.TARGET}; \
19 cp ${.ALLSRC} ${.TARGET}; \
20 echo patch ${.TARGET} ${.ALLSRC}.patch; \
21 patch ${.TARGET} ${.ALLSRC}.patch; \
22 else \
23 echo ln -s ${.ALLSRC} ${.TARGET}; \
24 ln -s ${.ALLSRC} ${.TARGET}; \
25 fi
26 .endif
27 .if !target(_FBSDPATCH)
28 _FBSDPATCH: .USE
29 cp ${.ALLSRC} ${.TARGET}; \
30 patch ${.TARGET} ${.ALLSRC}.patch
31 .endif
32
33 .for _src in ${FBSDSRCS}
34 ${_src:R}-fbsd.${_src:E}: FreeBSD/${_src} _FBSDPATCH
35 SRCS+= ${_src}
36 .endfor
37
38 .for _src in ${FBSDMDSRCS}
39 ${_src:R}-fbsd.${_src:E}: FreeBSD/${_src} _FBSDPATCH
40 MDSRCS+= ${_src}
41 .endfor
42
43 .for _src in ${FBSDMISRCS}
44 ${_src:R}-fbsd.${_src:E}: FreeBSD/${_src} _FBSDPATCH
45 MISRCS+= ${_src}
46 .endfor
47
48 .for _src in ${FBSDORIGHDRS}
49 ${_src}: FreeBSD/${_src} _FBSDPATCH
50 FBSDHDRS+= ${_src}
51 .endfor
52
53 .for _sect in ${FBSDSECTIONS}
54 .for _src in ${FBSDMAN${_sect}}
55 ${_src}: FreeBSD/${_src} _FBSDPATCH
56 MAN${_sect}+= ${_src}
57 FBSDPATCHMAN+= ${_src}
58 .endfor
59 .endfor