Thu Apr 14 09:31:25 2011 UTC ()
use HOSTPROG to build the mkext program (which creates external.c and
external.h for ccom) rather than HOST_CC directly.

because PROG and HOSTPROG don't play nicely together, put mkext in its
own SUBDIR


(plunky)
diff -r1.4 -r1.5 src/external/bsd/pcc/libexec/Makefile
diff -r1.6 -r1.7 src/external/bsd/pcc/libexec/ccom/Makefile
diff -r0 -r1.1 src/external/bsd/pcc/libexec/mkext/Makefile

cvs diff -r1.4 -r1.5 src/external/bsd/pcc/libexec/Makefile (expand / switch to unified diff)

--- src/external/bsd/pcc/libexec/Makefile 2010/02/05 08:42:39 1.4
+++ src/external/bsd/pcc/libexec/Makefile 2011/04/14 09:31:25 1.5
@@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
1# $NetBSD: Makefile,v 1.4 2010/02/05 08:42:39 plunky Exp $ 1# $NetBSD: Makefile,v 1.5 2011/04/14 09:31:25 plunky Exp $
2 2
3.include <bsd.own.mk> 3.include <bsd.own.mk>
4 4
5.if (${MKPCCCMDS} != "no") 5.if (${MKPCCCMDS} != "no")
6SUBDIR= ccom cpp 6SUBDIR= mkext .WAIT ccom cpp
7.endif 7.endif
8 8
9.include <bsd.subdir.mk> 9.include <bsd.subdir.mk>

cvs diff -r1.6 -r1.7 src/external/bsd/pcc/libexec/ccom/Makefile (expand / switch to unified diff)

--- src/external/bsd/pcc/libexec/ccom/Makefile 2010/06/03 19:17:22 1.6
+++ src/external/bsd/pcc/libexec/ccom/Makefile 2011/04/14 09:31:25 1.7
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.6 2010/06/03 19:17:22 plunky Exp $ 1# $NetBSD: Makefile,v 1.7 2011/04/14 09:31:25 plunky Exp $
2 2
3WARNS?= 2 3WARNS?= 2
4 4
5.include <bsd.init.mk> 5.include <bsd.init.mk>
6 6
7.PATH: ${PCC_DIST}/cc/ccom \ 7.PATH: ${PCC_DIST}/cc/ccom \
8 ${PCC_DIST}/arch/${TARGMACH} \ 8 ${PCC_DIST}/arch/${TARGMACH} \
9 ${PCC_DIST}/mip 9 ${PCC_DIST}/mip
10 10
11PROG= ccom 11PROG= ccom
12 12
13SRCS= cgram.y 13SRCS= cgram.y
14SRCS+= scan.l 14SRCS+= scan.l
@@ -21,20 +21,22 @@ MAN= ccom.1 @@ -21,20 +21,22 @@ MAN= ccom.1
21 21
22# generate cgram.h 22# generate cgram.h
23YHEADER= 23YHEADER=
24 24
25CPPFLAGS+= -DPCC_DEBUG 25CPPFLAGS+= -DPCC_DEBUG
26CPPFLAGS+= -I${.OBJDIR} 26CPPFLAGS+= -I${.OBJDIR}
27CPPFLAGS+= -I${PCC_DIST}/mip 27CPPFLAGS+= -I${PCC_DIST}/mip
28CPPFLAGS+= -I${PCC_DIST}/os/${TARGOS} 28CPPFLAGS+= -I${PCC_DIST}/os/${TARGOS}
29CPPFLAGS+= -I${PCC_DIST}/arch/${TARGMACH} 29CPPFLAGS+= -I${PCC_DIST}/arch/${TARGMACH}
30CPPFLAGS+= -I${PCC_DIST}/cc/ccom 30CPPFLAGS+= -I${PCC_DIST}/cc/ccom
31 31
32DPSRCS= external.c external.h 32DPSRCS= external.c external.h
33 33
34external.c external.h: mkext.c table.c common.c 34MKEXTDIR!= cd ../mkext && ${PRINTOBJDIR}
35 ${HOST_CC} ${CFLAGS} ${CPPFLAGS} -DMKEXT -o ${.OBJDIR}/mkext ${.ALLSRC} 
36 ${.OBJDIR}/mkext 
37 35
38CLEANFILES+= external.c external.h mkext 36external.c external.h: ${MKEXTDIR}/mkext
 37 ${_MKTARGET_CREATE}
 38 ${MKEXTDIR}/mkext
 39
 40CLEANFILES+= external.c external.h
39 41
40.include <bsd.prog.mk> 42.include <bsd.prog.mk>

File Added: src/external/bsd/pcc/libexec/mkext/Makefile
#	$NetBSD: Makefile,v 1.1 2011/04/14 09:31:25 plunky Exp $

#
# this is really part of ccom, but HOSTPROG and PROG don't mix
#

.include <bsd.init.mk>

.PATH:	${PCC_DIST}/cc/ccom \
	${PCC_DIST}/arch/${TARGMACH} \
	${PCC_DIST}/mip

HOSTPROG=	mkext
MAN=
SRCS=		mkext.c table.c common.c

HOST_CPPFLAGS+=	-DMKEXT
HOST_CPPFLAGS+=	-I${PCC_DIST}/mip
HOST_CPPFLAGS+=	-I${PCC_DIST}/arch/${TARGMACH}
HOST_CPPFLAGS+=	-I${PCC_DIR}/include

.include <bsd.hostprog.mk>