📄 makefile.src
字号:
## @(#)Makefile.src 1.1 92/07/30 SMI## Makefile for Sun-4m SunOS## This makefile is constructed from a machine description:# config machine# Most changes should be made in the machine description# /sys/conf/``machineid''# after which you should do# config machineid# Generic makefile changes should be made in# /sys/conf/Makefile.src# after which config should be rerun for all machines.## N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE# IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING## -DTRACE compile in kernel tracing hooks# -DQUOTA compile in file system quotas## different compilers decide differently on# whether to define sun4 and sun4m ... so force# the issue. also, since we compile sun4m kernels# on sun4 machines, force $(ARCH) to sun4m. this# goes away when we stop building sun4m kernels# on lisbon and dtlab ...#ARCH:sh = arch -kARCH=sun4mUSER:sh = archARCHF=-U$(USER) -D$(ARCH)#CPP= /lib/cpp -undef -Dsparc -Dsun $(ARCHF)CC= cc -sparc $(ARCHF)AS= asLD= ldAWK= awkGREP= egrepDESTDIR=SYSDIR= ../..CONFDIR=../../conf.commonMACHINE= ..LDIR= /usr/lib/lintLINT= /usr/bin/lintLINT1= ${LDIR}/lint1LINT2= ${LDIR}/lint2LCOPTS= -C -Dlint ${CPPOPTS}LOPTS= -hbxnLTMP= /usr/tmp/lintkernel.lnLTAIL= ${GREP} -v 'struct/union .* never defined' | \ ${GREP} -v 'possible pointer alignment problem' ; trueLIBPROMDIR= $(SYSDIR)/$(ARCH)LIBPROM= $(LIBPROMDIR)/libprom.aLINTPROM= $(LIBPROMDIR)/llib-lprom.lnLIBPROMLIST= $(LIBPROMDIR)/libprom.listCPPOPTS=${IDENT} -DKERNEL -I. -I${MACHINE} -I${SYSDIR}COPTS= ${CPPOPTS}CFLAGS= -O ${COPTS}%OBJS%CONFFILES%CFILES%SFILES%LFILESOBJS += $(LIBPROM)#LFILES += $(LINTPROM)%LOADinstall: $(INSTALLFILES) install -d -o bin -m 755 ${DESTDIR}/usr/kvm/stand install -m 0755 $(INSTALLFILES) ${DESTDIR}/usr/kvm/standclean: $(RM) eddep $(INSTALLFILES) *.o *.pp *.L *errs makedep* makelinks @set -x; if ls *.s | ${GREP} -v mbglue.s; then \ $(RM) `ls *.s | ${GREP} -v mbglue.s`; filint: Locore.L ${LFILES} @cat Locore.L ${LFILES} > ${LTMP} @echo "Global Cross-checks:" @${LINT} ${LOPTS} -lprom ${LTMP} @rm -f ${LTMP}lint2: @cat Locore.L ${LFILES} > ${LTMP} @echo "Global Cross-checks:" @${LINT2} ${LTMP} ${LOPTS} @rm -f ${LTMP}${SYSDIR}/sun/symbols.sort: ${SYSDIR}/sun/symbols.raw ${GREP} -v '^#' ${SYSDIR}/sun/symbols.raw \ | sed 's/^ //' | sort -u > ${SYSDIR}/sun/symbols.sortvers.o: ${CONFDIR}/newvers.sh ${CONFDIR}/RELEASE @sh ${CONFDIR}/newvers.sh ${CONFDIR}/RELEASE ${ARCH} @${CC} ${CFLAGS} -c vers.c# the following is necessary because files depend on #if GENERICautoconf.o stubs.o : Makefile# the following are necessary because the files depend on the types of# sun cpu's included in the system configurationmachdep.o autoconf.o conf.o : Makefile# depend on network configurationaf.o uipc_proto.o : Makefile# depend on optionsinit_sysent.o vfs_conf.o : Makefile# depend on SystemV IPC optionsinit_main.o kern_exit.o kern_fork.o : Makefiledepend: makedep echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep echo '$$r makedep' >>eddep echo 'w' >>eddep cp Makefile Makefile.bak ex - Makefile < eddep rm eddep makedep makedep1 makedeperrsmakedep: ${CONFFILES} percpu.s assym.s ${MACHINE}/Locore.c syssrc FRC @cat /dev/null >makedep (for i in ${CFILES} ${SFILES} ${ARCH}/genassym.c ; do \ ${CPP} -M ${CPPOPTS} ${SYSDIR}/$$i >> makedep; done) \ 2>makedeperrs sed \ -e 's,^.*genassym\.o:,assym.s assym.L:,' \ -e 's,^.*genpercpu\.o:,percpu.s percpu.L:,' \ -e 's,^\(.*\)\.o:,\1.o \1.L:,' makedep > makedep1 (for i in ${CONFFILES} ; do \ ${CPP} -M ${CPPOPTS} $$i | sed \ -e 's,^\(.*\)\.o:,\1.o \1.L:,' >>makedep1; done) \ 2>>makedeperrs (for i in ${MACHINE}/Locore.c ; do \ ${CPP} -M -Dlint ${CPPOPTS} $$i | sed \ -e 's,^\(.*\)\.o:,\1.o \1.L:,' >>makedep1; done) \ 2>>makedeperrs ${AWK} ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \ else { if (length(rec $$3) > 78) { print rec; rec = $$0; } \ else rec = rec " " $$3 } } \ END { print rec } ' makedep1 > makedep @cat makedeperrs >&- 1>&2 @(if [ -s makedeperrs ]; then false; fi)FRC:syssrc: here=`pwd`; cd ${SYSDIR}; make -f $$here/Makefile dosyssrc## dosyssrc, made from the SYSDIR directory, ensures the latest sourcedosyssrc: ${CFILES} ${SFILES}links: ( cd ${SYSDIR}; ${GREP} '#[ ]*if' ${CFILES} ) | \ sed -f ${CONFDIR}/defines | \ sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ ${GREP} -v '^swap' | sort -u | comm -23 - dontlink | \ sed 's,.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks echo 'rm -f movc.o;ln -s ../GENERIC/movc.o movc.o' >>makelinks echo 'rm -f ocsum.o;ln -s ../GENERIC/ocsum.o ocsum.o' >>makelinks echo 'rm -f setjmp.o;ln -s ../GENERIC/setjmp.o setjmp.o' >>makelinks sh makelinks && rm -f dontlinktags: ../tags @(cd ..; echo tags file is in `pwd`)# 1. Using ctags, build tags file for *.[ch]# 2. Grep thru *.s for files containing 'ENTRY(' or 'ENTRY2('# 3. Convert *ENTRY(sym) to a tags reference# 4. Convert ENTRY2(sym1,sym2) to two tags references# 5. Merge with tags file and resort../tags: ../tags.list (cd ..; ctags -wt `$(GREP) -v '\.[sS]$$' tags.list`; \ $(GREP) 'ENTRY2*\(' `$(GREP) '\.[sS]$$' tags.list` | sed \ -e 's|^\(.*\):\(.*ENTRY(\)\(.*\)\().*\)|\3 \1 /^\2\3\4$$/|' \ -e 's|^\(.*\):\(.*ENTRY2(\)\(.*\),\(.*\)\().*\)|\3 \1 /^\2\3,\4\5$$/\\4 \1 /^\2\3,\4\5$$/|' >> tags; \ sort -u -o tags tags )# 1. Starting at the dependency list in this Makefile,# 2. remove the targets, leaving only the source names, one-per-line.# 3. Convert ../../ to ../ and ../machine/ to ../ARCH/# 4. Convert ../ARCH/../ to ../ and remove references to Locore.c# 5. Convert ./ to ../ARCH/SYSNAME/# 6. Convert 'filename' to ../ARCH/SYSNAME/filename# 7. Include the names in the LIBPROMLIST file.# 8. Sort and uniq the whole shebang.# 9. Split into two lists, .h files and everything else#10. Combine the two lists again, headers go after everything else.SYSNAME=`basename \`pwd\``../tags.list: Makefile $(LIBPROMLIST) @rm -f ../tags.list @sed -e '/^[a-zA-Z0-9_]*\.o [a-zA-Z0-9_]*\.L:/,$$!d' \ -e 's/.*L:.//' Makefile | tr '\040' '\012' | sed \ -e 's,\.\./\.\./,../,' -e 's,\.\./machine/,../'${ARCH}/, \ -e 's,\.\./machlwp,../'${ARCH}'/machlwp', \ -e 's,\.\./'${ARCH}'/\.\./,../,' -e '/Locore/d' \ -e 's,^\./,../'${ARCH}/${SYSNAME}/, \ -e 's,^\([a-zA-Z0-9_]\),../'${ARCH}/${SYSNAME}'/\1,' | \ sort -u -o ../tags.list @cat $(LIBPROMLIST) >> ../tags.list @sort -u -o ../tags.list ../tags.list @grep '\.h$$' ../tags.list > ../tags.headers @grep -v '\.h$$' ../tags.list > ../tags.noheaders @cat ../tags.noheaders ../tags.headers > ../tags.list @rm -f ../tags.noheaders ../tags.headerslocore.o: assym.s percpu.sassym.s: ${MACHINE}/genassym.c ${CC} -E ${CPPOPTS} ${MACHINE}/genassym.c > ./a.out.c cc ${COPTS} ./a.out.c ./a.out >assym.s rm -f ./a.out ./a.out.cpercpu.h percpu_str.h percpu_def.h percpu.s: ${SYSDIR}/sys/genpercpu.c Makefile ${CC} -E ${CPPOPTS} ${SYSDIR}/sys/genpercpu.c > ./a.out.c cc ${COPTS} ./a.out.c ./a.out >percpu.s rm -f ./a.out ./a.out.cLocore.L: @echo Locore.c: @-(${CPP} ${LCOPTS} ${MACHINE}/Locore.c | \ ${LINT1} ${LOPTS} > Locore.L ) 2>&1 | ${LTAIL}ioconf.o: ${CC} -c ${CFLAGS} ioconf.cioconf.L: @echo ioconf.c: @-(${CPP} ${LCOPTS} ioconf.c | \ ${LINT1} ${LOPTS} > ioconf.L ) 2>&1 | ${LTAIL}param.c: ${CONFDIR}/param.c rm -f param.c cp ${CONFDIR}/param.c .param.o: param.c Makefile ${CC} -c ${CFLAGS} ${PARAM} param.cparam.L: @echo param.c: @-(${CPP} ${LCOPTS} ${PARAM} ${CONFDIR}/param.c | \ ${LINT1} ${LOPTS} > param.L ) 2>&1 | ${LTAIL}%RULES# DO NOT DELETE THIS LINE -- make depend uses it
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -