Module Name:    src
Committed By:   plunky
Date:           Wed Jan 20 11:45:55 UTC 2010

Modified Files:
        src/external/bsd/pcc: Makefile Makefile.inc
        src/external/bsd/pcc/lib: Makefile
        src/external/bsd/pcc/lib/crtstuff: Makefile
        src/external/bsd/pcc/lib/libpcc: Makefile
        src/external/bsd/pcc/libexec: Makefile
        src/external/bsd/pcc/libexec/ccom: Makefile
        src/external/bsd/pcc/libexec/cpp: Makefile
        src/external/bsd/pcc/usr.bin/pcc: Makefile
Added Files:
        src/external/bsd/pcc/lib: Makefile.inc
        src/external/bsd/pcc/libexec: Makefile.inc
        src/external/bsd/pcc/usr.bin: Makefile.inc

Log Message:
Clean up the build framework for pcc

  - use <bsd.init.mk> to include <../Makefile.inc> files
  - add Makefile.inc files that pull in appropriate build settings
  - fix the LIBEXECDIR definition (should have trailing /)
  - make cc.1 install as pcc.1 to match the binary
  - use YHEADER= to build the yacc headers
  - general consistency tidy up


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/pcc/Makefile \
    src/external/bsd/pcc/Makefile.inc
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/pcc/lib/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/pcc/lib/Makefile.inc
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/pcc/lib/crtstuff/Makefile
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/pcc/lib/libpcc/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/pcc/libexec/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/pcc/libexec/Makefile.inc
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/pcc/libexec/ccom/Makefile
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/pcc/libexec/cpp/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/pcc/usr.bin/Makefile.inc
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/pcc/usr.bin/pcc/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/pcc/Makefile
diff -u src/external/bsd/pcc/Makefile:1.1 src/external/bsd/pcc/Makefile:1.2
--- src/external/bsd/pcc/Makefile:1.1	Sun Aug 24 05:47:05 2008
+++ src/external/bsd/pcc/Makefile	Wed Jan 20 11:45:54 2010
@@ -1,6 +1,5 @@
-#	$NetBSD: Makefile,v 1.1 2008/08/24 05:47:05 gmcgarry Exp $
+#	$NetBSD: Makefile,v 1.2 2010/01/20 11:45:54 plunky Exp $
 
 SUBDIR=		lib libexec usr.bin
 
 .include <bsd.subdir.mk>
-
Index: src/external/bsd/pcc/Makefile.inc
diff -u src/external/bsd/pcc/Makefile.inc:1.1 src/external/bsd/pcc/Makefile.inc:1.2
--- src/external/bsd/pcc/Makefile.inc:1.1	Sun Aug 24 05:47:05 2008
+++ src/external/bsd/pcc/Makefile.inc	Wed Jan 20 11:45:54 2010
@@ -1,10 +1,11 @@
-#	$NetBSD: Makefile.inc,v 1.1 2008/08/24 05:47:05 gmcgarry Exp $
+#	$NetBSD: Makefile.inc,v 1.2 2010/01/20 11:45:54 plunky Exp $
 
-MDIR=	${DIST}/arch/${TARGMACH}
-MIPDIR=	${DIST}/mip
+PCC_DIR:=${.PARSEDIR}
+PCC_DIST=${PCC_DIR}/dist/pcc
+PCC_LIBS=${PCC_DIR}/dist/pcc-libs
 
 TARGOS = netbsd
-# XXX Currently only handles i386
+
 .if ${MACHINE_ARCH} == "i386"
 TARGMACH = i386
 .elif ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
@@ -18,9 +19,11 @@
 libexecdir = /usr/libexec
 includedir = /usr/include
 
