Change the framework to allow the building of a cross-assembler when
TARGET_MACHINE_ARCH is defined.
This commit is contained in:
parent
a0c4d0c2e6
commit
943dab8026
|
@ -1,25 +1,30 @@
|
|||
# $NetBSD: Makefile,v 1.23 1997/06/23 13:30:51 mrg Exp $
|
||||
# $NetBSD: Makefile,v 1.24 1997/09/19 01:02:08 jeremy Exp $
|
||||
# @(#)Makefile 6.1 (Berkeley) 3/3/91
|
||||
TARGET_MACHINE_ARCH?= $(MACHINE_ARCH)
|
||||
|
||||
.if (${MACHINE_ARCH} == "i386") || \
|
||||
(${MACHINE_ARCH} == "m68k") || \
|
||||
(${MACHINE_ARCH} == "ns32k") || \
|
||||
(${MACHINE_ARCH} == "sparc") || \
|
||||
(${MACHINE_ARCH} == "vax")
|
||||
.if exists(config/Makefile.$(MACHINE_ARCH))
|
||||
.include "config/Makefile.$(MACHINE_ARCH)"
|
||||
.if (${TARGET_MACHINE_ARCH} == "i386") || \
|
||||
(${TARGET_MACHINE_ARCH} == "m68k") || \
|
||||
(${TARGET_MACHINE_ARCH} == "ns32k") || \
|
||||
(${TARGET_MACHINE_ARCH} == "sparc") || \
|
||||
(${TARGET_MACHINE_ARCH} == "vax")
|
||||
.if exists(config/Makefile.$(TARGET_MACHINE_ARCH))
|
||||
.include "config/Makefile.$(TARGET_MACHINE_ARCH)"
|
||||
.endif
|
||||
|
||||
.if !defined (gas_hosttype)
|
||||
gas_hosttype=$(MACHINE_ARCH)
|
||||
.endif
|
||||
.if !defined (gas_target)
|
||||
gas_target=$(MACHINE_ARCH)
|
||||
gas_target=$(TARGET_MACHINE_ARCH)
|
||||
.endif
|
||||
.if !defined (gas_objformat)
|
||||
gas_objformat=aout
|
||||
.endif
|
||||
|
||||
.if ($(TARGET_MACHINE_ARCH) != $(MACHINE_ARCH))
|
||||
CFLAGS+= -DCROSS_COMPILE
|
||||
.endif
|
||||
|
||||
ADDINCLUDE=-I${.OBJDIR}
|
||||
|
||||
PROG= as
|
||||
|
@ -41,12 +46,12 @@ CONF_HEADERS= targ-cpu.h obj-format.h host.h targ-env.h
|
|||
|
||||
beforedepend ${PROG}: ${CONF_HEADERS}
|
||||
|
||||
targ-cpu.h: Makefile config/Makefile.$(MACHINE_ARCH)
|
||||
targ-cpu.h: Makefile config/Makefile.$(TARGET_MACHINE_ARCH)
|
||||
@cmp -s $(.CURDIR)/config/tc-$(gas_target).h targ-cpu.h || \
|
||||
( echo "updating ${.TARGET}..." ; /bin/rm -f targ-cpu.h ; \
|
||||
cp $(.CURDIR)/config/tc-$(gas_target).h targ-cpu.h )
|
||||
|
||||
obj-format.h: Makefile config/Makefile.$(MACHINE_ARCH)
|
||||
obj-format.h: Makefile config/Makefile.$(TARGET_MACHINE_ARCH)
|
||||
@cmp -s $(.CURDIR)/config/obj-$(gas_objformat).h obj-format.h || \
|
||||
( echo "updating ${.TARGET}..." ; /bin/rm -f obj-format.h ; \
|
||||
cp $(.CURDIR)/config/obj-$(gas_objformat).h obj-format.h )
|
||||
|
@ -62,13 +67,13 @@ host.h: Makefile config/Makefile.$(MACHINE_ARCH)
|
|||
( echo "updating ${.TARGET}..." ; /bin/rm -f host.h ; \
|
||||
cp $(config_hostfile) host.h )
|
||||
|
||||
.if exists ($(.CURDIR)/config/te-$(MACHINE_ARCH).h)
|
||||
config_targenvfile= $(.CURDIR)/config/te-$(MACHINE_ARCH).h
|
||||
.if exists ($(.CURDIR)/config/te-$(TARGET_MACHINE_ARCH).h)
|
||||
config_targenvfile= $(.CURDIR)/config/te-$(TARGET_MACHINE_ARCH).h
|
||||
.else
|
||||
config_targenvfile= $(.CURDIR)/config/te-generic.h
|
||||
.endif
|
||||
|
||||
targ-env.h: Makefile config/Makefile.$(MACHINE_ARCH)
|
||||
targ-env.h: Makefile config/Makefile.$(TARGET_MACHINE_ARCH)
|
||||
@cmp -s $(config_targenvfile) targ-env.h || \
|
||||
( echo "updating ${.TARGET}..." ; /bin/rm -f targ-env.h ; \
|
||||
cp $(config_targenvfile) targ-env.h )
|
||||
|
|
Loading…
Reference in New Issue