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