Home | History | Annotate | Line # | Download | only in conf
Makefile.sparc revision 1.9
      1  1.1  deraadt # from:	@(#)Makefile.sparc	8.1 (Berkeley) 7/19/93
      2  1.9  deraadt # $Id: Makefile.sparc,v 1.9 1994/05/05 07:50:04 deraadt Exp $
      3  1.1  deraadt # Makefile for 4.4 BSD
      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.1  deraadt #	/sys/conf/``machineid''
      9  1.1  deraadt # after which you should do
     10  1.1  deraadt #	 config machineid
     11  1.1  deraadt # Machine generic makefile changes should be made in
     12  1.1  deraadt #	/sys/conf/Makefile.``machinetype''
     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.1  deraadt AS?=	as
     25  1.1  deraadt 
     26  1.5  deraadt CC=	cc ${DEBUG}
     27  1.1  deraadt CPP=	cpp
     28  1.1  deraadt LD=	ld
     29  1.1  deraadt TOUCH=	touch -f -c
     30  1.1  deraadt 
     31  1.1  deraadt # source tree is located via $S relative to the compilation directory
     32  1.2  deraadt S=	../../../..
     33  1.2  deraadt SPARC=	../..
     34  1.1  deraadt 
     35  1.3  deraadt INCLUDES= -I. -I$S/arch -I$S -I$S/sys
     36  1.9  deraadt COPTS=	${INCLUDES} ${IDENT} -DKERNEL
     37  1.2  deraadt CFLAGS=	${COPTS}
     38  1.1  deraadt 
     39  1.5  deraadt ### find out what to use for libkern
     40  1.5  deraadt .include "$S/lib/libkern/Makefile.inc"
     41  1.5  deraadt .ifndef PROF
     42  1.5  deraadt LIBKERN=	${KERNLIB}
     43  1.5  deraadt .else
     44  1.5  deraadt LIBKERN=	${KERNLIB_PROF}
     45  1.5  deraadt .endif
     46  1.5  deraadt 
     47  1.1  deraadt # compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
     48  1.1  deraadt # where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix,
     49  1.1  deraadt # capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
     50  1.1  deraadt # is marked as config-dependent.
     51  1.1  deraadt 
     52  1.1  deraadt # sparc kernel uses volatile, rather than heavy "device-driver"s.
     53  1.1  deraadt 
     54  1.1  deraadt NORMAL_C=	${CC} -c ${CFLAGS} ${PROF} $<
     55  1.1  deraadt NORMAL_C_C=	${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
     56  1.1  deraadt 
     57  1.1  deraadt # optimizer breaks sometimes; temporary workaround uses ${NOOPT_C}
     58  1.1  deraadt NOOPT_C=	${CC} -c ${COPTS} ${PROF} ${PARAM} $<
     59  1.1  deraadt 
     60  1.1  deraadt NORMAL_S=	rm -f $*.c; ln -s $< $*.c; \
     61  1.1  deraadt 		${CC} ${COPTS} -I${SPARC}/sparc -E $*.c > $*.i; \
     62  1.1  deraadt 		${AS} -o $@ $*.i; rm -f $*.c $*.i
     63  1.1  deraadt NORMAL_S_C=	rm -f $*.c; ln -s $< $*.c; \
     64  1.1  deraadt 		${CC} ${COPTS} ${PARAM} -I${SPARC}/sparc -E $*.c > $*.i; \
     65  1.1  deraadt 		${AS} -o $@ $*.i; rm -f $*.c $*.i
     66  1.1  deraadt 
     67  1.1  deraadt %OBJS
     68  1.1  deraadt 
     69  1.1  deraadt %CFILES
     70  1.1  deraadt 
     71  1.1  deraadt # load lines for config "xxx" will be emitted as:
     72  1.1  deraadt # xxx: ${SYSTEM_DEP} swapxxx.o
     73  1.1  deraadt #	${SYSTEM_LD_HEAD}
     74  1.1  deraadt #	${SYSTEM_LD} swapxxx.o
     75  1.1  deraadt #	${SYSTEM_LD_TAIL}
     76  1.1  deraadt DEBUG?=
     77  1.1  deraadt .if ${DEBUG} == "-g"
     78  1.1  deraadt LDX=-X
     79  1.1  deraadt .else
     80  1.1  deraadt LDX=-x
     81  1.1  deraadt .endif
     82  1.5  deraadt SYSTEM_OBJ=	locore.o ${OBJS} param.o ioconf.o ${LIBKERN}
     83  1.7       pk .ifdef PROF
     84  1.7       pk SYSTEM_OBJ+=	subr_mcount.o
     85  1.7       pk .endif
     86  1.1  deraadt SYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
     87  1.5  deraadt SYSTEM_LD_HEAD=	@echo loading $@; rm -f $@
     88  1.5  deraadt SYSTEM_LD=	@${LD} ${LDX} -p -N -e start -T f8004000 -o $@ \
     89  1.5  deraadt 		    ${SYSTEM_OBJ} vers.o
     90  1.5  deraadt SYSTEM_LD_TAIL=	@echo rearranging symbols; size $@; chmod 755 $@
     91  1.1  deraadt #.if ${DEBUG} == "-g"
     92  1.1  deraadt #SYSTEM_LD_TAIL+=; echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
     93  1.1  deraadt #		echo strip -d $@; strip -d $@
     94  1.1  deraadt #.endif
     95  1.1  deraadt 
     96  1.1  deraadt %LOAD
     97  1.1  deraadt 
     98  1.1  deraadt newvers:
     99  1.1  deraadt 	sh $S/conf/newvers.sh
    100  1.1  deraadt 	${CC} ${CFLAGS} -c vers.c
    101  1.1  deraadt 
    102  1.1  deraadt clean:
    103  1.2  deraadt 	rm -f eddep *netbsd netbsd.gdb tags tags1 *.[io] [a-z]*.s \
    104  1.1  deraadt 		Errs errs linterrs makelinks
    105  1.1  deraadt 
    106  1.1  deraadt locore.o: ${SPARC}/sparc/locore.s assym.s
    107  1.1  deraadt 	${NORMAL_S}
    108  1.1  deraadt 
    109  1.1  deraadt # depend on maxusers
    110  1.1  deraadt assym.s: Makefile
    111  1.1  deraadt 
    112  1.1  deraadt ./assym.s: assym.s
    113  1.1  deraadt assym.s: genassym
    114  1.1  deraadt 	./genassym >assym.s
    115  1.1  deraadt 
    116  1.1  deraadt genassym: genassym.o
    117  1.8  deraadt 	${CC} -static -o $@ genassym.o
    118  1.1  deraadt 
    119  1.1  deraadt genassym.o: ${SPARC}/sparc/genassym.c
    120  1.7       pk 	${CC} -c ${CFLAGS} -I/usr/include ${PARAM} $<
    121  1.1  deraadt 
    122  1.6  deraadt SRCS= ${CFILES} ioconf.c param.c
    123  1.1  deraadt depend: .depend
    124  1.4  deraadt .depend: ${SRCS} assym.s
    125  1.1  deraadt 	mkdep ${COPTS} ${SRCS}
    126  1.6  deraadt 	mkdep -a -p ${COPTS} ${SPARC}/sparc/genassym.c 
    127  1.1  deraadt 
    128  1.1  deraadt links:
    129  1.1  deraadt 	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
    130  1.1  deraadt 	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
    131  1.1  deraadt 	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
    132  1.1  deraadt 	  sort -u | comm -23 - dontlink | \
    133  1.1  deraadt 	  sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
    134  1.1  deraadt 	sh makelinks && rm -f dontlink
    135  1.1  deraadt 
    136  1.1  deraadt tags: depend
    137  1.1  deraadt 	sh $S/conf/systags.sh
    138  1.1  deraadt 	rm -f tags1
    139  1.1  deraadt 	sed -e 's,	../,	,' tags > tags1
    140  1.1  deraadt 
    141  1.1  deraadt ioconf.o: ioconf.c
    142  1.1  deraadt 	${CC} -c ${CFLAGS} ioconf.c
    143  1.1  deraadt 
    144  1.1  deraadt param.c: $S/conf/param.c
    145  1.1  deraadt 	rm -f param.c
    146  1.1  deraadt 	cp $S/conf/param.c .
    147  1.1  deraadt 
    148  1.1  deraadt param.o: param.c Makefile
    149  1.1  deraadt 	${CC} -c ${CFLAGS} ${PARAM} param.c
    150  1.7       pk 
    151  1.7       pk .ifdef PROF
    152  1.7       pk subr_mcount.o: $S/kern/subr_mcount.c
    153  1.7       pk 	${CC} -c ${CFLAGS} $S/kern/subr_mcount.c
    154  1.7       pk .endif
    155  1.1  deraadt 
    156  1.1  deraadt %RULES
    157  1.5  deraadt 
    158  1.5  deraadt # DO NOT DELETE THIS LINE -- make depend uses it
    159  1.5  deraadt 
    160