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