Makefile.pc98 revision 35514
1# Makefile for FreeBSD(98) after: 2# 3# Makefile.i386 -- with config changes. 4# Copyright 1990 W. Jolitz 5# from: @(#)Makefile.i386 7.1 5/10/91 6# $Id: Makefile.pc98,v 1.28 1998/04/18 05:07:43 kato Exp $ 7# 8# Makefile for FreeBSD 9# 10# This makefile is constructed from a machine description: 11# config machineid 12# Most changes should be made in the machine description 13# /sys/i386/conf/``machineid'' 14# after which you should do 15# config machineid 16# Generic makefile changes should be made in 17# /sys/i386/conf/Makefile.i386 18# after which config should be rerun for all machines. 19# 20 21# Which version of config(8) is required. 22%VERSREQ= 300003 23 24BINFORMAT?= aout 25#BINFORMAT?= aoutkld 26#BINFORMAT?= elf 27 28#STD8X16FONT?= iso 29 30.if exists(./@/.) 31S= ./@ 32.else 33S= ../.. 34.endif 35PC98= ${S}/pc98 36I386= ${S}/i386 37 38COPTFLAGS?=-O 39INCLUDES= -nostdinc -I- -I. -I$S 40# This hack is to allow kernel compiles to succeed on machines w/out srcdist 41.if exists($S/../include) 42INCLUDES+= -I$S/../include 43.else 44INCLUDES+= -I/usr/include 45.endif 46COPTS= ${INCLUDES} ${IDENT} -DKERNEL -include opt_global.h 47CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} 48LOAD_ADDRESS?= F0100000 49DEFINED_PROF= ${PROF} 50.if defined(PROF) 51CFLAGS+= -malign-functions=4 52.if ${PROFLEVEL} >= 2 53IDENT+= -DGPROF4 -DGUPROF 54PROF+= -mprofiler-epilogue 55.endif 56.endif 57 58NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $< 59NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 60# XXX LOCORE means "don't declare C stuff" not "for locore.s". 61NORMAL_S= ${CC} -c -x assembler-with-cpp -DLOCORE ${COPTS} $< 62DRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $< 63DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 64DRIVER_S= ${CC} -c -x assembler-with-cpp -DLOCORE ${COPTS} $< 65PROFILE_C= ${CC} -c ${CFLAGS} ${PARAM} $< 66 67# ${I386}/i386/setdef0.c and ${I386}/i386/setdef1.c are intentionally 68# omitted from SYSTEM_CFILES. They depend on setdefs.h, a header which 69# is generated from all of ${OBJS}. We don't want to have to compile 70# everything just to do a make depend. 71SYSTEM_CFILES= ioconf.c param.c vnode_if.c config.c 72SYSTEM_SFILES= ${I386}/i386/locore.s 73SYSTEM_DEP= Makefile symbols.exclude symbols.sort ${SYSTEM_OBJS} 74.if ${CFLAGS:M-g} == "" 75SYMORDER_EXCLUDE=-x symbols.exclude 76.endif 77SYSTEM_LD_HEAD= @echo loading ${.TARGET}; rm -f ${.TARGET} 78.if ${BINFORMAT} == aout 79SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o 80SYSTEM_LD= @${LD} -Bstatic -Z -T ${LOAD_ADDRESS} -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o 81SYSTEM_LD_TAIL= @echo rearranging symbols; \ 82 symorder -m ${SYMORDER_EXCLUDE} symbols.sort ${.TARGET} \ 83 size ${.TARGET} ; chmod 755 ${.TARGET} 84.endif 85.if ${BINFORMAT} == aoutkld 86SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o 87SYSTEM_LD= @${LD} -Bforcedynamic -Z -T ${LOAD_ADDRESS} -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o 88SYSTEM_LD_TAIL= @echo rearranging symbols; \ 89 symorder -m ${SYMORDER_EXCLUDE} symbols.sort ${.TARGET}; \ 90 size ${.TARGET} ; chmod 755 ${.TARGET} 91.endif 92.if ${BINFORMAT} == elf 93SYSTEM_OBJS= locore.o setdef0.o vnode_if.o ${OBJS} ioconf.o param.o config.o \ 94 setdef1.o 95SYSTEM_LD= @${LD} -Bstatic -Ttext ${LOAD_ADDRESS} -e btext -defsym _DYNAMIC=0 \ 96 -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o 97SYSTEM_LD_TAIL= @size ${.TARGET}; chmod 755 ${.TARGET} 98.endif 99 100%BEFORE_DEPEND 101 102%OBJS 103 104%CFILES 105 106%SFILES 107 108%LOAD 109 110%CLEAN 111 112clean: 113 rm -f *.o *.s eddep errs genassym gensetdefs kernel linterrs \ 114 makelinks param.c setdefs.h symbols.exclude symbols.sort tags \ 115 vers.c vnode_if.c vnode_if.h ${CLEAN} 116 117#lint: /tmp param.c 118# @lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} \ 119# ${I386}/i386/Locore.c ${CFILES} ioconf.c param.c | \ 120# grep -v 'struct/union .* never defined' | \ 121# grep -v 'possible pointer alignment problem' 122 123symbols.exclude: Makefile 124 echo "gcc2_compiled." >symbols.exclude 125 echo "___gnu_compiled_c" >>symbols.exclude 126 127symbols.sort: ${I386}/i386/symbols.raw 128 grep -v '^#' ${I386}/i386/symbols.raw \ 129 | sed 's/^ //' | sort -u > symbols.sort 130 131locore.o: ${I386}/i386/locore.s assym.s 132 ${NORMAL_S} 133 134setdef0.o: ${I386}/i386/setdef0.c setdefs.h 135 ${NORMAL_C} 136 137setdef1.o: ${I386}/i386/setdef1.c setdefs.h 138 ${NORMAL_C} 139 140setdefs.h: gensetdefs ${OBJS} 141 ./gensetdefs ${OBJS} >setdefs.h 142 143gensetdefs: gensetdefs.o 144 ${CC} ${CFLAGS} gensetdefs.o -o ${.TARGET} 145 146gensetdefs.o: ${I386}/i386/gensetdefs.c 147 ${CC} -c ${CFLAGS} ${I386}/i386/gensetdefs.c 148 149# everything potentially depends on the Makefile since everything potentially 150# depends on the options. Some things are more dependent on the Makefile for 151# historical reasons. 152machdep.o: Makefile 153 154# the following is necessary because autoconf.o depends on #if GENERIC 155autoconf.o: Makefile 156 157# XXX - may no longer be needed 158locore.o: Makefile 159 160# depends on KDB (cons.o also depends on GENERIC) 161trap.o cons.o: Makefile 162 163# this rule stops ./assym.s in .depend from causing problems 164./assym.s: assym.s 165 166assym.s: genassym 167 ./genassym >assym.s 168 169# Some of the defines that genassym outputs may well depend on the 170# value of kernel options. 171genassym.o: ${I386}/i386/genassym.c Makefile opt_global.h opt_vm86.h 172 rm -f ./machine ; ln -s ${I386}/include ./machine 173 ${CC} -c ${CFLAGS} ${PARAM} -UKERNEL ${I386}/i386/genassym.c 174 175genassym: genassym.o 176 ${CC} ${CFLAGS} ${PARAM} genassym.o -o ${.TARGET} 177 178${OBJS}: opt_global.h 179 180# XXX this assumes that the options for NORMAL_C* and DRIVER_C* are identical. 181depend: assym.s param.c vnode_if.h ${BEFORE_DEPEND} 182 rm -f .newdep 183 mkdep -a -f .newdep ${COPTS} ${CFILES} ${SYSTEM_CFILES} 184 mkdep -a -f .newdep ${COPTS} ${PARAM} -UKERNEL ${I386}/i386/genassym.c 185 MKDEP_CPP="${CC} -E -x assembler-with-cpp" ; export MKDEP_CPP ; \ 186 mkdep -a -f .newdep -DLOCORE ${COPTS} ${SFILES} ${SYSTEM_SFILES} 187 rm -f .depend 188 mv -f .newdep .depend 189 190cleandepend: 191 rm -f .depend 192 193links: 194 egrep '#if' ${CFILES:Nswapkernel.c} | sed -f $S/conf/defines | \ 195 sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 196 echo ${CFILES:Nswapkernel.c} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 197 sort -u | comm -23 - dontlink | \ 198 sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks 199 sh makelinks && rm -f dontlink 200 201tags: 202 @echo "see $S/kern/Makefile for tags" 203 204install: 205 @if [ ! -f kernel ] ; then \ 206 echo "You must first build your kernel before trying to install." ; \ 207 exit 1 ; \ 208 fi 209.if exists(${DESTDIR}/kernel) 210 chflags noschg ${DESTDIR}/kernel 211 mv ${DESTDIR}/kernel ${DESTDIR}/kernel.old 212.endif 213 PATH=$${PATH}:/sbin:/usr/sbin; \ 214 if [ `sysctl -n kern.bootfile` = ${DESTDIR}/kernel ] ; then \ 215 sysctl -w kern.bootfile=${DESTDIR}/kernel.old ; \ 216 if [ -f /var/db/kvm_kernel.db ] ; then \ 217 mv -f /var/db/kvm_kernel.db /var/db/kvm_kernel.old.db ; \ 218 fi \ 219 fi 220 install -c -m 555 -o root -g wheel -fschg kernel ${DESTDIR}/ 221 222ioconf.o: ioconf.c $S/sys/param.h $S/sys/buf.h \ 223 ${I386}/isa/isa_device.h ${PC98}/pc98/pc98.h ${I386}/isa/icu.h 224 ${CC} -c ${CFLAGS} ioconf.c 225 226param.c: $S/conf/param.c 227 -rm -f param.c 228 cp $S/conf/param.c . 229 230param.o: param.c Makefile 231 ${CC} -c ${CFLAGS} ${PARAM} param.c 232 233vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 234 sh $S/conf/newvers.sh ${KERN_IDENT} ${IDENT} 235 ${CC} ${CFLAGS} -c vers.c 236 237vnode_if.c: $S/kern/vnode_if.sh $S/kern/vnode_if.src 238 sh $S/kern/vnode_if.sh $S/kern/vnode_if.src 239vnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src 240 sh $S/kern/vnode_if.sh $S/kern/vnode_if.src 241 242.include <bsd.kern.mk> 243 244%RULES 245 246# DO NOT DELETE THIS LINE -- make depend uses it 247