Home | History | Annotate | Line # | Download | only in conf
Makefile.atari revision 1.1
      1  1.1  leo #	$NetBSD: Makefile.atari,v 1.1 1995/03/26 07:12:16 leo 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.1  leo COPTS=	${INCLUDES} ${IDENT} -DKERNEL -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.1  leo ### for the Motorola 68040 Floating Point Software Product
     47  1.1  leo .include "$S/arch/m68k/fpsp/Makefile.inc"
     48  1.1  leo 
     49  1.1  leo # compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
     50  1.1  leo # where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix,
     51  1.1  leo # capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
     52  1.1  leo # is marked as config-dependent.
     53  1.1  leo 
     54  1.1  leo NORMAL_C=	${CC} -c ${CFLAGS} ${PROF} $<
     55  1.1  leo NORMAL_C_C=	${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
     56  1.1  leo 
     57  1.1  leo DRIVER_C=	${CC} -c ${CFLAGS} ${PROF} $<
     58  1.1  leo DRIVER_C_C=	${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
     59  1.1  leo 
     60  1.1  leo PROFILE_C=	${CC} -S -c ${COPTS} $<; \
     61  1.1  leo 		sed -e s/_mcount/mcount/ -e s/subrmcount/subr_mcount/ <$*.s | \
     62  1.1  leo 		${AS} -o $@; \
     63  1.1  leo 		rm -f $*.s
     64  1.1  leo 
     65  1.1  leo NORMAL_S=	${CPP} ${COPTS} $< | ${AS} -o $@
     66  1.1  leo NORMAL_S_C=	${CPP} ${COPTS} ${PARAM} $< | ${AS} -o $@
     67  1.1  leo 
     68  1.1  leo %OBJS
     69  1.1  leo 
     70  1.1  leo %CFILES
     71  1.1  leo 
     72  1.1  leo # load lines for config "xxx" will be emitted as:
     73  1.1  leo # xxx: ${SYSTEM_DEP} swapxxx.o
     74  1.1  leo #	${SYSTEM_LD_HEAD}
     75  1.1  leo #	${SYSTEM_LD} swapxxx.o
     76  1.1  leo #	${SYSTEM_LD_TAIL}
     77  1.1  leo SYSTEM_OBJ=	locore.o ${FPSP} vnode_if.o ${OBJS} param.o ioconf.o ${LIBKERN}
     78  1.1  leo SYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
     79  1.1  leo SYSTEM_LD_HEAD=	rm -f $@
     80  1.1  leo SYSTEM_LD=	-@if [ X${DEBUG} = X-g ]; \
     81  1.1  leo 		then strip=-X; \
     82  1.1  leo 		else strip=-x; \
     83  1.1  leo 		fi; \
     84  1.1  leo 		echo ${LD} $$strip -n -T 0 -o $@ -e start '$${SYSTEM_OBJ}' vers.o; \
     85  1.1  leo 		${LD} $$strip -n -T 0 -o $@ -e start ${SYSTEM_OBJ} vers.o
     86  1.1  leo SYSTEM_LD_TAIL=	@size $@; chmod 755 $@; \
     87  1.1  leo 		[ X${DEBUG} = X-g ] && { \
     88  1.1  leo 		echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
     89  1.1  leo 		echo strip -d $@; strip -d $@; } || true
     90  1.1  leo 
     91  1.1  leo %LOAD
     92  1.1  leo 
     93  1.1  leo vers.o:	newvers
     94  1.1  leo 
     95  1.1  leo newvers:
     96  1.1  leo 	sh $S/conf/newvers.sh ${KERN_IDENT}
     97  1.1  leo 	${CC} $(CFLAGS) -c vers.c
     98  1.1  leo 
     99  1.1  leo clean:
    100  1.1  leo 	rm -f eddep *netbsd netbsd.gdb tags *.o locore.i [a-z]*.s \
    101  1.1  leo 		Errs errs linterrs makelinks
    102  1.1  leo 
    103  1.1  leo lint: /tmp param.c
    104  1.1  leo 	@lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} -UKGDB \
    105  1.1  leo 	    ${ATARI}/atari/Locore.c ${CFILES} ${ATARI}/atari/swapgeneric.c \
    106  1.1  leo 	    ioconf.c param.c| \
    107  1.1  leo 	    grep -v 'struct/union .* never defined' | \
    108  1.1  leo 	    grep -v 'possible pointer alignment problem'
    109  1.1  leo 
    110  1.1  leo locore.o: assym.s ${ATARI}/atari/vectors.s ${ATARI}/atari/locore.s 
    111  1.1  leo locore.o: machine/trap.h machine/psl.h machine/pte.h machine/cpu.h
    112  1.1  leo 	${CPP} -DLOCORE ${COPTS} ${ATARI}/atari/locore.s | ${AS} -o locore.o
    113  1.1  leo 
    114  1.1  leo # the following is necessary because autoconf.o depends on #if GENERIC
    115  1.1  leo autoconf.o: Makefile
    116  1.1  leo 
    117  1.1  leo # the following are necessary because the files depend on the types of
    118  1.1  leo # hp cpu's included in the system configuration
    119  1.1  leo machdep.o sys_machdep.o pmap.o pmap_bootstrap.o trap.o dma.o:	Makefile
    120  1.1  leo 
    121  1.1  leo # depend on network or filesystem configuration
    122  1.1  leo uipc_proto.o vfs_conf.o locore.o:	Makefile
    123  1.1  leo 
    124  1.1  leo # depend on maxusers
    125  1.1  leo assym.s: Makefile
    126  1.1  leo 
    127  1.1  leo assym.s: genassym
    128  1.1  leo 	./genassym >assym.s
    129  1.1  leo 
    130  1.1  leo genassym:
    131  1.1  leo 	${CC} -static ${INCLUDES} ${IDENT} ${PARAM} -Dmc68020 -Datari \
    132  1.1  leo 	    -o genassym ${ATARI}/atari/genassym.c
    133  1.1  leo 
    134  1.1  leo depend: assym.s param.c vnode_if.h
    135  1.1  leo 	mkdep ${COPTS} ${CFILES} ioconf.c param.c
    136  1.1  leo 	mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${ATARI}/atari/genassym.c
    137  1.1  leo 
    138  1.1  leo links:
    139  1.1  leo 	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
    140  1.1  leo 	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
    141  1.1  leo 	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
    142  1.1  leo 	  sort -u | comm -23 - dontlink | \
    143  1.1  leo 	  sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
    144  1.1  leo 	sh makelinks && rm -f dontlink
    145  1.1  leo 
    146  1.1  leo tags:
    147  1.1  leo 	@echo "see $S/kern/Makefile for tags"
    148  1.1  leo 
    149  1.1  leo ioconf.o: ioconf.c
    150  1.1  leo 	${CC} -c ${CFLAGS} ioconf.c
    151  1.1  leo 
    152  1.1  leo param.c: $S/conf/param.c
    153  1.1  leo 	rm -f param.c
    154  1.1  leo 	cp $S/conf/param.c .
    155  1.1  leo 
    156  1.1  leo param.o: param.c Makefile
    157  1.1  leo 	${CC} -c ${CFLAGS} ${PARAM} param.c
    158  1.1  leo vnode_if.c vnode_if.h:	$S/kern/vnode_if.sh $S/kern/vnode_if.src
    159  1.1  leo 	AWK="${AWK}" sh $S/kern/vnode_if.sh $S/kern/vnode_if.src
    160  1.1  leo 
    161  1.1  leo %RULES
    162