Loading...
--- /dev/null
+++ Libc/Libc-320/Makefile.xbs
@@ -0,0 +1,163 @@
+# This is a replacement for bsd.lib.mk for the libc project to get it
+# doing the Right Thing in XBS, which is substantially different than
+# the BSD build system.
+#
+# The main problems arise when libc.a isn't meant to be static, but
+# libc_static.a is. We also build a debug version of the library
+# in addition to shared, static, and profile. Also, we build all
+# versions of libc with debugging enabled, unstripped. The BSD style
+# is to strip every object file after it is built but here, libc.a
+# will get merged into the larger libSystem.dylib, which will eventually
+# be stripped. We also don't build a libc.dylib, since it will be
+# munged into libSystem.dylib.
+#
+# And another difference, B&I wishes to build the 4 incarnations of Libc
+# in parallel on different machines. To do this, we must look at the
+# RC_ProjectName variable (which B&I sets) to determine which of the 4
+# versions of Libc we will be building. Remember that the installhdrs
+# pass should only be invoked on one of the 4 versions, and man pages
+# should only be installed once as well. Both of these get done when
+# we're invoked as "Libc".
+
+.PATH: .
+.MAIN: all
+all: libc.a libc_static.a libc_debug.a libc_profile.a
+install: installhdrs install_libc.a install_libc_static.a \
+ install_libc_profile.a install_libc_debug.a fbsdman maninstall
+
+.SUFFIXES:
+.SUFFIXES: .o .po .So .do .S .s -fbsd.c .c .cc .cpp .cxx .m .C .f .y .l .defs .h
+.SUFFIXES: User.c User.o User.po User.So User.do
+.SUFFIXES: Server.c Server.o Server.po Server.So Server.do
+
+OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
+POBJS+= ${OBJS:.o=.po} ${STATICOBJS:.o=.po}
+SOBJS+= ${OBJS:.o=.So}
+FBSDFLAGS= -I${.CURDIR}/fbsdcompat -include _fbsd_compat_.h
+
+-fbsd.c.o:
+ ${CC} -static ${FBSDFLAGS} ${CFLAGS} -Os -c ${.IMPSRC} -o ${.TARGET}
+.c.o User.cUser.o Server.cServer.o:
+ ${CC} -static ${CFLAGS} -Os -c ${.IMPSRC} -o ${.TARGET}
+-fbsd.c.po:
+ ${CC} -pg -DPROFILE ${FBSDFLAGS} ${CFLAGS} -Os -c ${.IMPSRC} \
+ -o ${.TARGET}
+.c.po User.cUser.po Server.cServer.po:
+ ${CC} -pg -DPROFILE ${CFLAGS} -Os -c ${.IMPSRC} -o ${.TARGET}
+-fbsd.c.So:
+ ${CC} ${FBSDFLAGS} ${CFLAGS} -Os -c ${.IMPSRC} -o ${.TARGET}
+.c.So User.cUser.So Server.cServer.So:
+ ${CC} ${CFLAGS} -Os -c ${.IMPSRC} -o ${.TARGET}
+-fbsd.c.do:
+ ${CC} -g -DDEBUG ${FBSDFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
+.c.do User.cUser.do Server.cServer.do:
+ ${CC} -g -DDEBUG ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
+-fbsd.s.o:
+ ${CC} -x assembler-with-cpp ${FBSDFLAGS} ${CFLAGS:M-[BID]*} \
+ -static ${AINC} -c ${.IMPSRC} -o ${.TARGET}
+.s.o:
+ ${CC} -x assembler-with-cpp ${CFLAGS:M-[BID]*} -static ${AINC} -c \
+ ${.IMPSRC} -o ${.TARGET}
+-fbsd.s.po:
+ ${CC} -pg -DPROFILE -x assembler-with-cpp ${FBSDFLAGS} \
+ ${CFLAGS:M-[BID]*} -Os ${AINC} -c ${.IMPSRC} -o ${.TARGET}
+.s.po:
+ ${CC} -pg -DPROFILE -x assembler-with-cpp ${CFLAGS:M-[BID]*} -Os \
+ ${AINC} -c ${.IMPSRC} -o ${.TARGET}
+-fbsd.s.So:
+ ${CC} -x assembler-with-cpp ${FBSDFLAGS} \
+ ${CFLAGS:M-[BID]*} -Os ${AINC} -c ${.IMPSRC} -o ${.TARGET}
+.s.So:
+ ${CC} -x assembler-with-cpp \
+ ${CFLAGS:M-[BID]*} -Os ${AINC} -c ${.IMPSRC} -o ${.TARGET}
+-fbsd.s.do:
+ ${CC} -DDEBUG -g -x assembler-with-cpp ${FBSDFLAGS} ${CFLAGS:M-[BID]*} \
+ ${AINC} -c ${.IMPSRC} -o ${.TARGET}
+.s.do:
+ ${CC} -DDEBUG -g -x assembler-with-cpp ${CFLAGS:M-[BID]*} ${AINC} -c \
+ ${.IMPSRC} -o ${.TARGET}
+.defs.h .defsUser.c .defsServer.c:
+ mig -arch ${MACHINE_ARCH} -user ${.PREFIX}User.c -server ${.PREFIX}Server.c -header ${.PREFIX}.h ${.IMPSRC}
+
+gen_mig_defs: ${SRVMIGHDRS} ${MIGHDRS}
+gen_md_mig_defs: ${MD_MIGHDRS}
+
+lib${LIB}_static.a:: ${FBSDHDRS} ${OBJS} ${STATICOBJS}
+ @${ECHO} building static ${LIB} library
+ @rm -f lib${LIB}_static.a
+ @${AR} cq lib${LIB}_static.a `lorder ${OBJS} ${STATICOBJS} | tsort -q` ${ARADD}
+ ${RANLIB} lib${LIB}_static.a
+
+lib${LIB}_profile.a:: ${FBSDHDRS} ${POBJS}
+ @${ECHO} building profiled ${LIB} library
+ @rm -f lib${LIB}_profile.a
+ @${AR} cq lib${LIB}_profile.a `lorder ${POBJS} | tsort -q` ${ARADD}
+ ${RANLIB} lib${LIB}_profile.a
+
+DOBJS+= ${OBJS:.o=.do}
+lib${LIB}_debug.a:: ${FBSDHDRS} ${DOBJS}
+ @${ECHO} building debug ${LIB} library
+ @rm -f lib${LIB}_debug.a
+ @${AR} cq lib${LIB}_debug.a `lorder ${DOBJS} | tsort -q` ${ARADD}
+ ${RANLIB} lib${LIB}_debug.a
+
+lib${LIB}.a:: ${FBSDHDRS} ${SOBJS}
+ @${ECHO} building standard ${LIB} library
+ @rm -f lib${LIB}.a
+ @${AR} cq lib${LIB}.a `lorder ${SOBJS} | tsort -q` ${ARADD}
+ ${RANLIB} lib${LIB}.a
+
+CLEANFILES += ${DOBJS} libc_static.a libc_profile.a libc_debug.a
+
+INCDIR = ${DESTDIR}/usr/include
+LOCINCDIR = ${DESTDIR}/usr/local/include
+SYSTEMFRAMEWORK = ${DESTDIR}/System/Library/Frameworks/System.framework
+PRIVHDRS = ${SYSTEMFRAMEWORK}/Versions/B/PrivateHeaders
+
+installhdrs-md: gen_md_mig_defs
+ mkdir -p ${INCDIR}/mach/${MACHINE_ARCH}
+ ${INSTALL} -c -m 444 ${MD_MIGHDRS} ${INCDIR}/mach/${MACHINE_ARCH}
+
+installhdrs: ${FBSDHDRS} gen_mig_defs
+ mkdir -p ${INCDIR}/arpa
+ mkdir -p ${INCDIR}/mach
+ mkdir -p ${INCDIR}/malloc
+ mkdir -p ${INCDIR}/objc
+ mkdir -p ${INCDIR}/protocols
+ mkdir -p ${INCDIR}/servers
+ ${INSTALL} -c -m 444 ${INSTHDRS} ${INCDIR}
+ ${INSTALL} -c -m 444 ${ARPA_INSTHDRS} ${INCDIR}/arpa
+ ${INSTALL} -c -m 444 ${MACH_INSTHDRS} ${INCDIR}/mach
+ ${INSTALL} -c -m 444 ${MALLOC_INSTHDRS} ${INCDIR}/malloc
+ ${INSTALL} -c -m 444 ${OBJC_INSTHDRS} ${INCDIR}/objc
+ ${INSTALL} -c -m 444 ${PROTO_INSTHDRS} ${INCDIR}/protocols
+ ${INSTALL} -c -m 444 ${SRVHDRS} ${INCDIR}/servers
+ mkdir -p ${LOCINCDIR}
+ ${INSTALL} -c -m 444 ${LOCALHDRS} ${LOCINCDIR}
+ mkdir -p ${PRIVHDRS}/architecture/ppc
+ mkdir -p ${PRIVHDRS}/btree
+ mkdir -p ${PRIVHDRS}/machine
+ mkdir -p ${PRIVHDRS}/objc
+ ${INSTALL} -c -m 444 ${SRCROOT}/ppc/sys/processor_facilities.h ${PRIVHDRS}/architecture/ppc
+ ${INSTALL} -c -m 444 ${SRCROOT}/db/btree/btree.h ${PRIVHDRS}/btree
+ ${INSTALL} -c -m 444 ${SRCROOT}/db/btree/bt_extern.h ${PRIVHDRS}/btree
+ ${INSTALL} -c -m 444 ${SRCROOT}/internat/NXCType.h ${PRIVHDRS}/objc
+ ${INSTALL} -c -m 444 ${SRCROOT}/gen/stack_logging.h ${PRIVHDRS}
+ mv ${DESTDIR}/usr/include/asm.h ${PRIVHDRS}/machine
+ mv ${INCDIR}/servers/srvbootstrap.h ${INCDIR}/servers/bootstrap.h
+
+install_lib${LIB}_static.a:
+ ${INSTALL} -c -m 444 lib${LIB}_static.a ${DESTDIR}/usr/local/lib/system/
+install_lib${LIB}_profile.a:
+ ${INSTALL} -c -m 444 lib${LIB}_profile.a ${DESTDIR}/usr/local/lib/system
+install_lib${LIB}_debug.a:
+ ${INSTALL} -c -m 444 lib${LIB}_debug.a ${DESTDIR}/usr/local/lib/system/
+install_lib${LIB}.a:
+ ${INSTALL} -c -m 444 lib${LIB}.a ${DESTDIR}/usr/local/lib/system/
+
+fbsdman: ${FBSDPATCHMAN}
+
+clean:
+ rm -f ${OBJS} ${POBJS} ${DOBJS} ${SOBJS} ${CLEANFILES}
+ rm -f lib${LIB}.a lib${LIB}_static.a lib${LIB}_profile.a \
+ lib${LIB}_debug.a