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