diff options
author | ru <ru@FreeBSD.org> | 2002-03-20 18:25:50 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2002-03-20 18:25:50 +0000 |
commit | 333c1d4d25cf8c0498e4324502d4ed90dcffd2e3 (patch) | |
tree | 203191190a1d45e1fe5ab202024032a4bae4048d | |
parent | f239d72864df9d8c684c4985d0266ae8e4e0c0b1 (diff) | |
download | FreeBSD-src-333c1d4d25cf8c0498e4324502d4ed90dcffd2e3.zip FreeBSD-src-333c1d4d25cf8c0498e4324502d4ed90dcffd2e3.tar.gz |
Make lint(1) a cross-tool.
(See commit log for usr.bin/xlint/Makefile,v 1.11 for what was wrong
with enabling build of lint libraries in rev. 1.12.)
This fixes cross-arch compiles (running binaries for a different arch
when generating lint.7 and lint libraries) and cross-branch compiles
(4.x -> 5.0 buildworld should be working again).
-rw-r--r-- | Makefile.inc1 | 4 | ||||
-rw-r--r-- | share/mk/sys.mk | 2 | ||||
-rw-r--r-- | usr.bin/xlint/Makefile | 2 | ||||
-rw-r--r-- | usr.bin/xlint/Makefile.inc | 3 | ||||
-rw-r--r-- | usr.bin/xlint/lint1/Makefile | 10 | ||||
-rw-r--r-- | usr.bin/xlint/llib/Makefile | 7 | ||||
-rw-r--r-- | usr.bin/xlint/xlint/Makefile | 1 | ||||
-rw-r--r-- | usr.bin/xlint/xlint/pathnames.h | 9 |
8 files changed, 16 insertions, 22 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1 index b05eddb..6ba1b12 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -615,9 +615,11 @@ _elf2exe= usr.sbin/elf2exe _btxld= usr.sbin/btxld .endif +_xlint= usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint + cross-tools: .for _tool in ${_btxld} ${_elf2exe} \ - gnu/usr.bin/binutils usr.bin/objformat gnu/usr.bin/cc + gnu/usr.bin/binutils usr.bin/objformat gnu/usr.bin/cc ${_xlint} cd ${.CURDIR}/${_tool}; \ ${MAKE} obj; \ ${MAKE} depend; \ diff --git a/share/mk/sys.mk b/share/mk/sys.mk index d804c90..89ef00c 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -76,7 +76,7 @@ LD ?= ld LDFLAGS ?= LINT ?= lint -LINTFLAGS ?= -cghapbx -L /usr/libdata/lint +LINTFLAGS ?= -cghapbx LINTKERNFLAGS ?= ${LINTFLAGS} LINTOBJFLAGS ?= -cghapbxu -i LINTLIBFLAGS ?= -cghapbxu -C ${LIB} diff --git a/usr.bin/xlint/Makefile b/usr.bin/xlint/Makefile index 3f935c6..eb8c2e4 100644 --- a/usr.bin/xlint/Makefile +++ b/usr.bin/xlint/Makefile @@ -3,6 +3,4 @@ SUBDIR= lint1 lint2 xlint llib -build-tools: lint1 lint2 xlint - .include <bsd.subdir.mk> diff --git a/usr.bin/xlint/Makefile.inc b/usr.bin/xlint/Makefile.inc index 91c252b..82d0b34 100644 --- a/usr.bin/xlint/Makefile.inc +++ b/usr.bin/xlint/Makefile.inc @@ -6,7 +6,8 @@ WARNS= 0 .PATH: ${.CURDIR}/../common -CFLAGS+= -I${.CURDIR}/../arch/${MACHINE_ARCH} +TARGET_ARCH?= ${MACHINE_ARCH} +CFLAGS+= -I${.CURDIR}/../arch/${TARGET_ARCH} CFLAGS+= -I${.CURDIR}/../common OBJECT_FMT= ELF diff --git a/usr.bin/xlint/lint1/Makefile b/usr.bin/xlint/lint1/Makefile index c6d39b9..6371c94 100644 --- a/usr.bin/xlint/lint1/Makefile +++ b/usr.bin/xlint/lint1/Makefile @@ -5,6 +5,7 @@ PROG= lint1 SRCS= cgram.y scan.l mem1.c mem.c err.c main1.c decl.c tree.c func.c \ init.c emit.c emit1.c inittyp.c MAN= lint.7 +CLEANFILES= lint.7 LDADD+= -ll -lm DPADD+= ${LIBL} ${LIBM} @@ -12,10 +13,11 @@ CFLAGS+= -I. -I${.CURDIR} LINTFLAGS=-aehpz BINDIR= /usr/libexec +OBJFORMAT_PATH?= ${BINDIR} # src/Makefile.inc1 sets this -.include <bsd.prog.mk> +.PATH: ${.CURDIR}/../common -.PATH: ../common +lint.7: makeman + sh ${.CURDIR}/makeman ${OBJFORMAT_PATH}/${PROG} -m >${.TARGET} -lint.7: makeman - sh ${.CURDIR}/makeman ${.OBJDIR}/${PROG} -m >${.TARGET} +.include <bsd.prog.mk> diff --git a/usr.bin/xlint/llib/Makefile b/usr.bin/xlint/llib/Makefile index 3fd0ff1..9f1e3c1 100644 --- a/usr.bin/xlint/llib/Makefile +++ b/usr.bin/xlint/llib/Makefile @@ -1,18 +1,11 @@ # $NetBSD: Makefile,v 1.7 2000/06/14 20:22:19 matt Exp $ # $FreeBSD$ -.include <bsd.own.mk> - LIBS= llib-lposix.ln llib-lstdc.ln -LINT= ${.OBJDIR}/../xlint/xlint FILES= ${LIBS} FILESDIR= ${LINTLIBDIR} -install: - ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${LIBMODE} \ - ${LIBS} ${DESTDIR}${LINTLIBDIR} - CLEANFILES+= ${LIBS} llib-lposix.ln: llib-lposix diff --git a/usr.bin/xlint/xlint/Makefile b/usr.bin/xlint/xlint/Makefile index 9ac2f93..5dfdfb3 100644 --- a/usr.bin/xlint/xlint/Makefile +++ b/usr.bin/xlint/xlint/Makefile @@ -9,6 +9,7 @@ SRCS= xlint.c mem.c MAN= lint.1 CFLAGS+=-I${.CURDIR}/../lint1 +CFLAGS+= -DPREFIX=\"${TOOLS_PREFIX}\" .include "${.CURDIR}/../../Makefile.inc" .include <bsd.prog.mk> diff --git a/usr.bin/xlint/xlint/pathnames.h b/usr.bin/xlint/xlint/pathnames.h index 112081c..3f7d210 100644 --- a/usr.bin/xlint/xlint/pathnames.h +++ b/usr.bin/xlint/xlint/pathnames.h @@ -35,14 +35,11 @@ /* directory where lint1 and lint2 reside */ #ifndef PATH_LIBEXEC -#define PATH_LIBEXEC "/usr/libexec" +#define PATH_LIBEXEC PREFIX"/usr/libexec" #endif /* directory where cc(1) resides */ -#define PATH_USRBIN "/usr/bin" - -/* directory where cc(1) resides */ -#define PATH_USRBIN "/usr/bin" +#define PATH_USRBIN PREFIX"/usr/bin" /* default library search path */ -#define PATH_LINTLIB "/usr/libdata/lint" +#define PATH_LINTLIB PREFIX"/usr/libdata/lint" |