Support cross-compilation.
This commit is contained in:
parent
e54c5c5eac
commit
5e75e3fa90
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: Makefile.mvme68k,v 1.22 1997/03/14 23:19:03 mycroft Exp $
|
||||
# $NetBSD: Makefile.mvme68k,v 1.23 1997/03/17 22:16:03 gwr Exp $
|
||||
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
|
@ -21,6 +21,10 @@
|
|||
# DEBUG is set to -g if debugging.
|
||||
# PROF is set to -pg if profiling.
|
||||
|
||||
# Simplify cross-build...
|
||||
MACHINE_ARCH=m68k
|
||||
MACHINE=mvme68k
|
||||
|
||||
CC?= cc
|
||||
LD?= ld
|
||||
MKDEP?= mkdep
|
||||
|
@ -33,19 +37,19 @@ S!= cd ../../../..; pwd
|
|||
.endif
|
||||
MVME68K=$S/arch/mvme68k
|
||||
|
||||
INCLUDES= -I. -I$S/arch -I$S -nostdinc
|
||||
CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL \
|
||||
-Dmc68020 -Dmvme68k -DFPCOPROC
|
||||
# Override CPP defaults entirely, so cross-compilation works.
|
||||
# Keep -nostdinc before all -I flags, similar for -undef ...
|
||||
INCLUDES= -nostdinc -I. -I$S/arch -I$S
|
||||
XDEFS= -undef -D__NetBSD__ -Dm68k -Dmc68000
|
||||
DEFINES= -D_KERNEL -Dmc68020 -Dmvme68k
|
||||
CPPFLAGS= ${INCLUDES} ${XDEFS} ${DEFINES} ${IDENT} ${PARAM}
|
||||
CWARNFLAGS= -Werror
|
||||
CFLAGS= ${DEBUG} ${COPTS} ${CWARNFLAGS} -msoft-float
|
||||
AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
|
||||
CFLAGS= ${DEBUG} ${COPTS} -msoft-float ${CWARNFLAGS}
|
||||
APPFLAGS= -P -traditional ${CPPFLAGS} -D_LOCORE
|
||||
AFLAGS= -m68030
|
||||
LINKFLAGS= -n -Ttext 8000 -e start
|
||||
STRIPFLAGS= -d
|
||||
|
||||
HOSTED_CC= ${CC}
|
||||
HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
|
||||
HOSTED_CFLAGS= ${CFLAGS}
|
||||
|
||||
### find out what to use for libkern
|
||||
.include "$S/lib/libkern/Makefile.inc"
|
||||
.ifndef PROF
|
||||
|
@ -57,21 +61,24 @@ LIBKERN= ${KERNLIB_PROF}
|
|||
### find out what to use for libcompat
|
||||
.include "$S/compat/common/Makefile.inc"
|
||||
.ifndef PROF
|
||||
LIBCOMPAT= ${COMPATLIB}
|
||||
LIBCOMPAT= ${COMPATLIB}
|
||||
.else
|
||||
LIBCOMPAT= ${COMPATLIB_PROF}
|
||||
LIBCOMPAT= ${COMPATLIB_PROF}
|
||||
.endif
|
||||
|
||||
### for the Motorola 68040 Floating Point Software Product
|
||||
.include "$S/arch/m68k/fpsp/Makefile.inc"
|
||||
|
||||
# compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
|
||||
# HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
|
||||
# compile rules: rules are named NORMAL_${SUFFIX} where SUFFIX is
|
||||
# the file suffix, capitalized (e.g. C for a .c file).
|
||||
|
||||
NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
|
||||
NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $<
|
||||
|
||||
HOSTED_C= ${HOSTED_CC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $<
|
||||
# Please do not assume the compiler does "-x ..." (gcc-only).
|
||||
# This needs an intermediate file. The original file is always
|
||||
# safe in some far away directory, so just use the base name.
|
||||
NORMAL_S= ${CPP} ${APPFLAGS} $< > $*.s ;\
|
||||
${AS} ${AFLAGS} -o $@ $*.s ; rm $*.s
|
||||
|
||||
%OBJS
|
||||
|
||||
|
@ -150,9 +157,19 @@ SRCS= ${MVME68K}/mvme68k/locore.s \
|
|||
param.c ioconf.c ${CFILES} ${SFILES}
|
||||
depend: .depend
|
||||
.depend: ${SRCS} assym.h param.c
|
||||
${MKDEP} ${AFLAGS} ${CPPFLAGS} ${MVME68K}/mvme68k/locore.s
|
||||
${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
|
||||
${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
|
||||
${MKDEP} ${CPPFLAGS} param.c ioconf.c ${CFILES}
|
||||
|
||||
# XXX - see below
|
||||
# ${MKDEP} -a ${APPFLAGS} ${MVME68K}/mvme68k/locore.s
|
||||
# ${MKDEP} -a ${APPFLAGS} ${SFILES}
|
||||
#
|
||||
# For cross-compilation, the "gcc -M" mkdep script is convenient,
|
||||
# but that does not correctly make rules from *.s files. The
|
||||
# easiest work-around is to just list those dependencies here.
|
||||
locore.o: assym.h m68k/asm.h m68k/trap.h
|
||||
copy.o: assym.h m68k/asm.h $S/sys/errno.h
|
||||
bcopy.o: assym.h m68k/asm.h
|
||||
copypage.o: assym.h m68k/asm.h
|
||||
|
||||
|
||||
# depend on root or device configuration
|
||||
|
|
Loading…
Reference in New Issue