Home | History | Annotate | Line # | Download | only in conf
Makefile.atari revision 1.4
      1  1.4  christos #	$NetBSD: Makefile.atari,v 1.4 1995/06/24 20:42:10 christos Exp $
      2  1.1       leo #
      3  1.1       leo # Makefile for NetBSD Atari-TT
      4  1.1       leo #
      5  1.1       leo # This makefile is constructed from a machine description:
      6  1.1       leo #	config machineid
      7  1.1       leo # Most changes should be made in the machine description
      8  1.1       leo #	/sys/conf/``machineid''
      9  1.1       leo # after which you should do
     10  1.1       leo #	 config machineid
     11  1.1       leo # Machine generic makefile changes should be made in
     12  1.1       leo #	/sys/conf/Makefile.``machinetype''
     13  1.1       leo # after which config should be rerun for all machines of that type.
     14  1.1       leo #
     15  1.1       leo # N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE
     16  1.1       leo #	IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
     17  1.1       leo #
     18  1.1       leo # -DTRACE	compile in kernel tracing hooks
     19  1.1       leo # -DQUOTA	compile in file system quotas
     20  1.1       leo 
     21  1.1       leo 
     22  1.1       leo # DEBUG is set to -g by config if debugging is requested (config -g).
     23  1.1       leo # PROF is set to -pg by config if profiling is requested (config -p).
     24  1.1       leo AS=	as ${DEBUG}
     25  1.1       leo CC=	cc ${DEBUG}
     26  1.1       leo CPP=	cpp
     27  1.1       leo LD=	ld 
     28  1.1       leo TOUCH=	touch -f -c
     29  1.1       leo 
     30  1.1       leo # source tree is located via $S relative to the compilation directory
     31  1.1       leo S=	../../../..
     32  1.1       leo ATARI=	../..
     33  1.1       leo 
     34  1.1       leo INCLUDES= -I. -I$S/arch -I$S -I$S/sys 
     35  1.3       jtc COPTS=	${INCLUDES} ${IDENT} -D_KERNEL -Dmc68020 -Datari
     36  1.1       leo CFLAGS=	-O -mc68020 -m68881 ${COPTS}
     37  1.1       leo 
     38  1.1       leo ### find out what to use for libkern
     39  1.1       leo .include "$S/lib/libkern/Makefile.inc"
     40  1.1       leo .ifndef PROF
     41  1.1       leo LIBKERN=	${KERNLIB}
     42  1.1       leo .else
     43  1.1       leo LIBKERN=	${KERNLIB_PROF}
     44  1.1       leo .endif
     45  1.1       leo 
     46  1.4  christos ### find out what to use for libcompat
     47  1.4  christos .include "$S/compat/common/Makefile.inc"
     48  1.4  christos .ifndef PROF
     49  1.4  christos LIBCOMPAT=	${COMPATLIB}
     50  1.4  christos .else
     51  1.4  christos LIBCOMPAT=	${COMPATLIB_PROF}
     52  1.4  christos .endif
     53  1.4  christos 
     54  1.1       leo ### for the Motorola 68040 Floating Point Software Product
     55  1.1       leo .include "$S/arch/m68k/fpsp/Makefile.inc"
     56  1.1       leo 
     57  1.1       leo # compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
     58  1.1       leo # where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix,
     59  1.1       leo # capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
     60  1.1       leo # is marked as config-dependent.
     61  1.1       leo 
     62  1.1       leo NORMAL_C=	${CC} -c ${CFLAGS} ${PROF} $<
     63  1.1       leo NORMAL_C_C=	${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
     64  1.1       leo 
     65  1.1       leo DRIVER_C=	${CC} -c ${CFLAGS} ${PROF} $<
     66  1.1       leo DRIVER_C_C=	${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
     67  1.1       leo 
     68  1.1       leo PROFILE_C=	${CC} -S -c ${COPTS} $<; \
     69  1.1       leo 		sed -e s/_mcount/mcount/ -e s/subrmcount/subr_mcount/ <$*.s | \
     70  1.1       leo 		${AS} -o $@; \
     71  1.1       leo 		rm -f $*.s
     72  1.1       leo 
     73  1.1       leo NORMAL_S=	${CPP} ${COPTS} $< | ${AS} -o $@
     74  1.1       leo NORMAL_S_C=	${CPP} ${COPTS} ${PARAM} $< | ${AS} -o $@
     75  1.1       leo 
     76  1.1       leo %OBJS
     77  1.1       leo 
     78  1.1       leo %CFILES
     79  1.1       leo 
     80  1.1       leo # load lines for config "xxx" will be emitted as:
     81  1.1       leo # xxx: ${SYSTEM_DEP} swapxxx.o
     82  1.1       leo #	${SYSTEM_LD_HEAD}
     83  1.1       leo #	${SYSTEM_LD} swapxxx.o
     84  1.1       leo #	${SYSTEM_LD_TAIL}
     85  1.4  christos SYSTEM_OBJ=	locore.o ${FPSP} vnode_if.o ${OBJS} param.o ioconf.o \
     86  1.4  christos 		${LIBKERN} ${LIBCOMPAT}
     87  1.1       leo SYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
     88  1.1       leo SYSTEM_LD_HEAD=	rm -f $@
     89  1.1       leo SYSTEM_LD=	-@if [ X${DEBUG} = X-g ]; \
     90  1.1       leo 		then strip=-X; \
     91  1.1       leo 		else strip=-x; \
     92  1.1       leo 		fi; \
     93  1.1       leo 		echo ${LD} $$strip -n -T 0 -o $@ -e start '$${SYSTEM_OBJ}' vers.o; \
     94  1.1       leo 		${LD} $$strip -n -T 0 -o $@ -e start ${SYSTEM_OBJ} vers.o
     95  1.1       leo SYSTEM_LD_TAIL=	@size $@; chmod 755 $@; \
     96  1.1       leo 		[ X${DEBUG} = X-g ] && { \
     97  1.1       leo 		echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
     98  1.1       leo 		echo strip -d $@; strip -d $@; } || true
     99  1.1       leo 
    100  1.1       leo %LOAD
    101  1.1       leo 
    102  1.1       leo vers.o:	newvers
    103  1.1       leo 
    104  1.1       leo newvers:
    105  1.1       leo 	sh $S/conf/newvers.sh ${KERN_IDENT}
    106  1.1       leo 	${CC} $(CFLAGS) -c vers.c
    107  1.1       leo 
    108  1.4  christos clean::
    109  1.1       leo 	rm -f eddep *netbsd netbsd.gdb tags *.o locore.i [a-z]*.s \
    110  1.4  christos 		Errs errs linterrs makelinks genassym
    111  1.1       leo 
    112  1.1       leo lint: /tmp param.c
    113  1.1       leo 	@lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} -UKGDB \
    114  1.1       leo 	    ${ATARI}/atari/Locore.c ${CFILES} ${ATARI}/atari/swapgeneric.c \
    115  1.1       leo 	    ioconf.c param.c| \
    116  1.1       leo 	    grep -v 'struct/union .* never defined' | \
    117  1.1       leo 	    grep -v 'possible pointer alignment problem'
    118  1.1       leo 
    119  1.1       leo locore.o: assym.s ${ATARI}/atari/vectors.s ${ATARI}/atari/locore.s 
    120  1.1       leo locore.o: machine/trap.h machine/psl.h machine/pte.h machine/cpu.h
    121  1.1       leo 	${CPP} -DLOCORE ${COPTS} ${ATARI}/atari/locore.s | ${AS} -o locore.o
    122  1.1       leo 
    123  1.1       leo # the following is necessary because autoconf.o depends on #if GENERIC
    124  1.1       leo autoconf.o: Makefile
    125  1.1       leo 
    126  1.1       leo # the following are necessary because the files depend on the types of
    127  1.1       leo # hp cpu's included in the system configuration
    128  1.1       leo machdep.o sys_machdep.o pmap.o pmap_bootstrap.o trap.o dma.o:	Makefile
    129  1.1       leo 
    130  1.1       leo # depend on network or filesystem configuration
    131  1.1       leo uipc_proto.o vfs_conf.o locore.o:	Makefile
    132  1.1       leo 
    133  1.1       leo # depend on maxusers
    134  1.1       leo assym.s: Makefile
    135  1.1       leo 
    136  1.1       leo assym.s: genassym
    137  1.1       leo 	./genassym >assym.s
    138  1.1       leo 
    139  1.1       leo genassym:
    140  1.1       leo 	${CC} -static ${INCLUDES} ${IDENT} ${PARAM} -Dmc68020 -Datari \
    141  1.1       leo 	    -o genassym ${ATARI}/atari/genassym.c
    142  1.1       leo 
    143  1.1       leo depend: assym.s param.c vnode_if.h
    144  1.1       leo 	mkdep ${COPTS} ${CFILES} ioconf.c param.c
    145  1.1       leo 	mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${ATARI}/atari/genassym.c
    146  1.1       leo 
    147  1.1       leo links:
    148  1.1       leo 	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
    149  1.1       leo 	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
    150  1.1       leo 	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
    151  1.1       leo 	  sort -u | comm -23 - dontlink | \
    152  1.1       leo 	  sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
    153  1.1       leo 	sh makelinks && rm -f dontlink
    154  1.1       leo 
    155  1.1       leo tags:
    156  1.1       leo 	@echo "see $S/kern/Makefile for tags"
    157  1.1       leo 
    158  1.1       leo ioconf.o: ioconf.c
    159  1.1       leo 	${CC} -c ${CFLAGS} ioconf.c
    160  1.1       leo 
    161  1.1       leo param.c: $S/conf/param.c
    162  1.1       leo 	rm -f param.c
    163  1.1       leo 	cp $S/conf/param.c .
    164  1.1       leo 
    165  1.1       leo param.o: param.c Makefile
    166  1.1       leo 	${CC} -c ${CFLAGS} ${PARAM} param.c
    167  1.1       leo vnode_if.c vnode_if.h:	$S/kern/vnode_if.sh $S/kern/vnode_if.src
    168  1.1       leo 	AWK="${AWK}" sh $S/kern/vnode_if.sh $S/kern/vnode_if.src
    169  1.1       leo 
    170  1.1       leo %RULES
    171