Home | History | Annotate | Line # | Download | only in conf
Makefile.sparc revision 1.52
      1  1.52   thorpej # 	$NetBSD: Makefile.sparc,v 1.52 1998/05/31 23:25:43 thorpej Exp $
      2  1.15   deraadt 
      3  1.25   mycroft # Makefile for NetBSD
      4   1.1   deraadt #
      5   1.1   deraadt # This makefile is constructed from a machine description:
      6   1.1   deraadt #	config machineid
      7   1.1   deraadt # Most changes should be made in the machine description
      8  1.25   mycroft #	/sys/arch/sparc/conf/``machineid''
      9   1.1   deraadt # after which you should do
     10  1.25   mycroft #	config machineid
     11   1.1   deraadt # Machine generic makefile changes should be made in
     12  1.25   mycroft #	/sys/arch/sparc/conf/Makefile.sparc
     13   1.1   deraadt # after which config should be rerun for all machines of that type.
     14   1.1   deraadt #
     15   1.1   deraadt # N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE
     16   1.1   deraadt #	IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
     17   1.1   deraadt #
     18   1.1   deraadt # -DTRACE	compile in kernel tracing hooks
     19   1.1   deraadt # -DQUOTA	compile in file system quotas
     20   1.1   deraadt 
     21   1.1   deraadt # DEBUG is set to -g if debugging.
     22   1.1   deraadt # PROF is set to -pg if profiling.
     23   1.1   deraadt 
     24  1.50   thorpej AR?=	ar
     25  1.50   thorpej AS?=	as
     26  1.28   mycroft CC?=	cc
     27  1.50   thorpej CPP?=	cpp
     28  1.28   mycroft LD?=	ld
     29  1.49   thorpej LORDER?=lorder
     30  1.33   mycroft MKDEP?=	mkdep
     31  1.49   thorpej NM?=	nm
     32  1.50   thorpej RANLIB?=ranlib
     33  1.48     lukem SIZE?=	size
     34  1.37   mycroft STRIP?=	strip
     35  1.49   thorpej TSORT?=	tsort -q
     36  1.50   thorpej 
     37  1.48     lukem COPTS?=	-O2
     38   1.1   deraadt 
     39   1.1   deraadt # source tree is located via $S relative to the compilation directory
     40  1.36   mycroft .ifndef S
     41  1.33   mycroft S!=	cd ../../../..; pwd
     42  1.36   mycroft .endif
     43  1.33   mycroft SPARC=	$S/arch/sparc
     44   1.1   deraadt 
     45  1.51        tv HAVE_GCC28!=	${CC} --version | egrep "^(2\.8|egcs)" ; echo 
     46  1.34   mycroft INCLUDES=	-I. -I$S/arch -I$S -nostdinc
     47  1.35   mycroft CPPFLAGS=	${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL
     48  1.51        tv CWARNFLAGS?=	-Werror -Wall -Wstrict-prototypes -Wmissing-prototypes
     49  1.51        tv .if (${HAVE_GCC28} != "")
     50  1.51        tv CWARNFLAGS+=	-Wno-main
     51  1.51        tv .endif
     52  1.38  jonathan CFLAGS=		${DEBUG} ${COPTS} ${CWARNFLAGS}
     53  1.42        pk # add `-mno-fpu' to work around gcc (last noticed in v2.7.2) bug
     54  1.42        pk CFLAGS+=	-mno-fpu
     55  1.27   mycroft AFLAGS=		-x assembler-with-cpp -traditional-cpp -D_LOCORE
     56  1.46        pk LINKFLAGS=	-N -p -Ttext F0004000 -e start
     57  1.37   mycroft STRIPFLAGS=	-d
     58  1.37   mycroft 
     59   1.5   deraadt ### find out what to use for libkern
     60   1.5   deraadt .include "$S/lib/libkern/Makefile.inc"
     61   1.5   deraadt .ifndef PROF
     62   1.5   deraadt LIBKERN=	${KERNLIB}
     63   1.5   deraadt .else
     64   1.5   deraadt LIBKERN=	${KERNLIB_PROF}
     65   1.5   deraadt .endif
     66   1.5   deraadt 
     67  1.21  christos ### find out what to use for libcompat
     68  1.21  christos .include "$S/compat/common/Makefile.inc"
     69  1.21  christos .ifndef PROF
     70  1.21  christos LIBCOMPAT=	${COMPATLIB}
     71  1.21  christos .else
     72  1.21  christos LIBCOMPAT=	${COMPATLIB_PROF}
     73  1.21  christos .endif
     74  1.21  christos 
     75  1.35   mycroft # compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
     76  1.43  christos # HOSTED, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
     77   1.1   deraadt 
     78  1.25   mycroft NORMAL_C=	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
     79  1.52   thorpej NOPROF_C=	${CC} ${CFLAGS} ${CPPFLAGS} -c $<
     80  1.27   mycroft NORMAL_S=	${CC} ${AFLAGS} ${CPPFLAGS} -c $<
     81   1.1   deraadt 
     82   1.1   deraadt %OBJS
     83   1.1   deraadt 
     84   1.1   deraadt %CFILES
     85   1.1   deraadt 
     86  1.25   mycroft %SFILES
     87  1.25   mycroft 
     88   1.1   deraadt # load lines for config "xxx" will be emitted as:
     89   1.1   deraadt # xxx: ${SYSTEM_DEP} swapxxx.o
     90   1.1   deraadt #	${SYSTEM_LD_HEAD}
     91   1.1   deraadt #	${SYSTEM_LD} swapxxx.o
     92   1.1   deraadt #	${SYSTEM_LD_TAIL}
     93  1.25   mycroft SYSTEM_OBJ=	locore.o \
     94  1.29       cgd 		param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT}
     95  1.25   mycroft SYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
     96  1.25   mycroft SYSTEM_LD_HEAD=	@rm -f $@
     97  1.25   mycroft SYSTEM_LD=	@echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
     98  1.25   mycroft 		${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
     99  1.48     lukem SYSTEM_LD_TAIL=	@${SIZE} $@; chmod 755 $@
    100  1.25   mycroft 
    101   1.1   deraadt DEBUG?=
    102   1.1   deraadt .if ${DEBUG} == "-g"
    103  1.25   mycroft LINKFLAGS+=	-X
    104  1.25   mycroft SYSTEM_LD_TAIL+=; \
    105  1.25   mycroft 		echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
    106  1.37   mycroft 		echo ${STRIP} ${STRIPFLAGS} $@; ${STRIP} ${STRIPFLAGS} $@
    107   1.1   deraadt .else
    108  1.33   mycroft LINKFLAGS+=	-S
    109   1.1   deraadt .endif
    110   1.1   deraadt 
    111   1.1   deraadt %LOAD
    112   1.1   deraadt 
    113  1.44   mycroft assym.h: $S/kern/genassym.sh ${SPARC}/sparc/genassym.cf
    114  1.44   mycroft 	sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
    115  1.44   mycroft 	    < ${SPARC}/sparc/genassym.cf > assym.h.tmp && \
    116  1.44   mycroft 	mv -f assym.h.tmp assym.h
    117  1.25   mycroft 
    118  1.25   mycroft param.c: $S/conf/param.c
    119  1.25   mycroft 	rm -f param.c
    120  1.25   mycroft 	cp $S/conf/param.c .
    121   1.1   deraadt 
    122  1.25   mycroft param.o: param.c Makefile
    123  1.35   mycroft 	${NORMAL_C}
    124   1.1   deraadt 
    125  1.25   mycroft ioconf.o: ioconf.c
    126  1.25   mycroft 	${NORMAL_C}
    127   1.1   deraadt 
    128  1.25   mycroft newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
    129  1.25   mycroft 	sh $S/conf/newvers.sh
    130  1.25   mycroft 	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
    131   1.1   deraadt 
    132  1.47  christos __CLEANKERNEL: .USE
    133  1.47  christos 	@echo "${.TARGET}ing the kernel objects"
    134  1.29       cgd 	rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \
    135  1.44   mycroft 	    [Ee]rrs linterrs makelinks assym.h.tmp assym.h
    136  1.47  christos 
    137  1.47  christos __CLEANDEPEND: .USE
    138  1.47  christos 	rm -f .depend
    139  1.47  christos 
    140  1.47  christos clean: __CLEANKERNEL
    141  1.47  christos 
    142  1.47  christos cleandir: __CLEANKERNEL __CLEANDEPEND
    143   1.1   deraadt 
    144  1.25   mycroft lint:
    145  1.40     perry 	@lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \
    146  1.41     perry 	    ${SPARC}/sparc/Locore.c ${CFILES} \
    147  1.25   mycroft 	    ioconf.c param.c | \
    148  1.25   mycroft 	    grep -v 'static function .* unused'
    149   1.1   deraadt 
    150  1.25   mycroft tags:
    151  1.25   mycroft 	@echo "see $S/kern/Makefile for tags"
    152   1.1   deraadt 
    153   1.1   deraadt links:
    154   1.1   deraadt 	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
    155   1.1   deraadt 	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
    156   1.1   deraadt 	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
    157   1.1   deraadt 	  sort -u | comm -23 - dontlink | \
    158  1.25   mycroft 	  sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
    159   1.1   deraadt 	sh makelinks && rm -f dontlink
    160   1.1   deraadt 
    161  1.25   mycroft SRCS=	${SPARC}/sparc/locore.s \
    162  1.29       cgd 	param.c ioconf.c ${CFILES} ${SFILES}
    163  1.39        pk depend: .depend
    164  1.29       cgd .depend: ${SRCS} assym.h param.c
    165  1.33   mycroft 	${MKDEP} ${AFLAGS} ${CPPFLAGS} ${SPARC}/sparc/locore.s
    166  1.33   mycroft 	${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
    167  1.33   mycroft 	${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
    168  1.45       leo 	sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
    169  1.45       leo 	  ${CPPFLAGS} < ${SPARC}/sparc/genassym.cf
    170  1.45       leo 	@sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend
    171  1.45       leo 	@rm -f assym.dep
    172   1.1   deraadt 
    173  1.25   mycroft # depend on root or device configuration
    174  1.25   mycroft autoconf.o conf.o: Makefile
    175  1.25   mycroft  
    176  1.25   mycroft # depend on network or filesystem configuration 
    177  1.25   mycroft uipc_proto.o vfs_conf.o: Makefile 
    178   1.1   deraadt 
    179  1.25   mycroft # depend on maxusers
    180  1.43  christos machdep.o: Makefile
    181  1.11        pk 
    182  1.25   mycroft # depend on CPU configuration 
    183  1.25   mycroft bwtwo.o cgsix.o cgthree.o cgtwo.o cons.o dma.o esp.o fb.o if_ie.o: Makefile
    184  1.25   mycroft ms.c obio.o zs.c autoconf.o clock.o cpu.o disksubr.o locore.o: Makefile
    185  1.25   mycroft machdep.o mem.o openprom.o pmap.o vm_machdep.o: Makefile
    186   1.1   deraadt 
    187   1.5   deraadt 
    188  1.25   mycroft locore.o: ${SPARC}/sparc/locore.s assym.h
    189  1.25   mycroft 	${NORMAL_S}
    190   1.5   deraadt 
    191  1.25   mycroft %RULES
    192