Home | History | Annotate | Line # | Download | only in conf
Makefile.next68k revision 1.6
      1  1.6  augustss # $NetBSD: Makefile.next68k,v 1.6 1999/01/08 19:26:14 augustss Exp $
      2  1.1       dbj 
      3  1.1       dbj # Makefile for NetBSD
      4  1.1       dbj #
      5  1.1       dbj # This makefile is constructed from a machine description:
      6  1.1       dbj #	config machineid
      7  1.1       dbj # Most changes should be made in the machine description
      8  1.1       dbj #	/sys/arch/next68k/conf/``machineid''
      9  1.1       dbj # after which you should do
     10  1.1       dbj #	config machineid
     11  1.1       dbj # Machine generic makefile changes should be made in
     12  1.1       dbj #	/sys/arch/next68k/conf/Makefile.next68k
     13  1.1       dbj # after which config should be rerun for all machines of that type.
     14  1.1       dbj #
     15  1.1       dbj # N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE
     16  1.1       dbj #	IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
     17  1.1       dbj #
     18  1.1       dbj # -DTRACE	compile in kernel tracing hooks
     19  1.1       dbj # -DQUOTA	compile in file system quotas
     20  1.1       dbj 
     21  1.1       dbj # DEBUG is set to -g if debugging.
     22  1.1       dbj # PROF is set to -pg if profiling.
     23  1.1       dbj 
     24  1.1       dbj # since we are cross compiling, these get set wrong
     25  1.1       dbj # if we don't put them here.
     26  1.1       dbj MACHINE=next68k
     27  1.1       dbj MACHINE_ARCH=m68k
     28  1.1       dbj 
     29  1.1       dbj AR?=	ar
     30  1.1       dbj AS?=	as
     31  1.1       dbj CC?=	cc
     32  1.1       dbj CPP?=	cpp
     33  1.1       dbj LD?=	ld
     34  1.1       dbj LORDER?=lorder
     35  1.1       dbj MKDEP?=	mkdep
     36  1.1       dbj NM?=	nm
     37  1.1       dbj RANLIB?=ranlib
     38  1.1       dbj SIZE?=	size
     39  1.1       dbj STRIP?=	strip
     40  1.1       dbj TSORT?=	tsort -q
     41  1.1       dbj 
     42  1.1       dbj DEBUG=-g
     43  1.1       dbj COPTS?= -O2
     44  1.1       dbj 
     45  1.1       dbj # source tree is located via $S relative to the compilation directory
     46  1.1       dbj .ifndef S
     47  1.1       dbj S!=	cd ../../../..; pwd
     48  1.1       dbj .endif
     49  1.1       dbj NEXT68K=	$S/arch/next68k
     50  1.1       dbj 
     51  1.5       dbj HAVE_GCC28!=	${CC} --version | egrep "^(2\.8|egcs)" ; echo 
     52  1.1       dbj INCLUDES=	-I. -I$S/arch -I$S -nostdinc
     53  1.1       dbj CPPFLAGS=	${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL \
     54  1.1       dbj 		-undef -Dmc68020 -Dnext68k -D__NetBSD__
     55  1.1       dbj #		-U__NeXT__ -UNeXT -U__NeXT -U_NEXT_SOURCE -U__MACH__ \
     56  1.1       dbj #		-DCROSS_COMPILE_NEXTSTEP
     57  1.6  augustss CWARNFLAGS=	-Wall -Wstrict-prototypes -Wmissing-prototypes -Wno-format \
     58  1.6  augustss 		-Wpointer-arith
     59  1.5       dbj .if (${HAVE_GCC28} != "")
     60  1.5       dbj CWARNFLAGS+=	-Wno-main
     61  1.5       dbj .endif
     62  1.1       dbj CFLAGS=		${DEBUG} ${COPTS} ${CWARNFLAGS} -msoft-float
     63  1.1       dbj AFLAGS=		-x assembler-with-cpp -traditional-cpp -D_LOCORE
     64  1.1       dbj LINKFLAGS=	-n -Ttext 0 -e start 
     65  1.1       dbj #LINKFLAGS=	-seg1addr 0x4000000
     66  1.2       dbj STRIPFLAGS?=	-d
     67  1.1       dbj # -S is used in gnu strip, rather than -d:
     68  1.1       dbj #STRIPFLAGS=	-S
     69  1.1       dbj 
     70  1.1       dbj ### Find out what to use for libkern.
     71  1.4  drochner KERN_AS=	obj
     72  1.1       dbj .include "$S/lib/libkern/Makefile.inc"
     73  1.1       dbj .ifndef PROF
     74  1.1       dbj LIBKERN=${KERNLIB}
     75  1.1       dbj .else
     76  1.1       dbj LIBKERN=${KERNLIB_PROF}
     77  1.1       dbj .endif
     78  1.1       dbj 
     79  1.1       dbj ### Find out what to use for libcompat.
     80  1.1       dbj .include "$S/compat/common/Makefile.inc"
     81  1.1       dbj .ifndef PROF
     82  1.1       dbj LIBCOMPAT=${COMPATLIB}
     83  1.1       dbj .else
     84  1.1       dbj LIBCOMPAT=${COMPATLIB_PROF}
     85  1.1       dbj .endif
     86  1.1       dbj 
     87  1.1       dbj ### for the Motorola 68040 Floating Point Software Product
     88  1.1       dbj .include "$S/arch/m68k/fpsp/Makefile.inc"
     89  1.1       dbj 
     90  1.1       dbj # compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
     91  1.1       dbj # HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
     92  1.1       dbj 
     93  1.1       dbj NORMAL_C=	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
     94  1.1       dbj NORMAL_S=	${CC} ${AFLAGS} ${CPPFLAGS} -c $<
     95  1.1       dbj #NORMAL_S=	${CPP} ${AFLAGS} ${CPPFLAGS} $< | sed -e 's/^\#.*//' | ${AS} -o ${.TARGET}
     96  1.1       dbj 
     97  1.1       dbj %OBJS
     98  1.1       dbj 
     99  1.1       dbj %CFILES
    100  1.1       dbj 
    101  1.1       dbj %SFILES
    102  1.1       dbj 
    103  1.1       dbj # load lines for config "xxx" will be emitted as:
    104  1.1       dbj # xxx: ${SYSTEM_DEP} swapxxx.o
    105  1.1       dbj #	${SYSTEM_LD_HEAD}
    106  1.1       dbj #	${SYSTEM_LD} swapxxx.o
    107  1.1       dbj #	${SYSTEM_LD_TAIL}
    108  1.1       dbj SYSTEM_OBJ=	locore.o ${FPSP} \
    109  1.4  drochner 		param.o ioconf.o ${OBJS} ${LIBCOMPAT} ${LIBKERN}
    110  1.1       dbj SYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
    111  1.1       dbj SYSTEM_LD_HEAD=	@rm -f $@
    112  1.1       dbj SYSTEM_LD=	@echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
    113  1.1       dbj 		${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
    114  1.1       dbj SYSTEM_LD_TAIL=	@${SIZE} $@; chmod 755 $@
    115  1.1       dbj 
    116  1.1       dbj DEBUG?=
    117  1.1       dbj .if ${DEBUG} == "-g"
    118  1.1       dbj LINKFLAGS+=	-X
    119  1.1       dbj SYSTEM_LD_TAIL+=; \
    120  1.1       dbj 		echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
    121  1.1       dbj 		echo ${STRIP} ${STRIPFLAGS} $@; ${STRIP} ${STRIPFLAGS} $@
    122  1.1       dbj .else
    123  1.1       dbj LINKFLAGS+=	-S
    124  1.1       dbj .endif
    125  1.1       dbj 
    126  1.1       dbj %LOAD
    127  1.1       dbj 
    128  1.1       dbj assym.h: $S/kern/genassym.sh ${NEXT68K}/next68k/genassym.cf
    129  1.1       dbj 	sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
    130  1.1       dbj 	    < ${NEXT68K}/next68k/genassym.cf > assym.h.tmp && \
    131  1.1       dbj 	mv -f assym.h.tmp assym.h
    132  1.1       dbj 
    133  1.1       dbj param.c: $S/conf/param.c
    134  1.1       dbj 	rm -f param.c
    135  1.1       dbj 	cp $S/conf/param.c .
    136  1.1       dbj 
    137  1.1       dbj param.o: param.c Makefile
    138  1.1       dbj 	${NORMAL_C}
    139  1.1       dbj 
    140  1.1       dbj ioconf.o: ioconf.c
    141  1.1       dbj 	${NORMAL_C}
    142  1.1       dbj 
    143  1.1       dbj newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
    144  1.1       dbj 	sh $S/conf/newvers.sh
    145  1.1       dbj 	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
    146  1.1       dbj 
    147  1.1       dbj __CLEANKERNEL: .USE
    148  1.1       dbj 	@echo "${.TARGET}ing the kernel objects"
    149  1.1       dbj 	rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \
    150  1.1       dbj 	    [Ee]rrs linterrs makelinks assym.h.tmp assym.h
    151  1.1       dbj 
    152  1.1       dbj __CLEANDEPEND: .USE
    153  1.1       dbj 	rm -f .depend
    154  1.1       dbj 
    155  1.1       dbj clean: __CLEANKERNEL
    156  1.1       dbj 
    157  1.3     lukem cleandir distclean: __CLEANKERNEL __CLEANDEPEND
    158  1.1       dbj 
    159  1.1       dbj lint:
    160  1.1       dbj 	@lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \
    161  1.1       dbj 	    ${CFILES} ioconf.c param.c | \
    162  1.1       dbj 	    grep -v 'static function .* unused'
    163  1.1       dbj 
    164  1.1       dbj tags:
    165  1.1       dbj 	@echo "see $S/kern/Makefile for tags"
    166  1.1       dbj 
    167  1.1       dbj links:
    168  1.1       dbj 	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
    169  1.1       dbj 	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
    170  1.1       dbj 	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
    171  1.1       dbj 	  sort -u | comm -23 - dontlink | \
    172  1.1       dbj 	  sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
    173  1.1       dbj 	sh makelinks && rm -f dontlink
    174  1.1       dbj 
    175  1.1       dbj SRCS=	${NEXT68K}/next68k/locore.s \
    176  1.1       dbj 	param.c ioconf.c ${CFILES} ${SFILES}
    177  1.1       dbj depend: .depend
    178  1.1       dbj .depend: ${SRCS} assym.h param.c
    179  1.1       dbj 	${MKDEP} ${AFLAGS} ${CPPFLAGS} ${NEXT68K}/next68k/locore.s
    180  1.1       dbj 	${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
    181  1.1       dbj 	${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
    182  1.1       dbj 	sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
    183  1.1       dbj 	  ${CPPFLAGS} < ${NEXT68K}/next68k/genassym.cf
    184  1.1       dbj 	@sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend
    185  1.1       dbj 	@rm -f assym.dep
    186  1.1       dbj 
    187  1.1       dbj 
    188  1.1       dbj # depend on root or device configuration
    189  1.1       dbj autoconf.o conf.o: Makefile
    190  1.1       dbj  
    191  1.1       dbj # depend on network or filesystem configuration 
    192  1.1       dbj uipc_proto.o vfs_conf.o: Makefile 
    193  1.1       dbj 
    194  1.1       dbj # depend on maxusers
    195  1.1       dbj genassym.o machdep.o: Makefile
    196  1.1       dbj 
    197  1.1       dbj # depend on CPU configuration 
    198  1.1       dbj locore.o pmap.o trap.o: Makefile
    199  1.1       dbj 
    200  1.1       dbj 
    201  1.1       dbj locore.o: ${NEXT68K}/next68k/locore.s assym.h
    202  1.1       dbj 	${NORMAL_S}
    203  1.1       dbj 
    204  1.1       dbj %RULES
    205