-CPPFLAGS+= -DLIBEXECDIR=\"${libexecdir}\" -DINCLUDEDIR=\"${includedir}\"
-CPPFLAGS+= -I${DIST}/os/${TARGOS} -I${MDIR} -Dmach_${TARGMACH} -Dos_${TARGOS}
-CPPFLAGS+= -I${.CURDIR} -I${.CURDIR}/..
+CPPFLAGS+=	-DLIBEXECDIR=\"${libexecdir}/\"
+CPPFLAGS+=	-DINCLUDEDIR=\"${includedir}/\"
+CPPFLAGS+=	-Dos_${TARGOS}
+CPPFLAGS+=	-Dmach_${TARGMACH}
+CPPFLAGS+=	-I${PCC_DIR}
 
 .if exists(${.CURDIR}/../../../Makefile.inc)
 .include "${.CURDIR}/../../../Makefile.inc"

Index: src/external/bsd/pcc/lib/Makefile
diff -u src/external/bsd/pcc/lib/Makefile:1.1 src/external/bsd/pcc/lib/Makefile:1.2
--- src/external/bsd/pcc/lib/Makefile:1.1	Sun Aug 24 05:47:05 2008
+++ src/external/bsd/pcc/lib/Makefile	Wed Jan 20 11:45:55 2010
@@ -1,6 +1,5 @@
-#	$NetBSD: Makefile,v 1.1 2008/08/24 05:47:05 gmcgarry Exp $
+#	$NetBSD: Makefile,v 1.2 2010/01/20 11:45:55 plunky Exp $
 
 SUBDIR=		crtstuff libpcc
 
 .include <bsd.subdir.mk>
-

Index: src/external/bsd/pcc/lib/crtstuff/Makefile
diff -u src/external/bsd/pcc/lib/crtstuff/Makefile:1.1 src/external/bsd/pcc/lib/crtstuff/Makefile:1.2
--- src/external/bsd/pcc/lib/crtstuff/Makefile:1.1	Sun Aug 24 05:47:05 2008
+++ src/external/bsd/pcc/lib/crtstuff/Makefile	Wed Jan 20 11:45:55 2010
@@ -1,18 +1,15 @@
-#	$NetBSD: Makefile,v 1.1 2008/08/24 05:47:05 gmcgarry Exp $
+#	$NetBSD: Makefile,v 1.2 2010/01/20 11:45:55 plunky Exp $
 
-.include <bsd.own.mk>
+.include <bsd.init.mk>
 
-DIST=   ${NETBSDSRCDIR}/external/bsd/pcc/dist/pcc-libs
-SUBDIST=${DIST}/csu/netbsd
-.PATH:  ${SUBDIST}
-
-#CPPFLAGS+=-I${SUBDIST}
-
-#.include "../../Makefile.inc"
+.PATH: ${PCC_LIBS}/csu/${TARGOS}
 
 SRCS+=		crtbegin.c crtend.c
 OBJS+=		crtbegin.o crtend.o
 
+CPPFLAGS+=	-I${PCC_LIBS}/csu/${TARGOS}
+CPPFLAGS+=	-Wno-missing-prototypes
+
 realall: ${OBJS}
 
 crtbegin.o: crtbegin.c

Index: src/external/bsd/pcc/lib/libpcc/Makefile
diff -u src/external/bsd/pcc/lib/libpcc/Makefile:1.2 src/external/bsd/pcc/lib/libpcc/Makefile:1.3
--- src/external/bsd/pcc/lib/libpcc/Makefile:1.2	Fri Sep  4 00:50:05 2009
+++ src/external/bsd/pcc/lib/libpcc/Makefile	Wed Jan 20 11:45:55 2010
@@ -1,16 +1,8 @@
-#	$NetBSD: Makefile,v 1.2 2009/09/04 00:50:05 gmcgarry Exp $
+#	$NetBSD: Makefile,v 1.3 2010/01/20 11:45:55 plunky Exp $
 
-.include <bsd.own.mk>
+.include <bsd.init.mk>
 
-USE_FORT?= no
-
-DIST=	${NETBSDSRCDIR}/external/bsd/pcc/dist/pcc-libs
-SUBDIST=${DIST}/libpcc
-.PATH:	${SUBDIST}
-
-CPPFLAGS+=-I${.CURDIR}/../..
-CPPFLAGS+=-I${SUBDIST}/arch/${TARGMACH}
-CPPFLAGS+=-I${DESTDIR}/usr/include
+.PATH:	${PCC_LIBS}/libpcc
 
 LIB=	pcc
 
