Home | History | Annotate | Line # | Download | only in conf
Makefile.amiga revision 1.68
      1 #	$NetBSD: Makefile.amiga,v 1.68 1997/11/12 22:25:39 thorpej Exp $
      2 
      3 # Makefile for NetBSD
      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/arch/amiga/conf/``machineid''
      9 # after which you should do
     10 #	config machineid
     11 # Machine generic makefile changes should be made in
     12 #	/sys/arch/amiga/conf/Makefile.amiga
     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 # DEBUG is set to -g if debugging.
     22 # PROF is set to -pg if profiling.
     23 
     24 CC?=	cc
     25 AS?=	as
     26 LD?=	ld
     27 LORDER?=lorder
     28 MKDEP?=	mkdep
     29 NM?=	nm
     30 SIZE?=	size
     31 STRIP?=	strip
     32 TSORT?=	tsort -q
     33 COPTS?=	-O2
     34 
     35 # source tree is located via $S relative to the compilation directory
     36 .ifndef S
     37 S!=	cd ../../../..; pwd
     38 .endif
     39 AMIGA=	$S/arch/amiga
     40 
     41 INCLUDES=	-I. -I$S/arch -I$S -nostdinc
     42 CPPFLAGS=	${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL \
     43 		-Dmc68020 -Damiga -DFPCOPROC
     44 CWARNFLAGS=	-Werror -Wall -Wstrict-prototypes -Wmissing-prototypes
     45 .if empty(IDENT:M-DM68060)
     46 CMACHFLAGS=	-m68020
     47 .else
     48 CMACHFLAGS=	-m68060 -Wa,-m68030
     49 .endif
     50 CFLAGS=		${DEBUG} ${CWARNFLAGS} ${COPTS} ${CMACHFLAGS} -msoft-float 
     51 AFLAGS=		-x assembler-with-cpp -traditional-cpp -D_LOCORE
     52 LINKFLAGS=	-n -Ttext 0 -e start
     53 STRIPFLAGS=	-d
     54 
     55 ### find out what to use for libkern
     56 .include "$S/lib/libkern/Makefile.inc"
     57 .ifndef PROF
     58 LIBKERN=	${KERNLIB}
     59 .else
     60 LIBKERN=	${KERNLIB_PROF}
     61 .endif
     62 
     63 ### find out what to use for libcompat
     64 .include "$S/compat/common/Makefile.inc"
     65 .ifndef PROF
     66 LIBCOMPAT=	${COMPATLIB}
     67 .else
     68 LIBCOMPAT=	${COMPATLIB_PROF}
     69 .endif
     70 
     71 ### for the Motorola 68040 Floating Point Software Product
     72 .include "$S/arch/m68k/fpsp/Makefile.inc"
     73 
     74 ### for the Motorola 68060 Software Support Package
     75 .include "$S/arch/m68k/060sp/Makefile.inc"
     76 
     77 # compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
     78 # HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
     79 
     80 NORMAL_C=	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
     81 NORMAL_S=	${CC} ${AFLAGS} ${CPPFLAGS} -c $<
     82 
     83 .SUFFIXES: .o .g
     84 
     85 .g.o: ; echo This is a dummy rule and should not be executed.
     86 
     87 NORMAL_G=	gspa < $< | gspahextoc > $*.c; ${CC} -c ${CFLAGS} ${PROF} $*.c
     88 
     89 %OBJS
     90 
     91 %CFILES
     92 
     93 %SFILES
     94 
     95 # load lines for config "xxx" will be emitted as:
     96 # xxx: ${SYSTEM_DEP} swapxxx.o
     97 #	${SYSTEM_LD_HEAD}
     98 #	${SYSTEM_LD} swapxxx.o
     99 #	${SYSTEM_LD_TAIL}
    100 SYSTEM_OBJ=	locore.o ${FPSP} \
    101 		param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT}
    102 SYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
    103 SYSTEM_LD_HEAD=	@rm -f $@
    104 SYSTEM_LD=	@echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
    105 		${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
    106 SYSTEM_LD_TAIL=	@${SIZE} $@; chmod 755 $@
    107 
    108 DEBUG?=
    109 .if ${DEBUG} == "-g"
    110 LINKFLAGS+=	-X
    111 SYSTEM_LD_TAIL+=; \
    112 		echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
    113 		echo ${STRIP} ${STRIPFLAGS} $@; ${STRIP} ${STRIPFLAGS} $@
    114 .else
    115 LINKFLAGS+=	-S
    116 .endif
    117 
    118 %LOAD
    119 
    120 assym.h: ${AMIGA}/amiga/genassym.cf $S/kern/genassym.sh
    121 	sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
    122 	    < ${AMIGA}/amiga/genassym.cf > assym.h.tmp && \
    123 	mv -f assym.h.tmp assym.h
    124 
    125 param.c: $S/conf/param.c
    126 	rm -f param.c
    127 	cp $S/conf/param.c .
    128 
    129 param.o: param.c Makefile
    130 	${NORMAL_C}
    131 
    132 ioconf.o: ioconf.c
    133 	${NORMAL_C}
    134 
    135 newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
    136 	sh $S/conf/newvers.sh
    137 	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
    138 
    139 __CLEANKERNEL: .USE
    140 	@echo "${.TARGET}ing the kernel objects"
    141 	rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \
    142 	    [Ee]rrs linterrs makelinks assym.h.tmp assym.h
    143 
    144 __CLEANDEPEND: .USE
    145 	rm -f .depend
    146 
    147 clean: __CLEANKERNEL
    148 
    149 cleandir: __CLEANKERNEL __CLEANDEPEND
    150 
    151 lint:
    152 	@lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \
    153 	    ${CFILES} ioconf.c param.c | \
    154 	    grep -v 'static function .* unused'
    155 
    156 tags:
    157 	@echo "see $S/kern/Makefile for tags"
    158 
    159 links:
    160 	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
    161 	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
    162 	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
    163 	  sort -u | comm -23 - dontlink | \
    164 	  sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
    165 	sh makelinks && rm -f dontlink
    166 
    167 SRCS=	${AMIGA}/amiga/locore.s \
    168 	param.c ioconf.c ${CFILES} ${SFILES}
    169 depend: .depend
    170 .depend: ${SRCS} assym.h param.c
    171 	${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AMIGA}/amiga/locore.s
    172 	${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
    173 	${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
    174 	sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
    175 	  ${CPPFLAGS} < ${AMIGA}/amiga/genassym.cf
    176 	@sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend
    177 	@rm -f assym.dep
    178  
    179 
    180 # depend on root or device configuration
    181 autoconf.o conf.o: Makefile
    182  
    183 # depend on network or filesystem configuration 
    184 uipc_proto.o vfs_conf.o: Makefile 
    185 
    186 # depend on maxusers
    187 machdep.o: Makefile
    188 
    189 # depend on CPU configuration 
    190 amiga_init.o locore.o pmap.o sys_machdep.o: Makefile
    191 bzsc.o bztzsc.o cbiisc.o cbsc.o flsc.o sbic.o: Makefile
    192 
    193 # depends on defined(DRACO)
    194 a2kbbc.o: Makefile
    195 
    196 # LEV6_DEFER blocks usage of audio interupt 3:
    197 aucc.o cc.o: Makefile
    198 
    199 locore.o: ${AMIGA}/amiga/locore.s assym.h
    200 	${NORMAL_S}
    201 
    202 %RULES
    203