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