Home | History | Annotate | Line # | Download | only in conf
Makefile.amiga revision 1.60.2.1
      1  1.60.2.1   thorpej #	$NetBSD: Makefile.amiga,v 1.60.2.1 1997/09/16 03:48:12 thorpej Exp $
      2      1.21       cgd 
      3      1.35   mycroft # Makefile for NetBSD
      4       1.1        mw #
      5       1.1        mw # This makefile is constructed from a machine description:
      6       1.1        mw #	config machineid
      7       1.1        mw # Most changes should be made in the machine description
      8      1.35   mycroft #	/sys/arch/amiga/conf/``machineid''
      9       1.1        mw # after which you should do
     10      1.35   mycroft #	config machineid
     11       1.1        mw # Machine generic makefile changes should be made in
     12      1.35   mycroft #	/sys/arch/amiga/conf/Makefile.amiga
     13       1.1        mw # after which config should be rerun for all machines of that type.
     14       1.1        mw #
     15       1.1        mw # N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE
     16       1.1        mw #	IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
     17       1.1        mw #
     18       1.1        mw # -DTRACE	compile in kernel tracing hooks
     19       1.1        mw # -DQUOTA	compile in file system quotas
     20       1.1        mw 
     21      1.35   mycroft # DEBUG is set to -g if debugging.
     22      1.35   mycroft # PROF is set to -pg if profiling.
     23       1.1        mw 
     24      1.38   mycroft CC?=	cc
     25      1.38   mycroft LD?=	ld
     26      1.46   mycroft MKDEP?=	mkdep
     27      1.50   mycroft STRIP?=	strip
     28      1.52     veego COPTS?=	-O2
     29       1.1        mw 
     30       1.1        mw # source tree is located via $S relative to the compilation directory
     31      1.49   mycroft .ifndef S
     32      1.46   mycroft S!=	cd ../../../..; pwd
     33      1.49   mycroft .endif
     34      1.46   mycroft AMIGA=	$S/arch/amiga
     35       1.1        mw 
     36      1.47   mycroft INCLUDES=	-I. -I$S/arch -I$S -nostdinc
     37      1.48   mycroft CPPFLAGS=	${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL \
     38  1.60.2.1   thorpej 		-Dmc68020 -Damiga -DFPCOPROC
     39      1.56     veego CWARNFLAGS=	-Werror -Wall -Wstrict-prototypes -Wmissing-prototypes
     40      1.40        is .if empty(IDENT:M-DM68060)
     41      1.46   mycroft CMACHFLAGS=	-m68020
     42      1.40        is .else
     43      1.46   mycroft CMACHFLAGS=	-m68060 -Wa,-m68030
     44      1.40        is .endif
     45      1.52     veego CFLAGS=		${DEBUG} ${CWARNFLAGS} ${COPTS} ${CMACHFLAGS} -msoft-float 
     46      1.37   mycroft AFLAGS=		-x assembler-with-cpp -traditional-cpp -D_LOCORE
     47      1.35   mycroft LINKFLAGS=	-n -Ttext 0 -e start
     48      1.50   mycroft STRIPFLAGS=	-d
     49      1.50   mycroft 
     50       1.4        mw ### find out what to use for libkern
     51       1.4        mw .include "$S/lib/libkern/Makefile.inc"
     52       1.4        mw .ifndef PROF
     53       1.4        mw LIBKERN=	${KERNLIB}
     54       1.4        mw .else
     55       1.4        mw LIBKERN=	${KERNLIB_PROF}
     56       1.4        mw .endif
     57      1.20    chopps 
     58      1.24  christos ### find out what to use for libcompat
     59      1.24  christos .include "$S/compat/common/Makefile.inc"
     60      1.24  christos .ifndef PROF
     61      1.24  christos LIBCOMPAT=	${COMPATLIB}
     62      1.24  christos .else
     63      1.24  christos LIBCOMPAT=	${COMPATLIB_PROF}
     64      1.24  christos .endif
     65      1.24  christos 
     66      1.20    chopps ### for the Motorola 68040 Floating Point Software Product
     67      1.20    chopps .include "$S/arch/m68k/fpsp/Makefile.inc"
     68      1.20    chopps 
     69      1.41        is ### for the Motorola 68060 Software Support Package
     70      1.44        is .include "$S/arch/m68k/060sp/Makefile.inc"
     71      1.41        is 
     72      1.48   mycroft # compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
     73      1.48   mycroft # HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
     74       1.1        mw 
     75      1.35   mycroft NORMAL_C=	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
     76      1.37   mycroft NORMAL_S=	${CC} ${AFLAGS} ${CPPFLAGS} -c $<
     77       1.1        mw 
     78      1.29       jtc .SUFFIXES: .o .g
     79      1.29       jtc 
     80      1.29       jtc .g.o: ; echo This is a dummy rule and should not be executed.
     81      1.29       jtc 
     82      1.29       jtc NORMAL_G=	gspa < $< | gspahextoc > $*.c; ${CC} -c ${CFLAGS} ${PROF} $*.c
     83      1.29       jtc 
     84       1.1        mw %OBJS
     85       1.1        mw 
     86       1.1        mw %CFILES
     87       1.1        mw 
     88      1.35   mycroft %SFILES
     89      1.35   mycroft 
     90       1.1        mw # load lines for config "xxx" will be emitted as:
     91       1.1        mw # xxx: ${SYSTEM_DEP} swapxxx.o
     92       1.1        mw #	${SYSTEM_LD_HEAD}
     93       1.1        mw #	${SYSTEM_LD} swapxxx.o
     94       1.1        mw #	${SYSTEM_LD_TAIL}
     95      1.41        is SYSTEM_OBJ=	locore.o ${FPSP} ${060SP} \
     96      1.39       cgd 		param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT}
     97       1.1        mw SYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
     98      1.35   mycroft SYSTEM_LD_HEAD=	@rm -f $@
     99      1.35   mycroft SYSTEM_LD=	@echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
    100      1.35   mycroft 		${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
    101      1.35   mycroft SYSTEM_LD_TAIL=	@size $@; chmod 755 $@
    102      1.35   mycroft 
    103      1.35   mycroft DEBUG?=
    104      1.35   mycroft .if ${DEBUG} == "-g"
    105      1.35   mycroft LINKFLAGS+=	-X
    106      1.35   mycroft SYSTEM_LD_TAIL+=; \
    107       1.1        mw 		echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
    108      1.50   mycroft 		echo ${STRIP} ${STRIPFLAGS} $@; ${STRIP} ${STRIPFLAGS} $@
    109      1.35   mycroft .else
    110      1.46   mycroft LINKFLAGS+=	-S
    111      1.35   mycroft .endif
    112       1.1        mw 
    113       1.1        mw %LOAD
    114       1.3        mw 
    115      1.56     veego assym.h: ${AMIGA}/amiga/genassym.cf $S/kern/genassym.sh
    116      1.56     veego 	sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
    117      1.56     veego 	    < ${AMIGA}/amiga/genassym.cf > assym.h.tmp && \
    118      1.56     veego 	mv -f assym.h.tmp assym.h
    119       1.1        mw 
    120      1.35   mycroft param.c: $S/conf/param.c
    121      1.35   mycroft 	rm -f param.c
    122      1.35   mycroft 	cp $S/conf/param.c .
    123       1.1        mw 
    124      1.35   mycroft param.o: param.c Makefile
    125      1.48   mycroft 	${NORMAL_C}
    126      1.35   mycroft 
    127      1.35   mycroft ioconf.o: ioconf.c
    128      1.35   mycroft 	${NORMAL_C}
    129       1.1        mw 
    130      1.35   mycroft newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
    131      1.35   mycroft 	sh $S/conf/newvers.sh
    132      1.35   mycroft 	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
    133       1.1        mw 
    134       1.1        mw 
    135      1.53     veego clean: cleankernel
    136      1.53     veego cleankernel:
    137      1.39       cgd 	rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \
    138      1.56     veego 	    [Ee]rrs linterrs makelinks assym.h
    139       1.1        mw 
    140      1.35   mycroft lint:
    141      1.54     perry 	@lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \
    142  1.60.2.1   thorpej 	    ${CFILES} ioconf.c param.c | \
    143      1.35   mycroft 	    grep -v 'static function .* unused'
    144       1.1        mw 
    145      1.35   mycroft tags:
    146      1.35   mycroft 	@echo "see $S/kern/Makefile for tags"
    147       1.1        mw 
    148       1.1        mw links:
    149       1.1        mw 	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
    150       1.1        mw 	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
    151       1.1        mw 	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
    152       1.1        mw 	  sort -u | comm -23 - dontlink | \
    153      1.35   mycroft 	  sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
    154       1.1        mw 	sh makelinks && rm -f dontlink
    155       1.1        mw 
    156      1.35   mycroft SRCS=	${AMIGA}/amiga/locore.s \
    157      1.39       cgd 	param.c ioconf.c ${CFILES} ${SFILES}
    158      1.53     veego depend: .depend
    159      1.39       cgd .depend: ${SRCS} assym.h param.c
    160      1.46   mycroft 	${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AMIGA}/amiga/locore.s
    161      1.46   mycroft 	${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
    162      1.46   mycroft 	${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
    163      1.59       leo 	sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
    164      1.59       leo 	  ${CPPFLAGS} < ${AMIGA}/amiga/genassym.cf
    165      1.59       leo 	@sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend
    166      1.59       leo 	@rm -f assym.dep
    167      1.59       leo  
    168      1.35   mycroft 
    169      1.35   mycroft # depend on root or device configuration
    170      1.35   mycroft autoconf.o conf.o: Makefile
    171      1.35   mycroft  
    172      1.35   mycroft # depend on network or filesystem configuration 
    173      1.35   mycroft uipc_proto.o vfs_conf.o: Makefile 
    174      1.35   mycroft 
    175      1.35   mycroft # depend on maxusers
    176      1.56     veego machdep.o: Makefile
    177       1.1        mw 
    178      1.35   mycroft # depend on CPU configuration 
    179      1.58        is amiga_init.o locore.o pmap.o sys_machdep.o bzsc.o flsc.o sbic.o sfas.o: Makefile
    180      1.60        is 
    181      1.60        is # depends on defined(DRACO)
    182      1.60        is a2kbbc.o: Makefile
    183       1.1        mw 
    184      1.58        is # LEV6_DEFER blocks usage of audio interupt 3:
    185      1.58        is aucc.o cc.o: Makefile
    186       1.1        mw 
    187      1.35   mycroft locore.o: ${AMIGA}/amiga/locore.s assym.h
    188      1.35   mycroft 	${NORMAL_S}
    189       1.1        mw 
    190       1.1        mw %RULES
    191