summaryrefslogtreecommitdiffstats
path: root/usr.bin/xlint
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2002-03-20 18:25:50 +0000
committerru <ru@FreeBSD.org>2002-03-20 18:25:50 +0000
commit333c1d4d25cf8c0498e4324502d4ed90dcffd2e3 (patch)
tree203191190a1d45e1fe5ab202024032a4bae4048d /usr.bin/xlint
parentf239d72864df9d8c684c4985d0266ae8e4e0c0b1 (diff)
downloadFreeBSD-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).
Diffstat (limited to 'usr.bin/xlint')
-rw-r--r--usr.bin/xlint/Makefile2
-rw-r--r--usr.bin/xlint/Makefile.inc3
-rw-r--r--usr.bin/xlint/lint1/Makefile10
-rw-r--r--usr.bin/xlint/llib/Makefile7
-rw-r--r--usr.bin/xlint/xlint/Makefile1
-rw-r--r--usr.bin/xlint/xlint/pathnames.h9
6 files changed, 12 insertions, 20 deletions
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"
OpenPOWER on IntegriCloud