1 # Copyright 2000, International Business Machines Corporation and others.
4 # This software has been released under the terms of the IBM Public
5 # License. For details, see the LICENSE file in the top-level source
6 # directory or online at http://www.openafs.org/dl/license10.html
9 # MakefileProto for Digital Unix systems
12 include @TOP_OBJDIR@/src/config/Makefile.config
15 # OS specific object files:
27 #AFS_OS_NFSOBJS = osi_vfsops_nfs.o
29 AFS_OS_NONFSOBJS = osi_vfsops.o
32 # System specific build commands and flags
35 DEFINES= -D_KERNEL -DKERNEL -DKERNEL_PRIVATE -DDIAGNOSTIC -DUSE_SELECT -DMACH_USER_API -DMACH_KERNEL
36 <ppc_darwin_80 x86_darwin_80 ppc_darwin_90 x86_darwin_90>
37 KOPTS_ppc=-static -g -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
38 KOPTS_x86=-static -g -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
39 ARCH_ppc=$(shell echo "${ARCHFLAGS}" | grep -q -w ppc && echo yes)
40 ARCH_x86=$(shell echo "${ARCHFLAGS}" | grep -q -w i386 && echo yes)
41 ifeq ($(ARCH_ppc),yes)
42 ifeq ($(ARCH_x86),yes)
43 MODLD=$(CC) -static -g -nostdlib -arch ppc -arch i386
44 CFLAGS_ppc=${KINCLUDES} -I. -I.. -I${TOP_OBJDIR}/src/config $(DEFINES) $(KDEFS) $(KOPTS_ppc)
45 CFLAGS_x86=${KINCLUDES} -I. -I.. -I${TOP_OBJDIR}/src/config $(DEFINES) $(KDEFS) $(KOPTS_x86)
47 MODLD=$(CC) -static -g -nostdlib -arch ppc
49 CFLAGS=${KINCLUDES} -I. -I.. -I${TOP_OBJDIR}/src/config $(DEFINES) $(KDEFS) $(KOPTS)
52 ifeq ($(ARCH_x86),yes)
53 MODLD=$(CC) -static -g -nostdlib -arch i386
57 MODLD=$(CC) -static -g -nostdlib -arch $(_ARCH)
58 KOPTS=$(KOPTS_$(shell echo $(_ARCH) | sed 's/i386/x86/'))
60 CFLAGS=${KINCLUDES} -I. -I.. -I${TOP_OBJDIR}/src/config $(DEFINES) $(KDEFS) $(KOPTS)
62 <all -ppc_darwin_80 -x86_darwin_80 -ppc_darwin_90 -x86_darwin_90>
64 CFLAGS=${KINCLUDES} -I. -I.. -I${TOP_OBJDIR}/src/config $(DEFINES) $(KDEFS) $(KOPTS)
66 KOPTS=-static -fno-common -finline -fno-keep-inline-functions -force_cpusubtype_ALL -msoft-float -mlong-branch
68 KOPTS=-no-cpp-precomp -static -fno-common -finline -fno-keep-inline-functions -force_cpusubtype_ALL -msoft-float -mlong-branch
69 <ppc_darwin_14 ppc_darwin_13 ppc_darwin_12>
70 KOPTS=-no-precomp -static -fno-common -finline -fno-keep-inline-functions -force_cpusubtype_ALL -msoft-float -mlong-branch
72 KINCLUDES=-I${KROOT}/System/Library/Frameworks/Kernel.framework/Headers
75 # Name of directory to hold object files and libraries.
78 # This tells Makefile.common to use it's single directory build target.
79 COMPDIRS = single_compdir
80 INSTDIRS = single_instdir
81 DESTDIRS = single_destdir
83 include Makefile.common
85 <ppc_darwin_80 x86_darwin_80 ppc_darwin_90 x86_darwin_90>
86 ifeq ($(ARCH_ppc),yes)
87 ifeq ($(ARCH_x86),yes)
88 # override suffix rule; unfortunately, this causes a warning message
90 $(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(CFLAGS_ppc) $(CFLAGS-$@) -o $(patsubst %.o,%.ppc.o,$@) -c $<
91 $(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(CFLAGS_x86) $(CFLAGS-$@) -o $(patsubst %.o,%.x86.o,$@) -c $<
92 lipo -create $(patsubst %.o,%.ppc.o,$@) $(patsubst %.o,%.x86.o,$@) -output $@
94 $(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(CFLAGS_ppc) $(CFLAGS-$@) -o $(patsubst %.o,%.ppc.o,$@) -c $? && \
95 $(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(CFLAGS_x86) $(CFLAGS-$@) -o $(patsubst %.o,%.x86.o,$@) -c $? && \
96 lipo -create $(patsubst %.o,%.ppc.o,$@) $(patsubst %.o,%.x86.o,$@) -output $@
98 $(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(KERN_OPTMZ) $(CFLAGS_ppc) $(CFLAGS-$@) -o $(patsubst %.o,%.ppc.o,$@) -c $? && \
99 $(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(KERN_OPTMZ) $(CFLAGS_x86) $(CFLAGS-$@) -o $(patsubst %.o,%.x86.o,$@) -c $? && \
100 lipo -create $(patsubst %.o,%.ppc.o,$@) $(patsubst %.o,%.x86.o,$@) -output $@
107 -$(RM) $(KOBJ)/Makefile $(KOBJ)/Makefile.common $(KOBJ)/config
108 ln -fs ../Makefile $(KOBJ)/Makefile
109 ln -fs ../Makefile.common $(KOBJ)/Makefile.common
110 ln -fs ../config $(KOBJ)/config
112 -ln -fs $(KROOT)/System/Library/Frameworks/Kernel.framework/Headers/sys h
113 -ln -fs /usr/include/rpc rpc
116 # Below this line are targets when in the COMMON directory:
118 LIBAFSNONFS = libafs.nonfs.o
120 INST_LIBAFS = ${DESTDIR}${afskerneldir}/afs-nfs.kext
121 INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/afs.kext
122 DEST_LIBAFS = ${DEST}/root.client/usr/vice/etc/afs-nfs.kext
123 DEST_LIBAFSNONFS = ${DEST}/root.client/usr/vice/etc/afs.kext
126 libafs: $(LIBAFSNONFS) ;
127 install_libafs: $(LIBAFSNONFS) ;
128 -mkdir -p ${INST_LIBAFSNONFS}
129 -mkdir -p ${INST_LIBAFSNONFS}/Contents
130 $(INSTALL) -f ../${DARWIN_INFOFILE} ${INST_LIBAFSNONFS}/Contents/Info.plist
131 -mkdir -p ${INST_LIBAFSNONFS}/Contents/MacOS
132 $(INSTALL) -f ${LIBAFSNONFS} ${INST_LIBAFSNONFS}/Contents/MacOS/afs
134 dest_libafs: $(LIBAFSNONFS) ;
135 -mkdir -p ${DEST_LIBAFSNONFS}
136 -mkdir -p ${DEST_LIBAFSNONFS}/Contents
137 $(INSTALL) -f ../${DARWIN_INFOFILE} ${DEST_LIBAFSNONFS}/Contents/Info.plist
138 -mkdir -p ${DEST_LIBAFSNONFS}/Contents/MacOS
139 $(INSTALL) -f ${LIBAFSNONFS} ${DEST_LIBAFSNONFS}/Contents/MacOS/afs
142 ${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS)
143 $(MODLD) -r -o ${LIBAFS} ${AFSAOBJS} ${AFSNFSOBJS} -lcc_kext
145 ${LIBAFSNONFS}: $(AFSAOBJS) $(AFSNONFSOBJS)
146 $(MODLD) -r -o ${LIBAFSNONFS} ${AFSAOBJS} ${AFSNONFSOBJS} -lcc_kext