Home | History | Annotate | Line # | Download | only in conf
Makefile.powerpc revision 1.10
      1  1.10   thorpej #	$NetBSD: Makefile.powerpc,v 1.10 1997/11/12 22:26:27 thorpej Exp $
      2   1.1        ws #
      3   1.1        ws # Makefile for NetBSD
      4   1.1        ws #
      5   1.1        ws # This makefile is constructed from a machine description:
      6   1.1        ws #	config machineid
      7   1.1        ws # Most changes should be made in the machine description
      8   1.1        ws #	/sys/arch/powerpc/conf/``machineid''
      9   1.1        ws # after which you should do
     10   1.1        ws #	config machineid
     11   1.1        ws # Machine generic makefile changes should be made in
     12   1.1        ws #	/sys/arch/powerpc/conf/Makefile.powerpc
     13   1.1        ws # after which config should be rerun for all machines of that type.
     14   1.1        ws #
     15   1.1        ws # N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE
     16   1.1        ws #	IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
     17   1.1        ws #
     18   1.1        ws # -DTRACE	compile in kernel tracing hooks
     19   1.1        ws # -DQUOTA	compile in file system quotas
     20   1.1        ws #
     21   1.1        ws .SUFFIXES:	.S .c .o
     22   1.1        ws 
     23   1.1        ws # DEBUG is set to -g if debugging.
     24   1.1        ws # PROF is set to -pg if profiling.
     25   1.1        ws 
     26   1.1        ws CC?=	cc
     27   1.1        ws LD?=	ld
     28  1.10   thorpej LORDER?=lorder
     29   1.1        ws MKDEP?=	mkdep
     30  1.10   thorpej NM?=	nm
     31  1.10   thorpej SIZE?=	size
     32   1.1        ws STRIP?=	strip
     33  1.10   thorpej TSORT?=	tsort -q
     34   1.2  jonathan COPTS?= 	-O2
     35   1.1        ws 
     36   1.1        ws # source tree is located via $S relative to the compilation directory
     37   1.1        ws .ifndef	S
     38   1.1        ws S!=	cd ../../../..; pwd
     39   1.1        ws .endif
     40   1.1        ws PPC=	$S/arch/powerpc
     41   1.1        ws 
     42   1.1        ws INCLUDES=	-I. -I$S/arch -I$S -nostdinc
     43   1.6   thorpej CPPFLAGS=	${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL \
     44   1.1        ws 		-Dpowerpc
     45   1.1        ws CWARNFLAGS=	-Werror -Wreturn-type
     46   1.2  jonathan CFLAGS=		${DEBUG} ${COPTS} ${CWARNFLAGS} -msoft-float
     47   1.1        ws AFLAGS=		-D_LOCORE
     48   1.6   thorpej LINKFLAGS=	-N -Ttext 100000 -e __start
     49   1.6   thorpej STRIPFLAGS=	--strip-debug
     50   1.1        ws 
     51   1.1        ws ### find out what to use for libkern
     52   1.1        ws .include "$S/lib/libkern/Makefile.inc"
     53   1.1        ws .ifndef PROF
     54   1.1        ws LIBKERN=	${KERNLIB}
     55   1.1        ws .else
     56   1.1        ws LIBKERN=	${KERNLIB_PROF}
     57   1.1        ws .endif
     58   1.1        ws 
     59   1.1        ws ### find out what to use for libcompat
     60   1.1        ws .include "$S/compat/common/Makefile.inc"
     61   1.1        ws .ifndef PROF
     62   1.1        ws LIBCOMPAT=	${COMPATLIB}
     63   1.1        ws .else
     64   1.1        ws LIBCOMPAT=	${COMPATLIB_PROF}
     65   1.1        ws .endif
     66   1.1        ws 
     67   1.1        ws # compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
     68   1.1        ws # HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
     69   1.1        ws 
     70   1.1        ws NORMAL_C=	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
     71   1.1        ws 
     72   1.1        ws NORMAL_S=	${CC} ${AFLAGS} ${CPPFLAGS} -c $<
     73   1.1        ws 
     74   1.1        ws #.c.o:
     75   1.1        ws #	${NORMAL_C}
     76   1.1        ws #
     77   1.1        ws #.S.o:
     78   1.1        ws #	${NORMAL_S}
     79   1.1        ws 
     80   1.1        ws %OBJS
     81   1.1        ws 
     82   1.1        ws %CFILES
     83   1.1        ws 
     84   1.1        ws %SFILES
     85   1.1        ws 
     86   1.1        ws # load lines for config "xxx" will be emitted as:
     87   1.1        ws # xxx: ${SYSTEM_DEP} swapxxx.o
     88   1.1        ws #	${SYSTEM_LD_HEAD}
     89   1.1        ws #	${SYSTEM_LD} swapxxx.o
     90   1.1        ws #	${SYSTEM_LD_TAIL}
     91   1.1        ws SYSTEM_OBJ=	locore.o \
     92   1.1        ws 		param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT}
     93   1.1        ws SYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
     94   1.1        ws SYSTEM_LD_HEAD=	rm -f $@
     95   1.1        ws SYSTEM_LD=	@echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
     96   1.1        ws 		${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
     97   1.1        ws SYSTEM_LD_TAIL=	@${SIZE} $@; chmod 755 $@
     98   1.1        ws 
     99   1.1        ws DEBUG?=
    100   1.1        ws .if ${DEBUG} == "-g"
    101   1.1        ws LINKFLAGS+=	-X
    102   1.1        ws SYSTEM_LD_TAIL+=; \
    103   1.1        ws 		echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
    104   1.1        ws 		echo ${STRIP} ${STRIPFLAGS} $@; ${STRIP} ${STRIPFLAGS} $@
    105   1.1        ws .else
    106   1.1        ws LINKFLAGS+=	-S
    107   1.1        ws .endif
    108   1.1        ws 
    109   1.1        ws %LOAD
    110   1.1        ws 
    111   1.7   thorpej assym.h: $S/kern/genassym.sh ${PPC}/powerpc/genassym.cf
    112   1.6   thorpej 	sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
    113   1.7   thorpej 	    < ${PPC}/powerpc/genassym.cf > assym.h.tmp && \
    114   1.6   thorpej 	mv -f assym.h.tmp assym.h
    115   1.1        ws 
    116   1.1        ws param.c: $S/conf/param.c
    117   1.1        ws 	rm -f param.c
    118   1.1        ws 	cp $S/conf/param.c .
    119   1.1        ws 
    120   1.1        ws param.o: param.c Makefile
    121   1.1        ws 	${NORMAL_C}
    122   1.1        ws 
    123   1.1        ws ioconf.o: ioconf.c
    124   1.1        ws 	${NORMAL_C}
    125   1.1        ws 
    126   1.1        ws newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
    127   1.1        ws 	sh $S/conf/newvers.sh
    128   1.1        ws 	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
    129   1.1        ws 
    130   1.9  christos __CLEANKERNEL: .USE
    131   1.9  christos 	@echo "${.TARGET}ing the kernel objects"
    132   1.1        ws 	rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \
    133   1.9  christos 	    [Ee]rrs linterrs makelinks assym.h.tmp assym.h
    134   1.9  christos 
    135   1.9  christos __CLEANDEPEND: .USE
    136   1.9  christos 	rm -f .depend
    137   1.9  christos 
    138   1.9  christos clean: __CLEANKERNEL
    139   1.9  christos 
    140   1.9  christos cleandir: __CLEANKERNEL __CLEANDEPEND
    141   1.1        ws 
    142   1.1        ws lint:
    143   1.3     perry 	@lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \
    144   1.4     perry 		${PPC}/powerpc/Locore.c ${CFILES} \
    145   1.1        ws 		ioconf.c param.c | \
    146   1.1        ws 		grep -v 'static function .* unused'
    147   1.1        ws 
    148   1.1        ws tags:
    149   1.1        ws 	@echo "see $S/kern/Makefile for tags"
    150   1.1        ws 
    151   1.1        ws links:
    152   1.1        ws 	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
    153   1.1        ws 	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
    154   1.1        ws 	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
    155   1.1        ws 	  sort -u | comm -23 - dontlink | \
    156   1.1        ws 	  sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
    157   1.1        ws 	sh makelinks && rm -f dontlink
    158   1.1        ws 
    159   1.1        ws SRCS=	${PPC}/powerpc/locore.S \
    160   1.1        ws 	param.c ioconf.c ${CFILES} ${SFILES}
    161   1.6   thorpej depend: .depend
    162   1.1        ws .depend: ${SRCS} assym.h param.c
    163   1.1        ws 	${MKDEP} ${AFLAGS} ${CPPFLAGS} ${PPC}/powerpc/locore.S
    164   1.1        ws 	${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
    165   1.1        ws .if ${SFILES} != ""
    166   1.1        ws 	${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
    167   1.1        ws .endif
    168   1.8       leo 	sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
    169   1.8       leo 	  ${CPPFLAGS} < ${PPC}/powerpc/genassym.cf
    170   1.8       leo 	@sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend
    171   1.8       leo 	@rm -f assym.dep
    172   1.1        ws 
    173   1.1        ws # depend on root or device configuration
    174   1.1        ws autoconf.o conf.o: Makefile
    175   1.1        ws 
    176   1.1        ws # depend on network or filesystem configuration
    177   1.1        ws uipc_proto.o vfs_conf.o: Makefile
    178   1.1        ws 
    179   1.1        ws # depend on maxusers
    180   1.6   thorpej machdep.o: Makefile
    181   1.1        ws 
    182   1.1        ws # depend on CPU configuration
    183   1.1        ws locore.o machdep.o: Makefile
    184   1.1        ws 
    185   1.1        ws 
    186   1.1        ws locore.o: ${PPC}/powerpc/locore.S assym.h
    187   1.1        ws 	${NORMAL_S}
    188   1.1        ws 
    189   1.1        ws %RULES
    190