Set a CPP define on the command line to indicate which object

format lint(1) is being targeted at, and use this knowledge
as appropriate in the target param headers.
This commit is contained in:
thorpej 2001-10-24 00:42:35 +00:00
parent 1c11481abf
commit 20d4cc1a5a
2 changed files with 18 additions and 8 deletions

View File

@ -1,4 +1,6 @@
# $NetBSD: Makefile,v 1.16 2001/10/24 00:07:39 tv Exp $
# $NetBSD: Makefile,v 1.17 2001/10/24 00:42:35 thorpej Exp $
.include <bsd.own.mk>
PROG= lint1
SRCS= cgram.y scan.l mem1.c mem.c err.c main1.c decl.c tree.c func.c \
@ -7,7 +9,20 @@ MAN= lint.7
LDADD+= -ll
DPADD+= ${LIBL}
YHEADER=1
CPPFLAGS+=-I${.CURDIR} -I. -I${.CURDIR}/arch/${MACHINE_ARCH}
.if ${OBJECT_FMT} == "a.out"
CPPFLAGS+=-DTARGET_OBJFMT_AOUT
.elif ${OBJECT_FMT} == "COFF"
CPPFLAGS+=-DTARGET_OBJFMT_COFF
.elif ${OBJECT_FMT} == "ELF"
CPPFLAGS+=-DTARGET_OBJFMT_ELF
.else
.BEGIN:
@echo "Unrecognized OBJECT_FMT ${OBJECT_FMT}"
@false
.endif
LINTFLAGS=-aehpz
WFORMAT=1 #hopeless
BINDIR= /usr/libexec

View File

@ -1,4 +1,4 @@
/* $NetBSD: targparam.h,v 1.1 2001/10/21 21:39:50 thorpej Exp $ */
/* $NetBSD: targparam.h,v 1.2 2001/10/24 00:42:35 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@ -41,12 +41,7 @@
* kept in sync with the compiler!
*/
/*
* XXX This is not right! It picks up ELF from the host, not
* XXX the target.
*/
#if defined(__ELF__)
#if defined(TARGET_OBJFMT_ELF)
#define PTRDIFF_IS_LONG 1
#define SIZEOF_IS_ULONG 1
#else