Loading...
--- /dev/null
+++ Libc/Libc-498/Makefile.fbsd_end
@@ -0,0 +1,67 @@
+# For the FreeBSD auto patching mechanism and compatibility environment
+# setup, original FreeBSD sources a put into a FreeBSD subdirectory.
+# If a file with the same name, but suffix ".patch" is in that directory,
+# that patch will be applied before use.
+#
+# The FBSDMDSRCS, FBSDMISRCS, FBSDORIGHDRS and FBSDSRCS variables must be set,
+# and bracketed by .include of Makefile.fbsd_begin and Makefile.fbsd_end
+#
+# Set up dependencies between the FreeBSD source (in a FreeBSD subdirectory)
+# and a file with a -fbsd.x suffix (where x is 'c' or 's'). The suffix
+# rules will then compile the file with the simulate FreeBSD environment.
+
+FBSDSECTIONS= 1 2 3 4 5 6 7 8 9
+
+.for _src in ${FBSDSRCS}
+.ifmake autopatch
+${_src:R}-fbsd.${_src:E}: FreeBSD/${_src} _AUTOPATCHCUR
+AUTOPATCHSRCS+= ${_src:R}-fbsd.${_src:E}
+.else # !autopatch
+SRCS+= ${_src}
+.endif # autopatch
+.endfor
+
+.for _src in ${FBSDMDSRCS}
+.ifmake autopatch
+${_src:R}-fbsd.${_src:E}: FreeBSD/${_src} _AUTOPATCHCUR
+AUTOPATCHSRCS+= ${_src:R}-fbsd.${_src:E}
+.else # !autopatch
+MDSRCS+= ${_src}
+.endif # autopatch
+.endfor
+
+.for _src in ${FBSDMISRCS}
+.ifmake autopatch
+${_src:R}-fbsd.${_src:E}: FreeBSD/${_src} _AUTOPATCHCUR
+AUTOPATCHSRCS+= ${_src:R}-fbsd.${_src:E}
+.else # !autopatch
+MISRCS+= ${_src}
+.endif # autopatch
+.endfor
+
+# FBSDPATCHSRCS are for source that need patching, but don't build
+# in base variant (only in other variants)
+.ifmake autopatch
+.for _src in ${FBSDPATCHSRCS}
+${_src:R}-fbsd.${_src:E}: FreeBSD/${_src} _AUTOPATCHCUR
+AUTOPATCHSRCS+= ${_src:R}-fbsd.${_src:E}
+.endfor
+.endif # autopatch
+
+.ifmake autopatch
+.for _src in ${FBSDHDRS}
+${_src}: FreeBSD/${_src} _AUTOPATCHCUR
+AUTOPATCHHDRS+= ${_src}
+.endfor
+.endif # autopatch
+
+.for _sect in ${FBSDSECTIONS}
+.for _src in ${FBSDMAN${_sect}}
+.ifmake autopatch
+${_src}: FreeBSD/${_src} _AUTOPATCH
+AUTOPATCHMAN+= ${_src}
+.else # !autopatch
+MAN${_sect}+= ${_src}
+.endif # autopatch
+.endfor
+.endfor