15b81b6b3SRodney W. Grimes# Copyright 1990 W. Jolitz 22d717e4aSRodney W. Grimes# from: @(#)Makefile.i386 7.1 5/10/91 32d717e4aSRodney W. Grimes# $Id$ 42d717e4aSRodney W. Grimes# 52d717e4aSRodney W. Grimes# Makefile for FreeBSD 65b81b6b3SRodney W. Grimes# 75b81b6b3SRodney W. Grimes# This makefile is constructed from a machine description: 85b81b6b3SRodney W. Grimes# config machineid 95b81b6b3SRodney W. Grimes# Most changes should be made in the machine description 105b81b6b3SRodney W. Grimes# /sys/i386/conf/``machineid'' 115b81b6b3SRodney W. Grimes# after which you should do 125b81b6b3SRodney W. Grimes# config machineid 135b81b6b3SRodney W. Grimes# Generic makefile changes should be made in 145b81b6b3SRodney W. Grimes# /sys/i386/conf/Makefile.i386 155b81b6b3SRodney W. Grimes# after which config should be rerun for all machines. 165b81b6b3SRodney W. Grimes# 175b81b6b3SRodney W. Grimes# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE INVISIBLE TO MAKEFILE 185b81b6b3SRodney W. Grimes# IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING 195b81b6b3SRodney W. Grimes# 205b81b6b3SRodney W. Grimes# -DTRACE compile in kernel tracing hooks 215b81b6b3SRodney W. Grimes# -DQUOTA compile in file system quotas 225b81b6b3SRodney W. Grimes# 235b81b6b3SRodney W. GrimesTOUCH= touch -f -c 245b81b6b3SRodney W. GrimesLD= /usr/bin/ld 255b81b6b3SRodney W. GrimesCC= cc 265b81b6b3SRodney W. GrimesCPP= cpp 272d717e4aSRodney W. GrimesSTRIP= strip 282d717e4aSRodney W. GrimesDBSYM= /usr/sbin/dbsym 295b81b6b3SRodney W. Grimes 305b81b6b3SRodney W. GrimesS= ../.. 315b81b6b3SRodney W. GrimesI386= ../../i386 325b81b6b3SRodney W. Grimes 335b81b6b3SRodney W. GrimesINCLUDES= -I. -I$S -I$S/sys 345b81b6b3SRodney W. GrimesCOPTS= ${INCLUDES} ${IDENT} -DKERNEL -Di386 -DNPX 355b81b6b3SRodney W. GrimesASFLAGS= 364ff3cd9dSNate WilliamsCFLAGS= -O ${DEBUG} ${COPTS} 372d717e4aSRodney W. GrimesLOAD_ADDRESS?= FE000000 385b81b6b3SRodney W. Grimes 395b81b6b3SRodney W. GrimesNORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $< 405b81b6b3SRodney W. GrimesNORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 415b81b6b3SRodney W. GrimesNORMAL_S= ${CPP} -I. -DLOCORE ${COPTS} $< | ${AS} ${ASFLAGS} -o $*.o 425b81b6b3SRodney W. GrimesDRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $< 435b81b6b3SRodney W. GrimesDRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 445b81b6b3SRodney W. GrimesSYSTEM_OBJS=locore.o ${OBJS} param.o ioconf.o conf.o 455b81b6b3SRodney W. GrimesSYSTEM_DEP=Makefile symbols.sort ${SYSTEM_OBJS} 465b81b6b3SRodney W. GrimesSYSTEM_LD_HEAD= @echo loading $@; rm -f $@ 472d717e4aSRodney W. GrimesSYSTEM_LD= @${LD} -z -T ${LOAD_ADDRESS} -o $@ -X vers.o ${SYSTEM_OBJS} 485b81b6b3SRodney W. GrimesSYSTEM_LD_TAIL= @echo rearranging symbols; symorder symbols.sort $@; \ 492d717e4aSRodney W. Grimes ${DBSYM} -fT ${LOAD_ADDRESS} $@; ${STRIP} -x $@; size $@; chmod 755 $@ 505b81b6b3SRodney W. Grimes 512d717e4aSRodney W. Grimes# (XXX) ok, this is weird. but we've got a working ed, and a broken ex, and 522d717e4aSRodney W. Grimes# the script is identical for either... -- cgd 532d717e4aSRodney W. Grimes# 545b81b6b3SRodney W. GrimesGPROF.EX= /usr/src/lib/csu.i386/gprof.ex 555b81b6b3SRodney W. GrimesPROFILE_C= ${CC} -S -c ${CFLAGS} $< ; \ 562d717e4aSRodney W. Grimes ed - $*.s < ${GPROF.EX} ; \ 575b81b6b3SRodney W. Grimes ${AS} -o $@ $*.s ; \ 585b81b6b3SRodney W. Grimes rm -f $*.s 595b81b6b3SRodney W. Grimes 605b81b6b3SRodney W. Grimes%OBJS 615b81b6b3SRodney W. Grimes 625b81b6b3SRodney W. Grimes%CFILES 635b81b6b3SRodney W. Grimes 645b81b6b3SRodney W. Grimes%LOAD 655b81b6b3SRodney W. Grimes 665b81b6b3SRodney W. Grimesclean: 675b81b6b3SRodney W. Grimes rm -f eddep *386bsd tags *.o locore.i [a-uw-z]*.s \ 685b81b6b3SRodney W. Grimes errs linterrs makelinks genassym 695b81b6b3SRodney W. Grimes 705b81b6b3SRodney W. Grimeslint: /tmp param.c 715b81b6b3SRodney W. Grimes @lint -hbxn -I. -DGENERIC -Dvolatile= ${COPTS} ${PARAM} \ 725b81b6b3SRodney W. Grimes ${I386}/i386/Locore.c ${CFILES} ioconf.c param.c | \ 735b81b6b3SRodney W. Grimes grep -v 'struct/union .* never defined' | \ 745b81b6b3SRodney W. Grimes grep -v 'possible pointer alignment problem' 755b81b6b3SRodney W. Grimes 765b81b6b3SRodney W. Grimessymbols.sort: ${I386}/i386/symbols.raw 775b81b6b3SRodney W. Grimes grep -v '^#' ${I386}/i386/symbols.raw \ 785b81b6b3SRodney W. Grimes | sed 's/^ //' | sort -u > symbols.sort 795b81b6b3SRodney W. Grimes 805b81b6b3SRodney W. Grimeslocore.o: assym.s ${I386}/i386/locore.s machine/trap.h machine/psl.h \ 815b81b6b3SRodney W. Grimes machine/pte.h ${I386}/isa/vector.s ${I386}/isa/icu.s \ 825b81b6b3SRodney W. Grimes $S/sys/errno.h machine/specialreg.h ${I386}/isa/debug.h \ 835b81b6b3SRodney W. Grimes ${I386}/isa/icu.h ${I386}/isa/isa.h vector.h $S/net/netisr.h 845b81b6b3SRodney W. Grimes ${CPP} -I. -DLOCORE ${COPTS} ${I386}/i386/locore.s | \ 855b81b6b3SRodney W. Grimes ${AS} ${ASFLAGS} -o locore.o 865b81b6b3SRodney W. Grimes 872d717e4aSRodney W. Grimesmachdep.o: ${I386}/i386/machdep.c Makefile 882d717e4aSRodney W. Grimes ${CC} -c ${CFLAGS} -DLOAD_ADDRESS=0x${LOAD_ADDRESS} ${PROF} $< 892d717e4aSRodney W. Grimes 905b81b6b3SRodney W. Grimes# the following is necessary because autoconf.o depends on #if GENERIC 915b81b6b3SRodney W. Grimesautoconf.o: Makefile 925b81b6b3SRodney W. Grimes 935b81b6b3SRodney W. Grimes# depend on network configuration 945b81b6b3SRodney W. Grimesaf.o uipc_proto.o locore.o: Makefile 955b81b6b3SRodney W. Grimes 965b81b6b3SRodney W. Grimes# depend on maxusers 975b81b6b3SRodney W. Grimesassym.s machdep.o: Makefile 985b81b6b3SRodney W. Grimes 995b81b6b3SRodney W. Grimes# depends on KDB (cons.o also depends on GENERIC) 1005b81b6b3SRodney W. Grimestrap.o cons.o: Makefile 1015b81b6b3SRodney W. Grimes 1025b81b6b3SRodney W. Grimesassym.s: $S/sys/param.h machine/pte.h $S/sys/buf.h \ 1035b81b6b3SRodney W. Grimes $S/sys/vmmeter.h \ 1045b81b6b3SRodney W. Grimes $S/sys/proc.h $S/sys/msgbuf.h machine/vmparam.h 1055b81b6b3SRodney W. Grimes 1065b81b6b3SRodney W. Grimesassym.s: genassym 1075b81b6b3SRodney W. Grimes ./genassym >assym.s 1085b81b6b3SRodney W. Grimes 1095b81b6b3SRodney W. Grimesgenassym: 1105b81b6b3SRodney W. Grimes ${CC} ${INCLUDES} -DKERNEL ${IDENT} ${PARAM} \ 1115b81b6b3SRodney W. Grimes ${I386}/i386/genassym.c -o genassym 1125b81b6b3SRodney W. Grimes 1135b81b6b3SRodney W. Grimesdepend: assym.s param.c 1142d717e4aSRodney W. Grimes sh /usr/bin/mkdep -DLOAD_ADDRESS=0x${LOAD_ADDRESS} ${COPTS} ${CFILES} ioconf.c param.c ${I386}/i386/conf.c 1155b81b6b3SRodney W. Grimes sh /usr/bin/mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${I386}/i386/genassym.c 1165b81b6b3SRodney W. Grimes 1175b81b6b3SRodney W. Grimeslinks: 1185b81b6b3SRodney W. Grimes egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 1195b81b6b3SRodney W. Grimes sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 1205b81b6b3SRodney W. Grimes echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 1215b81b6b3SRodney W. Grimes sort -u | comm -23 - dontlink | \ 1225b81b6b3SRodney W. Grimes sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks 1235b81b6b3SRodney W. Grimes sh makelinks && rm -f dontlink 1245b81b6b3SRodney W. Grimes 1255b81b6b3SRodney W. Grimestags: 1265b81b6b3SRodney W. Grimes @echo "see $S/kern/Makefile for tags" 1275b81b6b3SRodney W. Grimes 1285b81b6b3SRodney W. Grimesioconf.o: ioconf.c $S/sys/param.h machine/pte.h $S/sys/buf.h \ 1295b81b6b3SRodney W. Grimes ${I386}/isa/isa_device.h ${I386}/isa/isa.h ${I386}/isa/icu.h 1305b81b6b3SRodney W. Grimes ${CC} -c ${CFLAGS} ioconf.c 1315b81b6b3SRodney W. Grimes 1322d717e4aSRodney W. Grimesconf.o: ${I386}/i386/conf.c 1335b81b6b3SRodney W. Grimes ${CC} -traditional -c ${CFLAGS} ${I386}/i386/conf.c 1345b81b6b3SRodney W. Grimes 1352d717e4aSRodney W. Grimesparam.c: $S/conf/param.c 1365b81b6b3SRodney W. Grimes -rm -f param.c 1375b81b6b3SRodney W. Grimes cp $S/conf/param.c . 1385b81b6b3SRodney W. Grimes 1395b81b6b3SRodney W. Grimesparam.o: param.c Makefile 1405b81b6b3SRodney W. Grimes ${CC} -c ${CFLAGS} ${PARAM} param.c 1415b81b6b3SRodney W. Grimes 1422d717e4aSRodney W. Grimesvers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 1435b81b6b3SRodney W. Grimes sh $S/conf/newvers.sh ${KERN_IDENT} ${IDENT} 1445b81b6b3SRodney W. Grimes ${CC} ${CFLAGS} -c vers.c 1455b81b6b3SRodney W. Grimes 1465b81b6b3SRodney W. Grimes%RULES 1475b81b6b3SRodney W. Grimes 1485b81b6b3SRodney W. Grimes# DO NOT DELETE THIS LINE -- make depend uses it 1495b81b6b3SRodney W. Grimes 150