# Copyright 2000, International Business Machines Corporation and others. # All Rights Reserved. # # This software has been released under the terms of the IBM Public # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html # $Header$ # # MakefileProto for Digital Unix systems # srcdir=@srcdir@ include @TOP_OBJDIR@/src/config/Makefile.config INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ # OS specific object files: AFS_OS_OBJS = \ osi_misc.o \ osi_file.o \ osi_inode.o \ osi_groups.o \ osi_sleep.o \ osi_vm.o \ osi_vnodeops.o \ osi_module.o #AFS_OS_NFSOBJS = osi_vfsops_nfs.o AFS_OS_NONFSOBJS = osi_vfsops.o # System specific build commands and flags KDEFS= DBUG = DEFINES= -D_KERNEL -DKERNEL -DKERNEL_PRIVATE -DDIAGNOSTIC -DUSE_SELECT -DMACH_USER_API -DMACH_KERNEL KOPTS_DBUG=-g KOPTS_DBUG=-ggdb KOPTS_ppc=-static -nostdinc -nostdlib -fno-builtin -finline -fno-keep-inline-functions -msoft-float -mlong-branch -fsigned-bitfields -arch ppc -Dppc -DPPC -D__PPC__ -DPAGE_SIZE_FIXED -mcpu=750 -mmultiple -fschedule-insns -force_cpusubtype_ALL KOPTS_x86=-static -nostdinc -nostdlib -fno-builtin -finline -fno-keep-inline-functions -msoft-float -mlong-branch -fsigned-bitfields -arch i386 -Di386 -DI386 -D__I386__ -DPAGE_SIZE_FIXED -march=i686 -mpreferred-stack-boundary=2 -falign-functions=4 ARCH_ppc=$(shell echo "${ARCHFLAGS}" | grep -q -w ppc && echo yes) ARCH_x86=$(shell echo "${ARCHFLAGS}" | grep -q -w i386 && echo yes) ifeq ($(ARCH_ppc),yes) ifeq ($(ARCH_x86),yes) MODLD=$(CC) -static $(KOPTS_DBUG) -nostdlib -arch ppc -arch i386 CFLAGS_ppc=${KINCLUDES} -I. -I.. -I${TOP_OBJDIR}/src/config $(DEFINES) $(KDEFS) $(KOPTS_ppc) $(KOPTS_DBUG) CFLAGS_x86=${KINCLUDES} -I. -I.. -I${TOP_OBJDIR}/src/config $(DEFINES) $(KDEFS) $(KOPTS_x86) $(KOPTS_DBUG) else MODLD=$(CC) -static $(KOPTS_DBUG) -nostdlib -arch ppc KOPTS=$(KOPTS_ppc) CFLAGS=${KINCLUDES} -I. -I.. -I${TOP_OBJDIR}/src/config $(DEFINES) $(KDEFS) $(KOPTS) endif else ifeq ($(ARCH_x86),yes) MODLD=$(CC) -static $(KOPTS_DBUG) -nostdlib -arch i386 KOPTS=$(KOPTS_x86) else _ARCH=$(shell arch) MODLD=$(CC) -static $(KOPTS_DBUG) -nostdlib -arch $(_ARCH) KOPTS=$(KOPTS_$(shell echo $(_ARCH) | sed 's/i386/x86/')) endif CFLAGS=${KINCLUDES} -I. -I.. -I${TOP_OBJDIR}/src/config $(DEFINES) $(KDEFS) $(KOPTS) endif MODLD=$(LD) CFLAGS=${KINCLUDES} -I. -I.. -I${TOP_OBJDIR}/src/config $(DEFINES) $(KDEFS) $(KOPTS) KOPTS=-static -fno-common -finline -fno-keep-inline-functions -force_cpusubtype_ALL -msoft-float -mlong-branch KOPTS=-no-cpp-precomp -static -fno-common -finline -fno-keep-inline-functions -force_cpusubtype_ALL -msoft-float -mlong-branch KOPTS=-no-precomp -static -fno-common -finline -fno-keep-inline-functions -force_cpusubtype_ALL -msoft-float -mlong-branch KINCLUDES=-I${KROOT}/System/Library/Frameworks/Kernel.framework/Headers # Name of directory to hold object files and libraries. KOBJ = MODLOAD # This tells Makefile.common to use it's single directory build target. COMPDIRS = single_compdir INSTDIRS = single_instdir DESTDIRS = single_destdir include Makefile.common ifeq ($(ARCH_ppc),yes) ifeq ($(ARCH_x86),yes) # override suffix rule; unfortunately, this causes a warning message .c.o: $(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(CFLAGS_ppc) $(CFLAGS-$@) -o $(patsubst %.o,%.ppc.o,$@) -c $< $(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(CFLAGS_x86) $(CFLAGS-$@) -o $(patsubst %.o,%.x86.o,$@) -c $< lipo -create $(patsubst %.o,%.ppc.o,$@) $(patsubst %.o,%.x86.o,$@) -output $@ CRULE_NOOPT= \ $(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(CFLAGS_ppc) $(CFLAGS-$@) -o $(patsubst %.o,%.ppc.o,$@) -c $? && \ $(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(CFLAGS_x86) $(CFLAGS-$@) -o $(patsubst %.o,%.x86.o,$@) -c $? && \ lipo -create $(patsubst %.o,%.ppc.o,$@) $(patsubst %.o,%.x86.o,$@) -output $@ CRULE_OPT= \ $(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(KERN_OPTMZ) $(CFLAGS_ppc) $(CFLAGS-$@) -o $(patsubst %.o,%.ppc.o,$@) -c $? && \ $(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(KERN_OPTMZ) $(CFLAGS_x86) $(CFLAGS-$@) -o $(patsubst %.o,%.x86.o,$@) -c $? && \ lipo -create $(patsubst %.o,%.ppc.o,$@) $(patsubst %.o,%.x86.o,$@) -output $@ endif endif setup: -mkdir $(KOBJ) -$(RM) $(KOBJ)/Makefile $(KOBJ)/Makefile.common $(KOBJ)/config ln -fs ../Makefile $(KOBJ)/Makefile ln -fs ../Makefile.common $(KOBJ)/Makefile.common ln -fs ../config $(KOBJ)/config -$(RM) -f h rpc -ln -fs $(KROOT)/System/Library/Frameworks/Kernel.framework/Headers/sys h -ln -fs /usr/include/rpc rpc # Below this line are targets when in the COMMON directory: LIBAFS = libafs.o LIBAFSNONFS = libafs.nonfs.o INST_LIBAFS = ${DESTDIR}${afskerneldir}/afs-nfs.kext INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/afs.kext DEST_LIBAFS = ${DEST}/root.client/usr/vice/etc/afs-nfs.kext DEST_LIBAFSNONFS = ${DEST}/root.client/usr/vice/etc/afs.kext libafs: $(LIBAFSNONFS) ; install_libafs: $(LIBAFSNONFS) ; -mkdir -p ${INST_LIBAFSNONFS} -mkdir -p ${INST_LIBAFSNONFS}/Contents $(INSTALL) -m 644 ../${DARWIN_INFOFILE} ${INST_LIBAFSNONFS}/Contents/Info.plist -mkdir -p ${INST_LIBAFSNONFS}/Contents/MacOS $(INSTALL) -m 644 ${LIBAFSNONFS} ${INST_LIBAFSNONFS}/Contents/MacOS/afs dest_libafs: $(LIBAFSNONFS) ; -mkdir -p ${DEST_LIBAFSNONFS} -mkdir -p ${DEST_LIBAFSNONFS}/Contents $(INSTALL) -m 644 ../${DARWIN_INFOFILE} ${DEST_LIBAFSNONFS}/Contents/Info.plist -mkdir -p ${DEST_LIBAFSNONFS}/Contents/MacOS $(INSTALL) -m 644 ${LIBAFSNONFS} ${DEST_LIBAFSNONFS}/Contents/MacOS/afs ${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS) $(MODLD) -r -o ${LIBAFS} ${AFSAOBJS} ${AFSNFSOBJS} -lcc_kext dsymutil -o ${LIBAFS}.dSYM ${LIBAFS} ${LIBAFSNONFS}: $(AFSAOBJS) $(AFSNONFSOBJS) $(MODLD) -r -o ${LIBAFSNONFS} ${AFSAOBJS} ${AFSNONFSOBJS} -lcc_kext dsymutil -o ${LIBAFSNONFS}.dSYM ${LIBAFSNONFS}