summaryrefslogtreecommitdiff
path: root/sys/arch/amiga/conf/Makefile.amiga
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1996-02-24 20:35:47 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1996-02-24 20:35:47 +0000
commit80e1318c4158b3071698e18844faf3f52b83f860 (patch)
treebf7a0eb440322e25821b7db783ec9f58e0d4f9e0 /sys/arch/amiga/conf/Makefile.amiga
parente7ed2b7160c2d53b718e787a621ab5e368195869 (diff)
From NetBSD:
LOCORE -> _LOCORE assym.s -> assym.h (Some ports did this already.) Use `-traditional-cpp' when building .s and .S files. Clone these, and fix many bugs. Fix mkdep problems due to missing flags.
Diffstat (limited to 'sys/arch/amiga/conf/Makefile.amiga')
-rw-r--r--sys/arch/amiga/conf/Makefile.amiga174
1 files changed, 91 insertions, 83 deletions
diff --git a/sys/arch/amiga/conf/Makefile.amiga b/sys/arch/amiga/conf/Makefile.amiga
index ffb8a5c5eeb..54dc69fccc0 100644
--- a/sys/arch/amiga/conf/Makefile.amiga
+++ b/sys/arch/amiga/conf/Makefile.amiga
@@ -1,17 +1,15 @@
-# $NetBSD: Makefile.amiga,v 1.31 1996/01/14 21:06:47 thorpej Exp $
+# $NetBSD: Makefile.amiga,v 1.37 1996/02/09 02:21:17 mycroft Exp $
-# @(#)Makefile.hp300 7.10 (Berkeley) 6/27/91
-#
-# Makefile for 4.4 BSD
+# Makefile for OpenBSD
#
# This makefile is constructed from a machine description:
# config machineid
# Most changes should be made in the machine description
-# /sys/conf/``machineid''
+# /sys/arch/amiga/conf/``machineid''
# after which you should do
-# config machineid
+# config machineid
# Machine generic makefile changes should be made in
-# /sys/conf/Makefile.``machinetype''
+# /sys/arch/amiga/conf/Makefile.amiga
# after which config should be rerun for all machines of that type.
#
# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE
@@ -20,22 +18,26 @@
# -DTRACE compile in kernel tracing hooks
# -DQUOTA compile in file system quotas
+# DEBUG is set to -g if debugging.
+# PROF is set to -pg if profiling.
-# DEBUG is set to -g by config if debugging is requested (config -g).
-# PROF is set to -pg by config if profiling is requested (config -p).
AS= as
-CC= cc ${DEBUG}
+AWK= awk
+CC= cc
CPP= cpp
-LD= ld
+LD= ld
+STRIP= strip -d
TOUCH= touch -f -c
# source tree is located via $S relative to the compilation directory
S= ../../../..
AMIGA= ../..
-INCLUDES= -I. -I$S/arch -I$S -I$S/sys
-COPTS= ${INCLUDES} ${IDENT} -D_KERNEL -Dmc68020 -Damiga
-CFLAGS= -O -Werror -mc68020 -m68881 ${COPTS}
+INCLUDES= -I. -I$S/arch -I$S
+CPPFLAGS= ${INCLUDES} ${IDENT} -D_KERNEL -Dmc68020 -Damiga
+CFLAGS= ${DEBUG} -O2 -Werror -mc68020 -msoft-float
+AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
+LINKFLAGS= -n -Ttext 0 -e start
### find out what to use for libkern
.include "$S/lib/libkern/Makefile.inc"
@@ -61,19 +63,14 @@ LIBCOMPAT= ${COMPATLIB_PROF}
# capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
# is marked as config-dependent.
-NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $<
-NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
+NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
+NORMAL_C_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
-DRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $<
-DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
+DRIVER_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
+DRIVER_C_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
-PROFILE_C= ${CC} -S -c ${COPTS} $<; \
- sed -e s/_mcount/mcount/ -e s/subrmcount/subr_mcount/ <$*.s | \
- ${AS} -o $@; \
- rm -f $*.s
-
-NORMAL_S= ${CPP} ${COPTS} $< | ${AS} -o $@
-NORMAL_S_C= ${CPP} ${COPTS} ${PARAM} $< | ${AS} -o $@
+NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $<
+NORMAL_S_C= ${CC} ${AFLAGS} ${CPPFLAGS} ${PARAM} -c $<
.SUFFIXES: .o .g
@@ -82,97 +79,108 @@ NORMAL_S_C= ${CPP} ${COPTS} ${PARAM} $< | ${AS} -o $@
NORMAL_G= gspa < $< | gspahextoc > $*.c; ${CC} -c ${CFLAGS} ${PROF} $*.c
%OBJS
-
+
%CFILES
+
+%SFILES
# load lines for config "xxx" will be emitted as:
# xxx: ${SYSTEM_DEP} swapxxx.o
# ${SYSTEM_LD_HEAD}
# ${SYSTEM_LD} swapxxx.o
# ${SYSTEM_LD_TAIL}
-SYSTEM_OBJ= locore.o ${FPSP} vnode_if.o ${OBJS} param.o ioconf.o \
- ${LIBKERN} ${LIBCOMPAT}
+SYSTEM_OBJ= locore.o ${FPSP} \
+ vnode_if.o param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT}
SYSTEM_DEP= Makefile ${SYSTEM_OBJ}
-SYSTEM_LD_HEAD= rm -f $@
-SYSTEM_LD= -@if [ X${DEBUG} = X-g ]; \
- then strip=-X; \
- else strip=-x; \
- fi; \
- echo ${LD} $$strip -n -T 0 -o $@ -e start '$${SYSTEM_OBJ}' vers.o; \
- ${LD} $$strip -n -T 0 -o $@ -e start ${SYSTEM_OBJ} vers.o
-SYSTEM_LD_TAIL= @size $@; chmod 755 $@; \
- [ X${DEBUG} = X-g ] && { \
+SYSTEM_LD_HEAD= @rm -f $@
+SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
+ ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
+SYSTEM_LD_TAIL= @size $@; chmod 755 $@
+
+DEBUG?=
+.if ${DEBUG} == "-g"
+LINKFLAGS+= -X
+SYSTEM_LD_TAIL+=; \
echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
- echo strip -d $@; strip -d $@; } || true
+ echo ${STRIP} $@; ${STRIP} $@
+.else
+LINKFLAGS+= -x
+.endif
%LOAD
-vers.o: newvers
+assym.h: genassym
+ ./genassym >assym.h
-newvers:
- sh $S/conf/newvers.sh ${KERN_IDENT}
- ${CC} $(CFLAGS) -c vers.c
+genassym: genassym.o
+ ${CC} -o $@ genassym.o
-clean::
- rm -f eddep *netbsd netbsd.gdb tags *.o locore.i [a-z]*.s \
- vnode_if.[ch] Errs errs linterrs makelinks genassym
+genassym.o: ${AMIGA}/amiga/genassym.c
+ ${NORMAL_C_C}
-lint: /tmp param.c
- @lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} -UKGDB \
- ${AMIGA}/amiga/Locore.c ${CFILES} ${AMIGA}/amiga/swapgeneric.c \
- ioconf.c param.c| \
- grep -v 'struct/union .* never defined' | \
- grep -v 'possible pointer alignment problem'
+vnode_if.c vnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src
+ AWK="${AWK}" sh $S/kern/vnode_if.sh $S/kern/vnode_if.src
-locore.o: assym.s ${AMIGA}/amiga/vectors.s ${AMIGA}/amiga/locore.s
-locore.o: machine/trap.h machine/psl.h machine/pte.h machine/cpu.h
- ${CPP} -DLOCORE ${COPTS} ${AMIGA}/amiga/locore.s | ${AS} -o locore.o
+param.c: $S/conf/param.c
+ rm -f param.c
+ cp $S/conf/param.c .
-# the following is necessary because autoconf.o depends on #if GENERIC
-autoconf.o: Makefile
+param.o: param.c Makefile
+ ${NORMAL_C_C}
-# the following are necessary because the files depend on the types of
-# hp cpu's included in the system configuration
-machdep.o sys_machdep.o pmap.o pmap_bootstrap.o trap.o dma.o: Makefile
+ioconf.o: ioconf.c
+ ${NORMAL_C}
-# depend on network or filesystem configuration
-uipc_proto.o vfs_conf.o locore.o: Makefile
+newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
+ sh $S/conf/newvers.sh
+ ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
-# depend on maxusers
-assym.s: Makefile
-assym.s: genassym
- ./genassym >assym.s
+clean::
+ rm -f eddep *netbsd netbsd.gdb tags vnode_if.[ch] *.[io] [a-z]*.s \
+ [Ee]rrs linterrs makelinks genassym genassym.o assym.h
-genassym:
- ${CC} -static ${INCLUDES} ${IDENT} ${PARAM} -Dmc68020 -Damiga \
- -o genassym ${AMIGA}/amiga/genassym.c
+lint:
+ @lint -hbxncez -DGENERIC -Dvolatile= ${CPPFLAGS} ${PARAM} -UKGDB \
+ ${AMIGA}/amiga/Locore.c ${CFILES} ${AMIGA}/amiga/swapgeneric.c \
+ ioconf.c param.c | \
+ grep -v 'static function .* unused'
-depend: assym.s param.c vnode_if.h
- mkdep ${COPTS} ${CFILES} ioconf.c param.c
- mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${AMIGA}/amiga/genassym.c
+tags:
+ @echo "see $S/kern/Makefile for tags"
links:
egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
sort -u | comm -23 - dontlink | \
- sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
+ sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
sh makelinks && rm -f dontlink
-tags:
- @echo "see $S/kern/Makefile for tags"
+SRCS= ${AMIGA}/amiga/locore.s \
+ vnode_if.c param.c ioconf.c ${CFILES} ${SFILES}
+depend: .depend
+.depend: ${SRCS} assym.h vnode_if.h param.c
+ mkdep ${AFLAGS} ${CPPFLAGS} ${AMIGA}/amiga/locore.s
+ mkdep -a ${CFLAGS} ${CPPFLAGS} vnode_if.c param.c ioconf.c ${CFILES}
+ mkdep -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
+ mkdep -a ${CFLAGS} ${CPPFLAGS} ${PARAM} ${AMIGA}/amiga/genassym.c
-ioconf.o: ioconf.c
- ${CC} -c ${CFLAGS} ioconf.c
-param.c: $S/conf/param.c
- rm -f param.c
- cp $S/conf/param.c .
+# depend on root or device configuration
+autoconf.o conf.o: Makefile
+
+# depend on network or filesystem configuration
+uipc_proto.o vfs_conf.o: Makefile
-param.o: param.c Makefile
- ${CC} -c ${CFLAGS} ${PARAM} param.c
-vnode_if.c vnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src
- AWK="${AWK}" sh $S/kern/vnode_if.sh $S/kern/vnode_if.src
+# depend on maxusers
+genassym.o machdep.o: Makefile
+
+# depend on CPU configuration
+amiga_init.o locore.o pmap.o sys_machdep.o bzsc.o flsc.o sbic.o sfas.o: Makefile
+
+
+locore.o: ${AMIGA}/amiga/locore.s assym.h
+ ${NORMAL_S}
%RULES