mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-25 11:37:56 +00:00
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).
This commit is contained in:
parent
51dbee9db1
commit
bd42830f0f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=92813
@ -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; \
|
||||
|
@ -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}
|
||||
|
@ -3,6 +3,4 @@
|
||||
|
||||
SUBDIR= lint1 lint2 xlint llib
|
||||
|
||||
build-tools: lint1 lint2 xlint
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
.PATH: ${.CURDIR}/../common
|
||||
|
||||
lint.7: makeman
|
||||
sh ${.CURDIR}/makeman ${OBJFORMAT_PATH}/${PROG} -m >${.TARGET}
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
.PATH: ../common
|
||||
|
||||
lint.7: makeman
|
||||
sh ${.CURDIR}/makeman ${.OBJDIR}/${PROG} -m >${.TARGET}
|
||||
|
@ -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
|
||||
|
@ -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>
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user