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