Makefile.i386 (3743) | Makefile.i386 (3863) |
---|---|
1# Copyright 1990 W. Jolitz 2# from: @(#)Makefile.i386 7.1 5/10/91 | 1# Copyright 1990 W. Jolitz 2# from: @(#)Makefile.i386 7.1 5/10/91 |
3# $Id: Makefile.i386,v 1.46 1994/10/18 19:45:46 wollman Exp $ | 3# $Id: Makefile.i386,v 1.47 1994/10/21 01:10:54 wollman Exp $ |
4# 5# Makefile for FreeBSD 6# 7# This makefile is constructed from a machine description: 8# config machineid 9# Most changes should be made in the machine description 10# /sys/i386/conf/``machineid'' 11# after which you should do --- 8 unchanged lines hidden (view full) --- 20# -DTRACE compile in kernel tracing hooks 21# -DQUOTA compile in file system quotas 22# 23TOUCH?= touch -f -c 24LD?= /usr/bin/ld 25CC?= cc 26CPP?= cpp 27DBSYM?= /usr/sbin/dbsym | 4# 5# Makefile for FreeBSD 6# 7# This makefile is constructed from a machine description: 8# config machineid 9# Most changes should be made in the machine description 10# /sys/i386/conf/``machineid'' 11# after which you should do --- 8 unchanged lines hidden (view full) --- 20# -DTRACE compile in kernel tracing hooks 21# -DQUOTA compile in file system quotas 22# 23TOUCH?= touch -f -c 24LD?= /usr/bin/ld 25CC?= cc 26CPP?= cpp 27DBSYM?= /usr/sbin/dbsym |
28.if defined(DEBUG) 29.if defined(NOSTRIP) 30STRIP= echo '(skipping) strip' 31.else 32STRIP= cp $@ $@.sym; strip 33.endif 34.else 35STRIP= strip 36.endif | |
37 38.if exists(./@/.) 39S= ./@ 40.else 41S= ../.. 42.endif 43I386= ${S}/i386 44 45CWARNFLAGS?=-W -Wreturn-type -Wcomment -Wredundant-decls | 28 29.if exists(./@/.) 30S= ./@ 31.else 32S= ../.. 33.endif 34I386= ${S}/i386 35 36CWARNFLAGS?=-W -Wreturn-type -Wcomment -Wredundant-decls |
46 | |
47# | 37# |
48# The following flag is next up for working on: 49# -Wnested-externs | 38# The following flags are next up for working on: 39# -Wimplicit -Wnested-externs |
50# 51# When working on removing warnings from code, the `-Werror' flag should be 52# of material assistance. 53# 54COPTFLAGS?=-O 55INCLUDES= -I. -I$S -I$S/sys 56COPTS= ${INCLUDES} ${IDENT} -DKERNEL -Di386 -DLOAD_ADDRESS=0x${LOAD_ADDRESS} 57ASFLAGS= 58CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} 59LOAD_ADDRESS?= F0100000 60 61NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $< 62NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 63# XXX errors leak out of all the pipes. Should use cc *.S. 64# XXX LOCORE means "don't declare C stuff" not "for locore.s". | 40# 41# When working on removing warnings from code, the `-Werror' flag should be 42# of material assistance. 43# 44COPTFLAGS?=-O 45INCLUDES= -I. -I$S -I$S/sys 46COPTS= ${INCLUDES} ${IDENT} -DKERNEL -Di386 -DLOAD_ADDRESS=0x${LOAD_ADDRESS} 47ASFLAGS= 48CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} 49LOAD_ADDRESS?= F0100000 50 51NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $< 52NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 53# XXX errors leak out of all the pipes. Should use cc *.S. 54# XXX LOCORE means "don't declare C stuff" not "for locore.s". |
65NORMAL_S= ${CPP} -I. -DLOCORE ${COPTS} $< | ${AS} ${ASFLAGS} -o $*.o | 55NORMAL_S= ${CPP} -DLOCORE ${COPTS} $< | ${AS} ${ASFLAGS} -o $*.o |
66DRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $< 67DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< | 56DRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $< 57DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< |
58PROFILE_C= ${CC} -c ${CFLAGS} ${PARAM} $< |
|
68 69SFILES= ${I386}/i386/exception.s ${I386}/i386/microtime.s \ 70 ${I386}/i386/support.s ${I386}/i386/swtch.s ${I386}/apm/apm_setup.s 71SYSTEM_CFILES= ioconf.c param.c vnode_if.c 72SYSTEM_SFILES= ${I386}/i386/locore.s 73SYSTEM_OBJS=locore.o vnode_if.o ${OBJS} ioconf.o param.o 74SYSTEM_DEP=Makefile symbols.sort ${SYSTEM_OBJS} libkern.a 75SYSTEM_LD_HEAD= @echo loading $@; rm -f $@ 76SYSTEM_LD= @${LD} -Bstatic -Z -T ${LOAD_ADDRESS} -o $@ -X ${SYSTEM_OBJS} vers.o libkern.a 77SYSTEM_LD_TAIL= @echo rearranging symbols; symorder symbols.sort $@; \ | 59 60SFILES= ${I386}/i386/exception.s ${I386}/i386/microtime.s \ 61 ${I386}/i386/support.s ${I386}/i386/swtch.s ${I386}/apm/apm_setup.s 62SYSTEM_CFILES= ioconf.c param.c vnode_if.c 63SYSTEM_SFILES= ${I386}/i386/locore.s 64SYSTEM_OBJS=locore.o vnode_if.o ${OBJS} ioconf.o param.o 65SYSTEM_DEP=Makefile symbols.sort ${SYSTEM_OBJS} libkern.a 66SYSTEM_LD_HEAD= @echo loading $@; rm -f $@ 67SYSTEM_LD= @${LD} -Bstatic -Z -T ${LOAD_ADDRESS} -o $@ -X ${SYSTEM_OBJS} vers.o libkern.a 68SYSTEM_LD_TAIL= @echo rearranging symbols; symorder symbols.sort $@; \ |
78 ${DBSYM} -fT ${LOAD_ADDRESS} $@; ${STRIP} -x $@; size $@; chmod 755 $@ | 69 ${DBSYM} -fT ${LOAD_ADDRESS} $@; size $@; chmod 755 $@ |
79 | 70 |
80# (XXX) ok, this is weird. but we've got a working ed, and a broken ex, and 81# the script is identical for either... -- cgd 82# 83GPROF.EX= /usr/src/lib/csu.i386/gprof.ex 84PROFILE_C= ${CC} -S -c ${CFLAGS} $< ; \ 85 ed - $*.s < ${GPROF.EX} ; \ 86 ${AS} -o $@ $*.s ; \ 87 rm -f $*.s 88 | |
89%OBJS 90 91%CFILES 92 93%LOAD 94 95# This is slightly different from before in that if you define PROF 96# to anything, it will assume profiling. Don't do "PROF=" to turn --- 13 unchanged lines hidden (view full) --- 110libkern.a: ${LIBKERN} 111 @rm -f libkern.a 112 ln -s ${LIBKERN} libkern.a 113 114${LIBKERN}: 115 @(cd $S/libkern; make) 116 117clean: | 71%OBJS 72 73%CFILES 74 75%LOAD 76 77# This is slightly different from before in that if you define PROF 78# to anything, it will assume profiling. Don't do "PROF=" to turn --- 13 unchanged lines hidden (view full) --- 92libkern.a: ${LIBKERN} 93 @rm -f libkern.a 94 ln -s ${LIBKERN} libkern.a 95 96${LIBKERN}: 97 @(cd $S/libkern; make) 98 99clean: |
118 rm -f eddep *kernel tags *.o locore.i [a-uw-z]*.s \ 119 errs linterrs makelinks genassym ,assym.s stamp-assym | 100 rm -f eddep kernel tags *.o *.s errs linterrs makelinks genassym |
120 121#lint: /tmp param.c | 101 102#lint: /tmp param.c |
122# @lint -hbxn -I. -DGENERIC -Dvolatile= ${COPTS} ${PARAM} \ | 103# @lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} \ |
123# ${I386}/i386/Locore.c ${CFILES} ioconf.c param.c | \ 124# grep -v 'struct/union .* never defined' | \ 125# grep -v 'possible pointer alignment problem' 126 127symbols.sort: ${I386}/i386/symbols.raw 128 grep -v '^#' ${I386}/i386/symbols.raw \ 129 | sed 's/^ //' | sort -u > symbols.sort 130 --- 13 unchanged lines hidden (view full) --- 144 145# depends on KDB (cons.o also depends on GENERIC) 146trap.o cons.o: Makefile 147 148# this rule stops ./assym.s in .depend from causing problems 149./assym.s: assym.s 150 151assym.s: genassym | 104# ${I386}/i386/Locore.c ${CFILES} ioconf.c param.c | \ 105# grep -v 'struct/union .* never defined' | \ 106# grep -v 'possible pointer alignment problem' 107 108symbols.sort: ${I386}/i386/symbols.raw 109 grep -v '^#' ${I386}/i386/symbols.raw \ 110 | sed 's/^ //' | sort -u > symbols.sort 111 --- 13 unchanged lines hidden (view full) --- 125 126# depends on KDB (cons.o also depends on GENERIC) 127trap.o cons.o: Makefile 128 129# this rule stops ./assym.s in .depend from causing problems 130./assym.s: assym.s 131 132assym.s: genassym |
152 ./genassym >,assym.s 153 if cmp -s assym.s ,assym.s; then \ 154 rm -f ,assym.s; \ 155 else \ 156 rm -f assym.s; \ 157 mv ,assym.s assym.s; \ 158 fi | 133 ./genassym >assym.s |
159 160# Some of the defines that genassym outputs may well depend on the 161# value of kernel options. | 134 135# Some of the defines that genassym outputs may well depend on the 136# value of kernel options. |
162genassym: Makefile 163 ${CC} ${INCLUDES} -DKERNEL ${IDENT} ${PARAM} \ 164 ${I386}/i386/genassym.c -static -o genassym | 137genassym.o: ${I386}/i386/genassym.c Makefile 138 ${CC} -c ${CFLAGS} ${PARAM} ${I386}/i386/genassym.c |
165 | 139 |
140genassym: genassym.o 141 ${CC} -static ${CFLAGS} ${PARAM} genassym.o -o $@ 142 |
|
166# XXX this assumes that the options for NORMAL_C* and DRIVER_C* are identical. 167depend: assym.s param.c vnode_if.h 168 mkdep ${COPTS} ${CFILES} ${SYSTEM_CFILES} | 143# XXX this assumes that the options for NORMAL_C* and DRIVER_C* are identical. 144depend: assym.s param.c vnode_if.h 145 mkdep ${COPTS} ${CFILES} ${SYSTEM_CFILES} |
169 mkdep -a -p ${INCLUDES} -DKERNEL ${IDENT} ${PARAM} \ 170 ${I386}/i386/genassym.c | 146 mkdep -a ${COPTS} ${PARAM} ${I386}/i386/genassym.c |
171 MKDEP_CPP=${CPP} ; export MKDEP_CPP ; \ | 147 MKDEP_CPP=${CPP} ; export MKDEP_CPP ; \ |
172 mkdep -a -I. -DLOCORE ${COPTS} ${SFILES} ${SYSTEM_SFILES} | 148 mkdep -a -DLOCORE ${COPTS} ${SFILES} ${SYSTEM_SFILES} |
173 174links: 175 egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 176 sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 177 echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 178 sort -u | comm -23 - dontlink | \ 179 sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks 180 sh makelinks && rm -f dontlink --- 32 unchanged lines hidden --- | 149 150links: 151 egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 152 sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 153 echo ${CFILES} | 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 --- 32 unchanged lines hidden --- |