Makefile.pc98 revision 17256
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.1.1.1 1996/06/14 10:04:40 asami 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# 20CC?= cc 21CPP?= cpp 22LD?= /usr/bin/ld 23 24.if exists(./@/.) 25S= ./@ 26.else 27S= ../.. 28.endif 29PC98= ${S}/pc98 30I386= ${S}/i386 31 32CWARNFLAGS?= -W -Wreturn-type -Wcomment -Wredundant-decls -Wimplicit \ 33 -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes \ 34 -Winline -Wunused 35# 36# The following flags are next up for working on: 37# -Wall 38# 39# When working on removing warnings from code, the `-Werror' flag should be 40# of material assistance. 41# 42COPTFLAGS?=-O 43# Not ready for -I- yet. #include "foo.h" where foo.h is in the srcdir fails. 44INCLUDES= -nostdinc -I. -I$S -I$S/sys 45# This hack is to allow kernel compiles to succeed on machines w/out srcdist 46.if exists($S/../include) 47INCLUDES+= -I$S/../include 48.else 49INCLUDES+= -I/usr/include 50.endif 51COPTS= ${INCLUDES} ${IDENT} -DKERNEL 52CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} 53LOAD_ADDRESS?= F0100000 54 55NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $< 56NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 57# XXX LOCORE means "don't declare C stuff" not "for locore.s". 58NORMAL_S= ${CC} -c -x assembler-with-cpp -DLOCORE ${COPTS} $< 59DRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $< 60DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 61DRIVER_S= ${CC} -c -x assembler-with-cpp -DLOCORE ${COPTS} $< 62PROFILE_C= ${CC} -c ${CFLAGS} ${PARAM} $< 63 64SYSTEM_CFILES= ioconf.c param.c vnode_if.c config.c 65SYSTEM_SFILES= ${PC98}/i386/locore.s 66SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o 67SYSTEM_DEP= Makefile symbols.exclude symbols.sort ${SYSTEM_OBJS} 68SYSTEM_LD_HEAD= @echo loading $@; rm -f $@ 69SYSTEM_LD= @${LD} -Bstatic -Z -T ${LOAD_ADDRESS} -o $@ -X ${SYSTEM_OBJS} vers.o 70.if ${CFLAGS:M-g} == "" 71SYMORDER_EXCLUDE=-x symbols.exclude 72.endif 73SYSTEM_LD_TAIL= @echo rearranging symbols; \ 74 symorder -m ${SYMORDER_EXCLUDE} symbols.sort $@; \ 75 size $@; chmod 755 $@ 76 77%BEFORE_DEPEND 78 79%OBJS 80 81%CFILES 82 83%SFILES 84 85%LOAD 86 87%CLEAN 88 89clean: 90 rm -f *.o *.s eddep errs genassym kernel linterrs \ 91 makelinks param.c symbols.exclude symbols.sort tags \ 92 vers.c vnode_if.c vnode_if.h ${CLEAN} 93 94#lint: /tmp param.c 95# @lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} \ 96# ${PC98}/i386/Locore.c ${CFILES} ioconf.c param.c | \ 97# grep -v 'struct/union .* never defined' | \ 98# grep -v 'possible pointer alignment problem' 99 100symbols.exclude: Makefile 101 echo "gcc2_compiled." >symbols.exclude 102 echo "___gnu_compiled_c" >>symbols.exclude 103 104symbols.sort: ${I386}/i386/symbols.raw 105 grep -v '^#' ${I386}/i386/symbols.raw \ 106 | sed 's/^ //' | sort -u > symbols.sort 107 108locore.o: ${PC98}/i386/locore.s assym.s 109 ${NORMAL_S} 110 111# everything potentially depends on the Makefile since everything potentially 112# depends on the options. Some things are more dependent on the Makefile for 113# historical reasons. 114machdep.o: Makefile 115 116# the following is necessary because autoconf.o depends on #if GENERIC 117autoconf.o: Makefile 118 119# XXX - may no longer be needed 120locore.o: Makefile 121 122# depends on KDB (cons.o also depends on GENERIC) 123trap.o cons.o: Makefile 124 125# this rule stops ./assym.s in .depend from causing problems 126./assym.s: assym.s 127 128assym.s: genassym 129 ./genassym >assym.s 130 131# Some of the defines that genassym outputs may well depend on the 132# value of kernel options. 133genassym.o: ${I386}/i386/genassym.c Makefile 134 rm -f ./machine ; ln -s ${I386}/include ./machine 135 ${CC} -c ${CFLAGS} ${PARAM} -UKERNEL ${I386}/i386/genassym.c 136 137genassym: genassym.o 138 ${CC} -static ${CFLAGS} ${PARAM} genassym.o -o $@ 139 140# XXX this assumes that the options for NORMAL_C* and DRIVER_C* are identical. 141depend: assym.s param.c vnode_if.h ${BEFORE_DEPEND} 142 rm -f .newdep 143 mkdep -a -f .newdep ${COPTS} ${CFILES} ${SYSTEM_CFILES} 144 mkdep -a -f .newdep ${COPTS} ${PARAM} -UKERNEL ${I386}/i386/genassym.c 145 MKDEP_CPP="${CPP}" ; export MKDEP_CPP ; \ 146 mkdep -a -f .newdep -DLOCORE ${COPTS} ${SFILES} ${SYSTEM_SFILES} 147 rm -f .depend 148 mv -f .newdep .depend 149 150links: 151 egrep '#if' ${CFILES:Nswapkernel.c} | sed -f $S/conf/defines | \ 152 sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 153 echo ${CFILES:Nswapkernel.c} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 154 sort -u | comm -23 - dontlink | \ 155 sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks 156 sh makelinks && rm -f dontlink 157 158tags: 159 @echo "see $S/kern/Makefile for tags" 160 161install: 162 @if [ ! -f kernel ] ; then \ 163 echo "You must first build your kernel before trying to install." ; \ 164 exit 1 ; \ 165 fi 166 chflags noschg /kernel 167 mv /kernel /kernel.old 168 if [ `sysctl -n kern.bootfile` = /kernel ] ; then \ 169 sysctl -w kern.bootfile=/kernel.old ; \ 170 mv -f /var/db/kvm_kernel.db /var/db/kvm_kernel.old.db ; \ 171 fi 172 install -c -m 555 -o root -g wheel -fschg kernel / 173 174ioconf.o: ioconf.c $S/sys/param.h $S/sys/buf.h \ 175 ${PC98}/pc98/pc98_device.h ${PC98}/pc98/pc98.h ${PC98}/pc98/icu.h 176 ${CC} -c ${CFLAGS} ioconf.c 177 178param.c: $S/conf/param.c 179 -rm -f param.c 180 cp $S/conf/param.c . 181 182param.o: param.c Makefile 183 ${CC} -c ${CFLAGS} ${PARAM} param.c 184 185vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 186 sh $S/conf/newvers.sh ${KERN_IDENT} ${IDENT} 187 ${CC} ${CFLAGS} -c vers.c 188 189vnode_if.c: $S/kern/vnode_if.sh $S/kern/vnode_if.src 190 sh $S/kern/vnode_if.sh $S/kern/vnode_if.src 191vnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src 192 sh $S/kern/vnode_if.sh $S/kern/vnode_if.src 193 194%RULES 195 196# DO NOT DELETE THIS LINE -- make depend uses it 197