Home | History | Annotate | Line # | Download | only in conf
Makefile.sparc64 revision 1.23.2.1
      1  1.23.2.1   minoura # 	$NetBSD: Makefile.sparc64,v 1.23.2.1 2000/06/22 17:04:17 minoura Exp $
      2       1.1       eeh 
      3       1.1       eeh # Makefile for NetBSD
      4       1.1       eeh #
      5       1.1       eeh # This makefile is constructed from a machine description:
      6       1.1       eeh #	config machineid
      7       1.1       eeh # Most changes should be made in the machine description
      8       1.1       eeh #	/sys/arch/sparc64/conf/``machineid''
      9       1.1       eeh # after which you should do
     10       1.1       eeh #	config machineid
     11       1.1       eeh # Machine generic makefile changes should be made in
     12       1.1       eeh #	/sys/arch/sparc64/conf/Makefile.sparc64
     13       1.1       eeh # after which config should be rerun for all machines of that type.
     14       1.1       eeh #
     15       1.1       eeh # N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE
     16       1.1       eeh #	IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
     17       1.1       eeh #
     18       1.1       eeh # -DTRACE	compile in kernel tracing hooks
     19       1.1       eeh # -DQUOTA	compile in file system quotas
     20       1.1       eeh 
     21       1.1       eeh # DEBUG is set to -g if debugging.
     22       1.1       eeh # PROF is set to -pg if profiling.
     23       1.1       eeh 
     24      1.22       eeh 
     25      1.22       eeh .if defined(MAKECONF) && exists(${MAKECONF})
     26      1.22       eeh .include "${MAKECONF}"
     27      1.22       eeh .elif exists(/etc/mk.conf)
     28       1.5       eeh .include "/etc/mk.conf"
     29      1.22       eeh .endif
     30       1.5       eeh 
     31       1.1       eeh CC?=	cc
     32       1.9       mrg .if exists(/usr/ccs/bin/ld)
     33       1.1       eeh LD?=	/usr/ccs/bin/ld #Need to use Solaris ld to use the solaris loader
     34       1.9       mrg .endif
     35       1.1       eeh MKDEP?=	mkdep
     36      1.18       eeh STRIP?=strip
     37       1.2       mrg SIZE?=	size
     38       1.1       eeh COPTS?= 	-O2
     39       1.5       eeh #### Stuff for cross compiling
     40       1.5       eeh NM?=nm
     41       1.5       eeh LORDER?=lorder
     42       1.5       eeh TSORT?=tsort
     43       1.5       eeh 
     44       1.1       eeh 
     45       1.4       mrg # deal with Solaris vs. NetBSD build environments for now ..
     46       1.4       mrg OS!=uname -s
     47       1.4       mrg .if (${OS} == "NetBSD")
     48       1.4       mrg USE_GENASSYM?=	no
     49       1.4       mrg .else
     50      1.11       eeh USE_GENASSYM?=	no
     51      1.11       eeh AWK=nawk
     52       1.9       mrg .endif
     53       1.9       mrg 
     54       1.9       mrg .if exists(/usr/ccs/bin/ld)
     55       1.4       mrg SVR4=-U__SVR4 -U__svr4__ -D__NetBSD__
     56       1.9       mrg .else
     57       1.9       mrg SVR4=
     58       1.4       mrg .endif
     59       1.4       mrg 
     60       1.1       eeh # source tree is located via $S relative to the compilation directory
     61       1.1       eeh .ifndef S
     62       1.1       eeh S!=	cd ../../../..; pwd
     63       1.1       eeh .endif
     64       1.1       eeh SPARC64=	$S/arch/sparc64
     65       1.1       eeh 
     66       1.1       eeh INCLUDES=	-I. -I$S/arch -I$S -nostdinc
     67       1.4       mrg CPPFLAGS=	${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL ${SVR4}
     68      1.20       mrg CWARNFLAGS=	-Wimplicit -Wunused -Wswitch -Wcomment -Wtrigraphs -Wchar-subscripts -Wparentheses -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
     69       1.1       eeh #CWARNFLAGS=	-Werror -Wall -Wstrict-prototypes -Wmissing-prototypes
     70  1.23.2.1   minoura CFLAGS=		${DEBUG} ${CWARNFLAGS} -Wa,-Av9a -mno-fpu
     71       1.1       eeh AFLAGS=		-x assembler-with-cpp -Wa,-Av9a -traditional-cpp -D_LOCORE
     72  1.23.2.1   minoura LINKFLAGS=	-p -Ttext f1000000 -Tdata f1400000 -e start >lderr
     73  1.23.2.1   minoura #LINKFLAGS=	-N -p -Ttext f1000000 -e start >lderr
     74      1.15   tsutsui STRIPFLAGS=	-g
     75      1.10       mrg 
     76      1.10       mrg %INCLUDES
     77       1.1       eeh 
     78       1.1       eeh ### find out what to use for libkern
     79      1.14       eeh # KERN_AS=	obj	# bcopy, bzero, memcpy, memset, etc. are in locore.s
     80       1.1       eeh .include "$S/lib/libkern/Makefile.inc"
     81       1.1       eeh .ifndef PROF
     82       1.1       eeh LIBKERN=	${KERNLIB}
     83       1.1       eeh .else
     84       1.1       eeh LIBKERN=	${KERNLIB_PROF}
     85       1.1       eeh .endif
     86       1.1       eeh 
     87       1.1       eeh ### find out what to use for libcompat
     88       1.1       eeh .include "$S/compat/common/Makefile.inc"
     89       1.1       eeh .ifndef PROF
     90       1.1       eeh LIBCOMPAT=	${COMPATLIB}
     91       1.1       eeh .else
     92       1.1       eeh LIBCOMPAT=	${COMPATLIB_PROF}
     93       1.1       eeh .endif
     94       1.1       eeh 
     95       1.1       eeh # compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
     96       1.1       eeh # HOSTED, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
     97       1.1       eeh 
     98  1.23.2.1   minoura NORMAL_C=	${CC} ${COPTS} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
     99  1.23.2.1   minoura NOOPT_C=	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
    100       1.1       eeh NORMAL_S=	${CC} ${AFLAGS} ${CPPFLAGS} -c $<
    101       1.1       eeh 
    102       1.1       eeh %OBJS
    103       1.1       eeh 
    104       1.1       eeh %CFILES
    105       1.1       eeh 
    106       1.1       eeh %SFILES
    107       1.1       eeh 
    108       1.1       eeh # load lines for config "xxx" will be emitted as:
    109       1.1       eeh # xxx: ${SYSTEM_DEP} swapxxx.o
    110       1.1       eeh #	${SYSTEM_LD_HEAD}
    111       1.1       eeh #	${SYSTEM_LD} swapxxx.o
    112       1.1       eeh #	${SYSTEM_LD_TAIL}
    113       1.1       eeh SYSTEM_OBJ=	locore.o \
    114       1.6  drochner 		param.o ioconf.o ${OBJS} ${LIBCOMPAT} ${LIBKERN}
    115       1.1       eeh SYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
    116       1.1       eeh SYSTEM_LD_HEAD=	@rm -f $@
    117       1.1       eeh SYSTEM_LD=	@echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
    118       1.1       eeh 		${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
    119       1.2       mrg SYSTEM_LD_TAIL=	@${SIZE} $@; chmod 755 $@
    120       1.1       eeh 
    121       1.1       eeh DEBUG?=
    122       1.1       eeh .if ${DEBUG} == "-g"
    123       1.1       eeh LINKFLAGS+=	-X
    124       1.1       eeh SYSTEM_LD_TAIL+=; \
    125      1.12       cgd 		echo mv -f $@ $@.gdb; mv -f $@ $@.gdb; \
    126      1.19       eeh 		echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \
    127      1.19       eeh 		${STRIP} ${STRIPFLAGS} -o $@ $@.gdb
    128       1.1       eeh .else
    129       1.1       eeh LINKFLAGS+=	-S
    130       1.1       eeh .endif
    131       1.1       eeh 
    132       1.1       eeh %LOAD
    133       1.2       mrg 
    134       1.2       mrg .if ${USE_GENASSYM} == "no"
    135       1.1       eeh assym.h: $S/kern/genassym.sh ${SPARC64}/sparc64/genassym.cf
    136  1.23.2.1   minoura 	sh $S/kern/genassym.sh ${CC} ${COPTS} ${CFLAGS} ${CPPFLAGS} ${PROF} \
    137       1.1       eeh 	    < ${SPARC64}/sparc64/genassym.cf > assym.h.tmp && \
    138       1.1       eeh 	mv -f assym.h.tmp assym.h
    139       1.1       eeh .else
    140       1.1       eeh HOSTED_CC=	${CC}
    141       1.1       eeh HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
    142  1.23.2.1   minoura HOSTED_CFLAGS=	${COPTS} ${CFLAGS}
    143       1.1       eeh 
    144       1.1       eeh HOSTED_C=	${HOSTED_CC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $<
    145       1.1       eeh 
    146       1.1       eeh assym.h: genassym
    147       1.1       eeh 	./genassym >assym.h
    148       1.1       eeh 
    149       1.1       eeh genassym: genassym.o
    150       1.1       eeh 	${CC} -o $@ genassym.o
    151       1.1       eeh 
    152       1.1       eeh genassym.o: ${SPARC64}/sparc64/genassym.c
    153       1.1       eeh 	${HOSTED_C}
    154       1.1       eeh .endif
    155       1.1       eeh 
    156       1.1       eeh param.c: $S/conf/param.c
    157       1.1       eeh 	rm -f param.c
    158       1.1       eeh 	cp $S/conf/param.c .
    159       1.1       eeh 
    160       1.1       eeh param.o: param.c Makefile
    161       1.1       eeh 	${NORMAL_C}
    162       1.1       eeh 
    163       1.1       eeh ioconf.o: ioconf.c
    164       1.1       eeh 	${NORMAL_C}
    165       1.1       eeh 
    166       1.1       eeh newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
    167       1.1       eeh 	sh $S/conf/newvers.sh
    168  1.23.2.1   minoura 	${CC} ${COPTS} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
    169      1.22       eeh 
    170       1.1       eeh 
    171      1.21       mrg __CLEANKERNEL: .USE
    172      1.21       mrg 	@echo "${.TARGET}ing the kernel objects"
    173       1.1       eeh 	rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \
    174       1.8       mrg 	    [Ee]rrs lderr linterrs makelinks assym.h.tmp assym.h
    175      1.21       mrg 
    176      1.21       mrg __CLEANDEPEND: .USE
    177      1.21       mrg 	rm -f .depend
    178      1.21       mrg 
    179      1.21       mrg clean: __CLEANKERNEL
    180      1.21       mrg 
    181      1.21       mrg cleandir distclean: __CLEANKERNEL __CLEANDEPEND
    182       1.1       eeh 
    183       1.1       eeh lint:
    184       1.1       eeh 	@lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \
    185       1.1       eeh 	    ${SPARC64}/sparc64/Locore.c ${CFILES} \
    186       1.1       eeh 	    ioconf.c param.c | \
    187       1.1       eeh 	    grep -v 'static function .* unused'
    188       1.1       eeh 
    189       1.1       eeh tags:
    190       1.1       eeh 	@echo "see $S/kern/Makefile for tags"
    191       1.1       eeh 
    192       1.1       eeh links:
    193       1.1       eeh 	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
    194       1.1       eeh 	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
    195       1.1       eeh 	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
    196       1.1       eeh 	  sort -u | comm -23 - dontlink | \
    197       1.1       eeh 	  sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
    198       1.1       eeh 	sh makelinks && rm -f dontlink
    199       1.1       eeh 
    200       1.1       eeh SRCS=	${SPARC64}/sparc64/locore.s \
    201       1.1       eeh 	param.c ioconf.c ${CFILES} ${SFILES}
    202       1.1       eeh depend: .depend
    203       1.1       eeh .depend: ${SRCS} assym.h param.c
    204       1.1       eeh 	${MKDEP} ${AFLAGS} ${CPPFLAGS} ${SPARC64}/sparc64/locore.s
    205       1.1       eeh 	${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
    206       1.9       mrg .if (${SFILES} != "")
    207       1.1       eeh 	${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
    208       1.9       mrg .endif
    209  1.23.2.1   minoura 	sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${COPTS} ${CFLAGS} \
    210       1.1       eeh 	  ${CPPFLAGS} < ${SPARC64}/sparc64/genassym.cf
    211       1.1       eeh 	@sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend
    212       1.1       eeh 	@rm -f assym.dep
    213      1.17      tron 
    214      1.17      tron dependall: depend all
    215      1.17      tron 
    216       1.1       eeh 
    217       1.1       eeh # depend on root or device configuration
    218       1.1       eeh autoconf.o conf.o: Makefile
    219       1.2       mrg 
    220       1.1       eeh # depend on network or filesystem configuration 
    221       1.1       eeh uipc_proto.o vfs_conf.o: Makefile 
    222       1.1       eeh 
    223       1.1       eeh # depend on maxusers
    224       1.1       eeh machdep.o: Makefile
    225       1.1       eeh 
    226       1.1       eeh # depend on CPU configuration 
    227       1.1       eeh bwtwo.o cgsix.o cgthree.o cgtwo.o cons.o dma.o esp.o fb.o if_ie.o: Makefile
    228       1.1       eeh ms.c obio.o zs.c autoconf.o clock.o cpu.o disksubr.o locore.o: Makefile
    229       1.1       eeh machdep.o mem.o openprom.o pmap.o vm_machdep.o: Makefile
    230       1.1       eeh 
    231       1.1       eeh 
    232       1.1       eeh locore.o: ${SPARC64}/sparc64/locore.s assym.h
    233       1.1       eeh 	${NORMAL_S}
    234      1.23   hubertf 
    235      1.23   hubertf # The install target can be redefined by putting a
    236      1.23   hubertf # install-kernel-${MACHINE_NAME} target into /etc/mk.conf
    237      1.23   hubertf MACHINE_NAME!=  uname -n
    238      1.23   hubertf install: install-kernel-${MACHINE_NAME}
    239      1.23   hubertf .if !target(install-kernel-${MACHINE_NAME}})
    240      1.23   hubertf install-kernel-${MACHINE_NAME}:
    241      1.23   hubertf 	rm -f /onetbsd
    242      1.23   hubertf 	ln /netbsd /onetbsd
    243      1.23   hubertf 	cp netbsd /nnetbsd
    244      1.23   hubertf 	mv /nnetbsd /netbsd
    245      1.23   hubertf .endif
    246       1.1       eeh 
    247       1.1       eeh %RULES
    248