Home | History | Annotate | Line # | Download | only in conf
Makefile.sparc revision 1.36
      1  1.36   mycroft # 	$NetBSD: Makefile.sparc,v 1.36 1996/08/31 21:41:46 mycroft 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.28   mycroft CC?=	cc
     25  1.28   mycroft LD?=	ld
     26  1.33   mycroft MKDEP?=	mkdep
     27  1.28   mycroft STRIP?=	strip -d
     28  1.28   mycroft TOUCH?=	touch -f -c
     29   1.1   deraadt 
     30   1.1   deraadt # source tree is located via $S relative to the compilation directory
     31  1.36   mycroft .ifndef S
     32  1.33   mycroft S!=	cd ../../../..; pwd
     33  1.36   mycroft .endif
     34  1.33   mycroft SPARC=	$S/arch/sparc
     35   1.1   deraadt 
     36  1.34   mycroft INCLUDES=	-I. -I$S/arch -I$S -nostdinc
     37  1.35   mycroft CPPFLAGS=	${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL
     38  1.33   mycroft CWARNFLAGS=	-Werror -Wall -Wstrict-prototypes -Wmissing-prototypes
     39  1.33   mycroft CFLAGS=		${DEBUG} ${CWARNFLAGS} -O2 
     40  1.27   mycroft AFLAGS=		-x assembler-with-cpp -traditional-cpp -D_LOCORE
     41  1.25   mycroft LINKFLAGS=	-N -p -Ttext F8004000 -e start
     42   1.1   deraadt 
     43   1.5   deraadt ### find out what to use for libkern
     44   1.5   deraadt .include "$S/lib/libkern/Makefile.inc"
     45   1.5   deraadt .ifndef PROF
     46   1.5   deraadt LIBKERN=	${KERNLIB}
     47   1.5   deraadt .else
     48   1.5   deraadt LIBKERN=	${KERNLIB_PROF}
     49   1.5   deraadt .endif
     50   1.5   deraadt 
     51  1.21  christos ### find out what to use for libcompat
     52  1.21  christos .include "$S/compat/common/Makefile.inc"
     53  1.21  christos .ifndef PROF
     54  1.21  christos LIBCOMPAT=	${COMPATLIB}
     55  1.21  christos .else
     56  1.21  christos LIBCOMPAT=	${COMPATLIB_PROF}
     57  1.21  christos .endif
     58  1.21  christos 
     59  1.35   mycroft # compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
     60  1.35   mycroft # HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
     61   1.1   deraadt 
     62  1.25   mycroft NORMAL_C=	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
     63  1.27   mycroft NORMAL_S=	${CC} ${AFLAGS} ${CPPFLAGS} -c $<
     64   1.1   deraadt 
     65  1.35   mycroft HOSTED_C=	${NORMAL_C:S/^-pg$//:S/^-p$//:S/^-nostdinc$//}
     66  1.34   mycroft 
     67   1.1   deraadt %OBJS
     68   1.1   deraadt 
     69   1.1   deraadt %CFILES
     70   1.1   deraadt 
     71  1.25   mycroft %SFILES
     72  1.25   mycroft 
     73   1.1   deraadt # load lines for config "xxx" will be emitted as:
     74   1.1   deraadt # xxx: ${SYSTEM_DEP} swapxxx.o
     75   1.1   deraadt #	${SYSTEM_LD_HEAD}
     76   1.1   deraadt #	${SYSTEM_LD} swapxxx.o
     77   1.1   deraadt #	${SYSTEM_LD_TAIL}
     78  1.25   mycroft SYSTEM_OBJ=	locore.o \
     79  1.29       cgd 		param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT}
     80  1.25   mycroft SYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
     81  1.25   mycroft SYSTEM_LD_HEAD=	@rm -f $@
     82  1.25   mycroft SYSTEM_LD=	@echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
     83  1.25   mycroft 		${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
     84  1.25   mycroft SYSTEM_LD_TAIL=	@size $@; chmod 755 $@
     85  1.25   mycroft 
     86   1.1   deraadt DEBUG?=
     87   1.1   deraadt .if ${DEBUG} == "-g"
     88  1.25   mycroft LINKFLAGS+=	-X
     89  1.25   mycroft SYSTEM_LD_TAIL+=; \
     90  1.25   mycroft 		echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
     91  1.25   mycroft 		echo ${STRIP} $@; ${STRIP} $@
     92   1.1   deraadt .else
     93  1.33   mycroft LINKFLAGS+=	-S
     94   1.1   deraadt .endif
     95   1.1   deraadt 
     96   1.1   deraadt %LOAD
     97   1.1   deraadt 
     98  1.25   mycroft assym.h: genassym
     99  1.25   mycroft 	./genassym >assym.h
    100  1.25   mycroft 
    101  1.25   mycroft genassym: genassym.o
    102  1.25   mycroft 	${CC} -o $@ genassym.o
    103  1.25   mycroft 
    104  1.25   mycroft genassym.o: ${SPARC}/sparc/genassym.c
    105  1.35   mycroft 	${HOSTED_C}
    106  1.25   mycroft 
    107  1.25   mycroft param.c: $S/conf/param.c
    108  1.25   mycroft 	rm -f param.c
    109  1.25   mycroft 	cp $S/conf/param.c .
    110   1.1   deraadt 
    111  1.25   mycroft param.o: param.c Makefile
    112  1.35   mycroft 	${NORMAL_C}
    113   1.1   deraadt 
    114  1.25   mycroft ioconf.o: ioconf.c
    115  1.25   mycroft 	${NORMAL_C}
    116   1.1   deraadt 
    117  1.25   mycroft newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
    118  1.25   mycroft 	sh $S/conf/newvers.sh
    119  1.25   mycroft 	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
    120   1.1   deraadt 
    121   1.1   deraadt 
    122  1.25   mycroft clean::
    123  1.29       cgd 	rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \
    124  1.25   mycroft 	    [Ee]rrs linterrs makelinks genassym genassym.o assym.h
    125   1.1   deraadt 
    126  1.25   mycroft lint:
    127  1.35   mycroft 	@lint -hbxncez -DGENERIC -Dvolatile= ${CPPFLAGS} -UKGDB \
    128  1.25   mycroft 	    ${SPARC}/sparc/Locore.c ${CFILES} ${SPARC}/sparc/swapgeneric.c \
    129  1.25   mycroft 	    ioconf.c param.c | \
    130  1.25   mycroft 	    grep -v 'static function .* unused'
    131   1.1   deraadt 
    132  1.25   mycroft tags:
    133  1.25   mycroft 	@echo "see $S/kern/Makefile for tags"
    134   1.1   deraadt 
    135   1.1   deraadt links:
    136   1.1   deraadt 	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
    137   1.1   deraadt 	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
    138   1.1   deraadt 	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
    139   1.1   deraadt 	  sort -u | comm -23 - dontlink | \
    140  1.25   mycroft 	  sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
    141   1.1   deraadt 	sh makelinks && rm -f dontlink
    142   1.1   deraadt 
    143  1.25   mycroft SRCS=	${SPARC}/sparc/locore.s \
    144  1.29       cgd 	param.c ioconf.c ${CFILES} ${SFILES}
    145  1.31   mycroft depend:: .depend
    146  1.29       cgd .depend: ${SRCS} assym.h param.c
    147  1.33   mycroft 	${MKDEP} ${AFLAGS} ${CPPFLAGS} ${SPARC}/sparc/locore.s
    148  1.33   mycroft 	${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
    149  1.33   mycroft 	${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
    150  1.35   mycroft 	${MKDEP} -a ${CFLAGS} ${CPPFLAGS} ${SPARC}/sparc/genassym.c
    151   1.1   deraadt 
    152   1.1   deraadt 
    153  1.25   mycroft # depend on root or device configuration
    154  1.25   mycroft autoconf.o conf.o: Makefile
    155  1.25   mycroft  
    156  1.25   mycroft # depend on network or filesystem configuration 
    157  1.25   mycroft uipc_proto.o vfs_conf.o: Makefile 
    158   1.1   deraadt 
    159  1.25   mycroft # depend on maxusers
    160  1.25   mycroft genassym.o machdep.o: Makefile
    161  1.11        pk 
    162  1.25   mycroft # depend on CPU configuration 
    163  1.25   mycroft bwtwo.o cgsix.o cgthree.o cgtwo.o cons.o dma.o esp.o fb.o if_ie.o: Makefile
    164  1.25   mycroft ms.c obio.o zs.c autoconf.o clock.o cpu.o disksubr.o locore.o: Makefile
    165  1.25   mycroft machdep.o mem.o openprom.o pmap.o vm_machdep.o: Makefile
    166   1.1   deraadt 
    167   1.5   deraadt 
    168  1.25   mycroft locore.o: ${SPARC}/sparc/locore.s assym.h
    169  1.25   mycroft 	${NORMAL_S}
    170   1.5   deraadt 
    171  1.25   mycroft %RULES
    172