@@ -21,6 +13,6 @@
 SRCS+=	ashldi3.c ashrdi3.c lshrdi3.c
 SRCS+=	ssp.c
 
-.include "../../Makefile.inc"
+COPTS.ssp.c+=	-Wno-error
 
 .include <bsd.lib.mk>

Index: src/external/bsd/pcc/libexec/Makefile
diff -u src/external/bsd/pcc/libexec/Makefile:1.1 src/external/bsd/pcc/libexec/Makefile:1.2
--- src/external/bsd/pcc/libexec/Makefile:1.1	Sun Aug 24 05:47:05 2008
+++ src/external/bsd/pcc/libexec/Makefile	Wed Jan 20 11:45:55 2010
@@ -1,6 +1,5 @@
-#	$NetBSD: Makefile,v 1.1 2008/08/24 05:47:05 gmcgarry Exp $
+#	$NetBSD: Makefile,v 1.2 2010/01/20 11:45:55 plunky Exp $
 
-SUBDIR=		cpp ccom
+SUBDIR=		ccom cpp
 
 .include <bsd.subdir.mk>
-

Index: src/external/bsd/pcc/libexec/ccom/Makefile
diff -u src/external/bsd/pcc/libexec/ccom/Makefile:1.3 src/external/bsd/pcc/libexec/ccom/Makefile:1.4
--- src/external/bsd/pcc/libexec/ccom/Makefile:1.3	Fri Sep  4 00:50:05 2009
+++ src/external/bsd/pcc/libexec/ccom/Makefile	Wed Jan 20 11:45:55 2010
@@ -1,49 +1,43 @@
-#	$NetBSD: Makefile,v 1.3 2009/09/04 00:50:05 gmcgarry Exp $
+#	$NetBSD: Makefile,v 1.4 2010/01/20 11:45:55 plunky Exp $
 
-.include <bsd.own.mk>
+.include <bsd.init.mk>
 
-# USE_FORT?= yes
-
-DIST=	${NETBSDSRCDIR}/external/bsd/pcc/dist/pcc
-SUBDIST=${DIST}/cc/ccom
+.PATH:	${PCC_DIST}/cc/ccom \
+	${PCC_DIST}/arch/${TARGMACH} \
+	${PCC_DIST}/mip
 
 PROG=	ccom
+
 SRCS=   cgram.y
-SRCS+=  optim.c pftn.c scan.c trees.c inline.c symtabs.c
-SRCS+=	gcc_compat.c init.c local.c code.c stabs.c match.c reader.c optim2.c
-SRCS+=	regs.c local2.c order.c table.c common.c main.c external.c
+SRCS+=	scan.l
+SRCS+=	optim.c pftn.c trees.c inline.c symtabs.c
+SRCS+=	gcc_compat.c init.c local.c code.c stabs.c
+SRCS+=	match.c reader.c optim2.c regs.c local2.c order.c table.c
+SRCS+=	common.c main.c external.c
 
 MAN=    ccom.1
 
-BINDIR= /usr/libexec
+# generate cgram.h
+YHEADER=
 
-CPPFLAGS+=	-I${SUBDIST} -I${.CURDIR} -I${DIST}/mip
-CPPFLAGS+=	-I${.CURDIR}/../..
+CPPFLAGS+=	-DPCC_DEBUG
+CPPFLAGS+=	-DGCC_COMPAT
 CPPFLAGS+=	-I${.OBJDIR}
-CPPFLAGS+=	-DPCC_DEBUG -DGCC_COMPAT
-YFLAGS+=	-d
-
-COPTS.scan.c += -Wno-error
-
-DPSRCS=	external.h
-
-CLEANFILES+=	external.h external.c ccom.cat1 cgram.h mkext scan.c
-CLEANFILES+=    ccom.cat1
-
+CPPFLAGS+=	-I${PCC_DIST}/mip
+CPPFLAGS+=	-I${PCC_DIST}/os/${TARGOS}
+CPPFLAGS+=	-I${PCC_DIST}/arch/${TARGMACH}
+CPPFLAGS+=	-I${PCC_DIST}/cc/ccom
+
+COPTS.scan.c+= -Wno-error
+COPTS.cgram.c+=-Wno-uninitialized
+COPTS.local.c+=-Wno-unused
 
