summaryrefslogtreecommitdiff
path: root/gnu/usr.bin
diff options
context:
space:
mode:
authoraymeric <aymeric@NetBSD.org>2001-07-25 11:58:04 +0000
committeraymeric <aymeric@NetBSD.org>2001-07-25 11:58:04 +0000
commitd2b58bf21f032b4e8afda021eac57aed3880d24d (patch)
treee44426f46fa04ae130f09b6622a844adf48fc96d /gnu/usr.bin
parentbe5153a9230dd2a97878720f43f120176c3a47cb (diff)
Make it possible to compile a cross-linker by just defining TARGET_MACHINE_ARCH
to the desired architecture. Note that this is for the old ld of the old toolchain.
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r--gnu/usr.bin/ld/Makefile.inc12
1 files changed, 9 insertions, 3 deletions
diff --git a/gnu/usr.bin/ld/Makefile.inc b/gnu/usr.bin/ld/Makefile.inc
index 2525c0e8fd8..49713831e4a 100644
--- a/gnu/usr.bin/ld/Makefile.inc
+++ b/gnu/usr.bin/ld/Makefile.inc
@@ -1,8 +1,14 @@
-# $NetBSD: Makefile.inc,v 1.3 1998/12/17 15:17:27 pk Exp $
+# $NetBSD: Makefile.inc,v 1.4 2001/07/25 11:58:04 aymeric Exp $
SHLIBPATH = $(.CURDIR)/../../../../libexec/ld.aout_so
-CPPFLAGS += -I$(SHLIBPATH) -I$(SHLIBPATH)/arch/$(MACHINE_ARCH) -I$(.CURDIR)
-.PATH: $(SHLIBPATH) $(SHLIBPATH)/arch/$(MACHINE_ARCH)
+TARGET_MACHINE_ARCH ?= $(MACHINE_ARCH)
+
+.if $(TARGET_MACHINE_ARCH) != $(MACHINE_ARCH)
+CPPFLAGS += -DCROSS_LINKER -DXHOST="$(MACHINE_ARCH)"
+.endif
+
+CPPFLAGS += -I$(SHLIBPATH) -I$(SHLIBPATH)/arch/$(TARGET_MACHINE_ARCH) -I$(.CURDIR)
+.PATH: $(SHLIBPATH) $(SHLIBPATH)/arch/$(TARGET_MACHINE_ARCH)
CFLAGS += -Wall -Wstrict-prototypes -Wmissing-prototypes