BSDMAKE = bsdmake -f Makefile .PATH: . .MAIN: all all: lib${LIB}.a lib${LIB}_static.a lib${LIB}_debug.a lib${LIB}_profile.a install: installhdrs install_lib${LIB}.a install_lib${LIB}_static.a \ install_lib${LIB}_profile.a install_lib${LIB}_debug.a maninstall .SUFFIXES: .SUFFIXES: .o .po .So .do .SUFFIXES: .S .s .c .cc .cpp .cxx .m .C .SUFFIXES: .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} DOBJS+= ${OBJS:.o=.do} POBJS+= ${OBJS:.o=.po} ${STATICOBJS:.o=.po} SOBJS+= ${OBJS:.o=.So} #### Standard C Rules ################################################# .c.o User.cUser.o Server.cServer.o: ${CC} -static ${PRECFLAGS-${.IMPSRC:T}} ${CFLAGS} \ ${CFLAGS-${.IMPSRC:T}} -Os ${OPTIMIZE-${.IMPSRC:T}} \ -c ${.IMPSRC} -o ${.TARGET} .c.po User.cUser.po Server.cServer.po: ${CC} -pg ${PRECFLAGS-${.IMPSRC:T}} -DPROFILE ${CFLAGS} \ ${CFLAGS-${.IMPSRC:T}} -Os ${OPTIMIZE-${.IMPSRC:T}} \ -c ${.IMPSRC} -o ${.TARGET} .c.So User.cUser.So Server.cServer.So: ${CC} ${PRECFLAGS-${.IMPSRC:T}} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \ -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} .c.do User.cUser.do Server.cServer.do: ${CC} -g ${PRECFLAGS-${.IMPSRC:T}} -DDEBUG ${CFLAGS} \ ${CFLAGS-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} #### Standard Assembler Rules ######################################### .s.o .S.o: ${CC} -static -x assembler-with-cpp ${PRECFLAGS-${.IMPSRC:T}} \ ${AINC} ${CFLAGS:M-[BIDFU]*} ${CFLAGS-${.IMPSRC:T}:M-[BIDFU]*} \ -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} .s.po .S.po: ${CC} -pg -x assembler-with-cpp ${PRECFLAGS-${.IMPSRC:T}} -DPROFILE \ ${AINC} ${CFLAGS:M-[BIDFU]*} ${CFLAGS-${.IMPSRC:T}:M-[BIDFU]*} \ -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} .s.So .S.So: ${CC} -x assembler-with-cpp ${PRECFLAGS-${.IMPSRC:T}} \ ${AINC} ${CFLAGS:M-[BIDFU]*} ${CFLAGS-${.IMPSRC:T}:M-[BIDFU]*} \ -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} .s.do .S.do: ${CC} -g -x assembler-with-cpp ${PRECFLAGS-${.IMPSRC:T}} -DDEBUG \ ${AINC} ${CFLAGS:M-[BIDFU]*} ${CFLAGS-${.IMPSRC:T}:M-[BIDFU]*} \ -c ${.IMPSRC} -o ${.TARGET} #### mig Rules ######################################################## .defs.h .defsUser.c .defsServer.c: mig -arch ${MACHINE_ARCH} -cc ${CC} -user ${.PREFIX}User.c -server ${.PREFIX}Server.c -header ${.PREFIX}.h ${.IMPSRC} gen_mig_defs: ${SRVMIGHDRS} ${MIGHDRS} gen_md_mig_defs: ${MD_MIGHDRS} #### Library Rules #################################################### lib${LIB}_static.a:: ${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:: ${POBJS} ${POBJS2} @${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 lib${LIB}_debug.a:: ${DOBJS} ${DOBJS2} @${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:: ${SOBJS} ${SOBJS2} @${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} lib${LIB}_static.a lib${LIB}_profile.a lib${LIB}_debug.a INCDIR = ${DESTDIR}/usr/include LOCINCDIR = ${DESTDIR}/usr/local/include SYSTEMFRAMEWORK = ${DESTDIR}/System/Library/Frameworks/System.framework PRIVHDRS = ${SYSTEMFRAMEWORK}/Versions/B/PrivateHeaders PRIVHDRSPPC = ${PRIVHDRS}/architecture/ppc KERNELFRAMEWORK = ${DESTDIR}/System/Library/Frameworks/Kernel.framework PRIVKERNELHDRS = ${KERNELFRAMEWORK}/Versions/A/PrivateHeaders installhdrs-md: gen_md_mig_defs mkdir -p ${INCDIR}/mach/${MACHINE_ARCH} ${INSTALL} -o 0 -c -m 444 ${MD_MIGHDRS} ${INCDIR}/mach/${MACHINE_ARCH} mkdir -p ${PRIVHDRSPPC} ${INSTALL} -c -m 444 ${PRIVHDRSPPCHDRS} ${PRIVHDRSPPC} installhdrs: gen_mig_defs mkdir -p ${INCDIR}/mach mkdir -p ${INCDIR}/servers ${INSTALL} -o 0 -c -m 444 ${MACH_INSTHDRS} ${INCDIR}/mach ${INSTALL} -o 0 -c -m 444 ${SRVHDRS} ${INCDIR}/servers @for i in `find ${DESTDIR}/usr/include/mach ${DESTDIR}/usr/include/servers -name \*.h`; do \ x=`fgrep '' $$i | uniq -d`; \ if [ -n "$$x" ]; then \ echo patching $$i; \ ed - $$i < ${SRCROOT}/libsyscall/fixdups.ed; \ fi; \ done 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/ 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