-.include "../../Makefile.inc"
+DPSRCS=	external.c external.h
 
-trees.c: pass2.h
-
-pass2.h: external.h
+external.c external.h: mkext.c table.c common.c
+	${HOST_CC} ${CFLAGS} ${CPPFLAGS} -DMKEXT -o ${.OBJDIR}/mkext ${.ALLSRC}
+	${.OBJDIR}/mkext
 
-optim2.o reader.o: external.h
+CLEANFILES+=	external.c external.h mkext
 
 .include <bsd.prog.mk>
-
-.PATH:	${SUBDIST} ${MIPDIR} ${MDIR}
-
-external.h external.c: ${MIPDIR}/mkext.c $(MDIR)/table.c
-	$(HOST_CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -DMKEXT -o ${.OBJDIR}/mkext ${MIPDIR}/mkext.c \
-	$(MDIR)/table.c ${MIPDIR}/common.c
-	${.OBJDIR}/mkext

Index: src/external/bsd/pcc/libexec/cpp/Makefile
diff -u src/external/bsd/pcc/libexec/cpp/Makefile:1.3 src/external/bsd/pcc/libexec/cpp/Makefile:1.4
--- src/external/bsd/pcc/libexec/cpp/Makefile:1.3	Fri Sep  4 00:50:06 2009
+++ src/external/bsd/pcc/libexec/cpp/Makefile	Wed Jan 20 11:45:55 2010
@@ -1,32 +1,31 @@
-#	$NetBSD: Makefile,v 1.3 2009/09/04 00:50:06 gmcgarry Exp $
+#	$NetBSD: Makefile,v 1.4 2010/01/20 11:45:55 plunky Exp $
 
-.include <bsd.own.mk>
+.include <bsd.init.mk>
 
-# USE_FORT?= yes
-
-DIST=	${NETBSDSRCDIR}/external/bsd/pcc/dist/pcc
-SUBDIST=${DIST}/cc/cpp
-.PATH:	${SUBDIST}
+.PATH:	${PCC_DIST}/cc/cpp \
+	${PCC_DIST}/mip
 
 PROG=	cpp
-SRCS=   cpy.y cpp.c token.c
 
-MAN=    cpp.1
+SRCS=	cpy.y
+SRCS+=	cpp.c token.c
 
-BINDIR= /usr/libexec
+MAN=	cpp.1
 
-YFLAGS+=	-d
-CPPFLAGS+=	-I${DIST}/cc/cpp -I${.CURDIR} -I${DIST} -I${DIST}/mip
-CPPFLAGS+=	-I${.CURDIR}/../..
-CPPFLAGS+=	-I${.OBJDIR}
 CPPFLAGS+=	-DCPP_DEBUG
+CPPFLAGS+=	-I${.OBJDIR}
+CPPFLAGS+=	-I${PCC_DIST}/mip
+CPPFLAGS+=	-I${PCC_DIST}/cc/cpp
+
+# generate cpy.h
+YHEADER=
+
+# some files include y.tab.h instead
+DPSRCS=		y.tab.h
 
-CLEANFILES+=	lex.yy.c y.tab.h cpp.cat1 scanner.c
-CLEANFILES+=    cpp.cat1
+y.tab.h:	cpy.h
+	${HOST_LN} -f ${.ALLSRC} ${.TARGET}
 
-# scanner.l expects to include y.tab.h
-cpy.c: cpy.y
-	${YACC} ${YFLAGS} -o ${.TARGET} ${.ALLSRC}
-	mv cpy.h y.tab.h
+CLEANFILES+=	y.tab.h
 
 .include <bsd.prog.mk>

Index: src/external/bsd/pcc/usr.bin/pcc/Makefile
diff -u src/external/bsd/pcc/usr.bin/pcc/Makefile:1.1 src/external/bsd/pcc/usr.bin/pcc/Makefile:1.2
--- src/external/bsd/pcc/usr.bin/pcc/Makefile:1.1	Sun Aug 24 05:47:05 2008
+++ src/external/bsd/pcc/usr.bin/pcc/Makefile	Wed Jan 20 11:45:55 2010
@@ -1,25 +1,23 @@
-#	$NetBSD: Makefile,v 1.1 2008/08/24 05:47:05 gmcgarry Exp $
+#	$NetBSD: Makefile,v 1.2 2010/01/20 11:45:55 plunky Exp $
 
-.include <bsd.own.mk>
+.include <bsd.init.mk>
 
-USE_FORT?= yes
+.PATH: ${PCC_DIST}/cc/cc
 
-DIST=	${NETBSDSRCDIR}/external/bsd/pcc/dist/pcc
-SUBDIST=${DIST}/cc/cc
-.PATH:	${SUBDIST}
-
-CPPFLAGS+=-I${.CURDIR}/../..
-CPPFLAGS+=-I${DIST}/mip
+#
+# we build PCC cc(1) as pcc(1) to avoid conflicts with GCC
+#
 
 PROG=	pcc
 SRCS=	cc.c
+MAN=	pcc.1
 
-BINDIR= /usr/bin
-
-MAN=	cc.1
+CPPFLAGS+=	-I${PCC_DIST}/mip
+CPPFLAGS+=	-I${PCC_DIST}/os/${TARGOS}
 
-CLEANFILES+=	cc.cat1
+pcc.1:	cc.1
+	${TOOL_SED} -e "s,Nm cc,Nm pcc," -e "s,Dt CC,Dt PCC," ${.ALLSRC} > ${.TARGET}
 
-.include "../../Makefile.inc"
+CLEANFILES+=	pcc.1
 
 .include <bsd.prog.mk>

Added files:

Index: src/external/bsd/pcc/lib/Makefile.inc
diff -u /dev/null src/external/bsd/pcc/lib/Makefile.inc:1.1
--- /dev/null	Wed Jan 20 11:45:55 2010
+++ src/external/bsd/pcc/lib/Makefile.inc	Wed Jan 20 11:45:55 2010
@@ -0,0 +1,7 @@
+#	$NetBSD: Makefile.inc,v 1.1 2010/01/20 11:45:55 plunky Exp $
+
+.include "../Makefile.inc"
+
+.if exists("../../../../lib/Makefile.inc")
+.include "../../../../lib/Makefile.inc"
+.endif

Index: src/external/bsd/pcc/libexec/Makefile.inc
diff -u /dev/null src/external/bsd/pcc/libexec/Makefile.inc:1.1
--- /dev/null	Wed Jan 20 11:45:56 2010
+++ src/external/bsd/pcc/libexec/Makefile.inc	Wed Jan 20 11:45:55 2010
@@ -0,0 +1,7 @@
+#	$NetBSD: Makefile.inc,v 1.1 2010/01/20 11:45:55 plunky Exp $
+
+.include "../Makefile.inc"
+
+.if exists("../../../../libexec/Makefile.inc")
+.include "../../../../libexec/Makefile.inc"
+.endif

Index: src/external/bsd/pcc/usr.bin/Makefile.inc
diff -u /dev/null src/external/bsd/pcc/usr.bin/Makefile.inc:1.1
--- /dev/null	Wed Jan 20 11:45:56 2010
+++ src/external/bsd/pcc/usr.bin/Makefile.inc	Wed Jan 20 11:45:55 2010
@@ -0,0 +1,7 @@
+#	$NetBSD: Makefile.inc,v 1.1 2010/01/20 11:45:55 plunky Exp $
+
+.include "../Makefile.inc"
+
+.if exists("../../../../usr.bin/Makefile.inc")
+.include "../../../../usr.bin/Makefile.inc"
+.endif

Reply via email to