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