Home | History | Annotate | Line # | Download | only in conf
Makefile.sparc revision 1.21
      1  1.21  christos # 	$NetBSD: Makefile.sparc,v 1.21 1995/06/24 20:47:36 christos Exp $
      2  1.15   deraadt 
      3  1.15   deraadt # @(#)Makefile.sparc	8.1 (Berkeley) 7/19/93
      4   1.1   deraadt # Makefile for 4.4 BSD
      5   1.1   deraadt #
      6   1.1   deraadt # This makefile is constructed from a machine description:
      7   1.1   deraadt #	config machineid
      8   1.1   deraadt # Most changes should be made in the machine description
      9   1.1   deraadt #	/sys/conf/``machineid''
     10   1.1   deraadt # after which you should do
     11   1.1   deraadt #	 config machineid
     12   1.1   deraadt # Machine generic makefile changes should be made in
     13   1.1   deraadt #	/sys/conf/Makefile.``machinetype''
     14   1.1   deraadt # after which config should be rerun for all machines of that type.
     15   1.1   deraadt #
     16   1.1   deraadt # N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE
     17   1.1   deraadt #	IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
     18   1.1   deraadt #
     19   1.1   deraadt # -DTRACE	compile in kernel tracing hooks
     20   1.1   deraadt # -DQUOTA	compile in file system quotas
     21   1.1   deraadt 
     22   1.1   deraadt # DEBUG is set to -g if debugging.
     23   1.1   deraadt # PROF is set to -pg if profiling.
     24   1.1   deraadt 
     25   1.1   deraadt AS?=	as
     26   1.1   deraadt 
     27   1.5   deraadt CC=	cc ${DEBUG}
     28   1.1   deraadt CPP=	cpp
     29   1.1   deraadt LD=	ld
     30   1.1   deraadt TOUCH=	touch -f -c
     31  1.12   deraadt AWK=	awk
     32   1.1   deraadt 
     33   1.1   deraadt # source tree is located via $S relative to the compilation directory
     34   1.2   deraadt S=	../../../..
     35   1.2   deraadt SPARC=	../..
     36   1.1   deraadt 
     37   1.3   deraadt INCLUDES= -I. -I$S/arch -I$S -I$S/sys
     38  1.20       jtc COPTS=	${INCLUDES} ${IDENT} -D_KERNEL
     39  1.13   deraadt CFLAGS=	${COPTS} -O2
     40   1.1   deraadt 
     41   1.5   deraadt ### find out what to use for libkern
     42   1.5   deraadt .include "$S/lib/libkern/Makefile.inc"
     43   1.5   deraadt .ifndef PROF
     44   1.5   deraadt LIBKERN=	${KERNLIB}
     45   1.5   deraadt .else
     46   1.5   deraadt LIBKERN=	${KERNLIB_PROF}
     47   1.5   deraadt .endif
     48   1.5   deraadt 
     49  1.21  christos ### find out what to use for libcompat
     50  1.21  christos .include "$S/compat/common/Makefile.inc"
     51  1.21  christos .ifndef PROF
     52  1.21  christos LIBCOMPAT=	${COMPATLIB}
     53  1.21  christos .else
     54  1.21  christos LIBCOMPAT=	${COMPATLIB_PROF}
     55  1.21  christos .endif
     56  1.21  christos 
     57   1.1   deraadt # compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
     58   1.1   deraadt # where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix,
     59   1.1   deraadt # capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
     60   1.1   deraadt # is marked as config-dependent.
     61   1.1   deraadt 
     62   1.1   deraadt # sparc kernel uses volatile, rather than heavy "device-driver"s.
     63   1.1   deraadt 
     64   1.1   deraadt NORMAL_C=	${CC} -c ${CFLAGS} ${PROF} $<
     65   1.1   deraadt NORMAL_C_C=	${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
     66   1.1   deraadt 
     67   1.1   deraadt # optimizer breaks sometimes; temporary workaround uses ${NOOPT_C}
     68   1.1   deraadt NOOPT_C=	${CC} -c ${COPTS} ${PROF} ${PARAM} $<
     69   1.1   deraadt 
     70   1.1   deraadt NORMAL_S=	rm -f $*.c; ln -s $< $*.c; \
     71   1.1   deraadt 		${CC} ${COPTS} -I${SPARC}/sparc -E $*.c > $*.i; \
     72   1.1   deraadt 		${AS} -o $@ $*.i; rm -f $*.c $*.i
     73   1.1   deraadt NORMAL_S_C=	rm -f $*.c; ln -s $< $*.c; \
     74   1.1   deraadt 		${CC} ${COPTS} ${PARAM} -I${SPARC}/sparc -E $*.c > $*.i; \
     75   1.1   deraadt 		${AS} -o $@ $*.i; rm -f $*.c $*.i
     76   1.1   deraadt 
     77   1.1   deraadt %OBJS
     78   1.1   deraadt 
     79   1.1   deraadt %CFILES
     80   1.1   deraadt 
     81   1.1   deraadt # load lines for config "xxx" will be emitted as:
     82   1.1   deraadt # xxx: ${SYSTEM_DEP} swapxxx.o
     83   1.1   deraadt #	${SYSTEM_LD_HEAD}
     84   1.1   deraadt #	${SYSTEM_LD} swapxxx.o
     85   1.1   deraadt #	${SYSTEM_LD_TAIL}
     86   1.1   deraadt DEBUG?=
     87   1.1   deraadt .if ${DEBUG} == "-g"
     88   1.1   deraadt LDX=-X
     89   1.1   deraadt .else
     90   1.1   deraadt LDX=-x
     91   1.1   deraadt .endif
     92  1.21  christos SYSTEM_OBJ=	locore.o vnode_if.o ${OBJS} param.o ioconf.o \
     93  1.21  christos 		${LIBKERN} ${LIBCOMPAT}
     94   1.1   deraadt SYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
     95   1.5   deraadt SYSTEM_LD_HEAD=	@echo loading $@; rm -f $@
     96   1.5   deraadt SYSTEM_LD=	@${LD} ${LDX} -p -N -e start -T f8004000 -o $@ \
     97   1.5   deraadt 		    ${SYSTEM_OBJ} vers.o
     98   1.5   deraadt SYSTEM_LD_TAIL=	@echo rearranging symbols; size $@; chmod 755 $@
     99   1.1   deraadt #.if ${DEBUG} == "-g"
    100   1.1   deraadt #SYSTEM_LD_TAIL+=; echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
    101   1.1   deraadt #		echo strip -d $@; strip -d $@
    102   1.1   deraadt #.endif
    103   1.1   deraadt 
    104   1.1   deraadt %LOAD
    105   1.1   deraadt 
    106   1.1   deraadt newvers:
    107   1.1   deraadt 	sh $S/conf/newvers.sh
    108   1.1   deraadt 	${CC} ${CFLAGS} -c vers.c
    109   1.1   deraadt 
    110  1.21  christos clean::
    111  1.14   deraadt 	rm -f eddep *netbsd netbsd.gdb tags vnode_if.[ch] tags1 *.[io] \
    112  1.16   deraadt 		[a-z]*.s Errs errs linterrs makelinks genassym
    113   1.1   deraadt 
    114   1.1   deraadt locore.o: ${SPARC}/sparc/locore.s assym.s
    115   1.1   deraadt 	${NORMAL_S}
    116   1.1   deraadt 
    117   1.1   deraadt # depend on maxusers
    118   1.1   deraadt assym.s: Makefile
    119   1.1   deraadt 
    120   1.1   deraadt ./assym.s: assym.s
    121   1.1   deraadt assym.s: genassym
    122   1.1   deraadt 	./genassym >assym.s
    123   1.1   deraadt 
    124   1.1   deraadt genassym: genassym.o
    125   1.8   deraadt 	${CC} -static -o $@ genassym.o
    126   1.1   deraadt 
    127   1.1   deraadt genassym.o: ${SPARC}/sparc/genassym.c
    128  1.19        pk 	${CC} -c ${CFLAGS} ${PARAM} $<
    129   1.1   deraadt 
    130  1.11        pk SRCS= ${CFILES} ioconf.c param.c vnode_if.c
    131   1.1   deraadt depend: .depend
    132   1.4   deraadt .depend: ${SRCS} assym.s
    133   1.1   deraadt 	mkdep ${COPTS} ${SRCS}
    134   1.6   deraadt 	mkdep -a -p ${COPTS} ${SPARC}/sparc/genassym.c 
    135   1.1   deraadt 
    136   1.1   deraadt links:
    137   1.1   deraadt 	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
    138   1.1   deraadt 	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
    139   1.1   deraadt 	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
    140   1.1   deraadt 	  sort -u | comm -23 - dontlink | \
    141   1.1   deraadt 	  sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
    142   1.1   deraadt 	sh makelinks && rm -f dontlink
    143   1.1   deraadt 
    144   1.1   deraadt tags: depend
    145   1.1   deraadt 	sh $S/conf/systags.sh
    146   1.1   deraadt 	rm -f tags1
    147   1.1   deraadt 	sed -e 's,	../,	,' tags > tags1
    148   1.1   deraadt 
    149   1.1   deraadt ioconf.o: ioconf.c
    150   1.1   deraadt 	${CC} -c ${CFLAGS} ioconf.c
    151   1.1   deraadt 
    152   1.1   deraadt param.c: $S/conf/param.c
    153   1.1   deraadt 	rm -f param.c
    154   1.1   deraadt 	cp $S/conf/param.c .
    155   1.1   deraadt 
    156   1.1   deraadt param.o: param.c Makefile
    157   1.1   deraadt 	${CC} -c ${CFLAGS} ${PARAM} param.c
    158  1.11        pk 
    159  1.12   deraadt vnode_if.c vnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src
    160  1.12   deraadt 	AWK="${AWK}" sh $S/kern/vnode_if.sh $S/kern/vnode_if.src
    161   1.1   deraadt 
    162   1.1   deraadt %RULES
    163   1.5   deraadt 
    164   1.5   deraadt # DO NOT DELETE THIS LINE -- make depend uses it
    165   1.5   deraadt 
    166