Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/pcc Clean up the build framework for pcc



details:   https://anonhg.NetBSD.org/src/rev/749ad40b38ed
branches:  trunk
changeset: 750973:749ad40b38ed
user:      plunky <plunky%NetBSD.org@localhost>
date:      Wed Jan 20 11:45:54 2010 +0000

description:
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

diffstat:

 external/bsd/pcc/Makefile              |   3 +-
 external/bsd/pcc/Makefile.inc          |  17 +++++---
 external/bsd/pcc/lib/Makefile          |   3 +-
 external/bsd/pcc/lib/Makefile.inc      |   7 +++
 external/bsd/pcc/lib/crtstuff/Makefile |  15 +++-----
 external/bsd/pcc/lib/libpcc/Makefile   |  16 ++------
 external/bsd/pcc/libexec/Makefile      |   5 +-
 external/bsd/pcc/libexec/Makefile.inc  |   7 +++
 external/bsd/pcc/libexec/ccom/Makefile |  60 +++++++++++++++------------------
 external/bsd/pcc/libexec/cpp/Makefile  |  39 ++++++++++-----------
 external/bsd/pcc/usr.bin/Makefile.inc  |   7 +++
 external/bsd/pcc/usr.bin/pcc/Makefile  |  26 ++++++-------
 12 files changed, 103 insertions(+), 102 deletions(-)

diffs (truncated from 336 to 300 lines):

diff -r 69030ac29a8c -r 749ad40b38ed external/bsd/pcc/Makefile
--- a/external/bsd/pcc/Makefile Wed Jan 20 10:33:08 2010 +0000
+++ b/external/bsd/pcc/Makefile Wed Jan 20 11:45:54 2010 +0000
@@ -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>
-
diff -r 69030ac29a8c -r 749ad40b38ed external/bsd/pcc/Makefile.inc
--- a/external/bsd/pcc/Makefile.inc     Wed Jan 20 10:33:08 2010 +0000
+++ b/external/bsd/pcc/Makefile.inc     Wed Jan 20 11:45:54 2010 +0000
@@ -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"
diff -r 69030ac29a8c -r 749ad40b38ed external/bsd/pcc/lib/Makefile
--- a/external/bsd/pcc/lib/Makefile     Wed Jan 20 10:33:08 2010 +0000
+++ b/external/bsd/pcc/lib/Makefile     Wed Jan 20 11:45:54 2010 +0000
@@ -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>
-
diff -r 69030ac29a8c -r 749ad40b38ed external/bsd/pcc/lib/Makefile.inc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/pcc/lib/Makefile.inc Wed Jan 20 11:45:54 2010 +0000
@@ -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
diff -r 69030ac29a8c -r 749ad40b38ed external/bsd/pcc/lib/crtstuff/Makefile
--- a/external/bsd/pcc/lib/crtstuff/Makefile    Wed Jan 20 10:33:08 2010 +0000
+++ b/external/bsd/pcc/lib/crtstuff/Makefile    Wed Jan 20 11:45:54 2010 +0000
@@ -1,18 +1,15 @@
-#      $NetBSD: Makefile,v 1.1 2008/08/24 05:47:05 gmcgarry Exp $
-
-.include <bsd.own.mk>
+#      $NetBSD: Makefile,v 1.2 2010/01/20 11:45:55 plunky Exp $
 
-DIST=   ${NETBSDSRCDIR}/external/bsd/pcc/dist/pcc-libs
-SUBDIST=${DIST}/csu/netbsd
-.PATH:  ${SUBDIST}
+.include <bsd.init.mk>
 
-#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
diff -r 69030ac29a8c -r 749ad40b38ed external/bsd/pcc/lib/libpcc/Makefile
--- a/external/bsd/pcc/lib/libpcc/Makefile      Wed Jan 20 10:33:08 2010 +0000
+++ b/external/bsd/pcc/lib/libpcc/Makefile      Wed Jan 20 11:45:54 2010 +0000
@@ -1,16 +1,8 @@
-#      $NetBSD: Makefile,v 1.2 2009/09/04 00:50:05 gmcgarry Exp $
-
-.include <bsd.own.mk>
-
-USE_FORT?= no
+#      $NetBSD: Makefile,v 1.3 2010/01/20 11:45:55 plunky Exp $
 
-DIST=  ${NETBSDSRCDIR}/external/bsd/pcc/dist/pcc-libs
-SUBDIST=${DIST}/libpcc
-.PATH: ${SUBDIST}
+.include <bsd.init.mk>
 
-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>
diff -r 69030ac29a8c -r 749ad40b38ed external/bsd/pcc/libexec/Makefile
--- a/external/bsd/pcc/libexec/Makefile Wed Jan 20 10:33:08 2010 +0000
+++ b/external/bsd/pcc/libexec/Makefile Wed Jan 20 11:45:54 2010 +0000
@@ -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>
-
diff -r 69030ac29a8c -r 749ad40b38ed external/bsd/pcc/libexec/Makefile.inc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/pcc/libexec/Makefile.inc     Wed Jan 20 11:45:54 2010 +0000
@@ -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
diff -r 69030ac29a8c -r 749ad40b38ed external/bsd/pcc/libexec/ccom/Makefile
--- a/external/bsd/pcc/libexec/ccom/Makefile    Wed Jan 20 10:33:08 2010 +0000
+++ b/external/bsd/pcc/libexec/ccom/Makefile    Wed Jan 20 11:45:54 2010 +0000
@@ -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
+CPPFLAGS+=     -I${PCC_DIST}/mip
+CPPFLAGS+=     -I${PCC_DIST}/os/${TARGOS}
+CPPFLAGS+=     -I${PCC_DIST}/arch/${TARGMACH}
+CPPFLAGS+=     -I${PCC_DIST}/cc/ccom
 
-CLEANFILES+=   external.h external.c ccom.cat1 cgram.h mkext scan.c
-CLEANFILES+=    ccom.cat1
+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
+external.c external.h: mkext.c table.c common.c
+       ${HOST_CC} ${CFLAGS} ${CPPFLAGS} -DMKEXT -o ${.OBJDIR}/mkext ${.ALLSRC}
+       ${.OBJDIR}/mkext
 
-pass2.h: external.h
-
-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
diff -r 69030ac29a8c -r 749ad40b38ed external/bsd/pcc/libexec/cpp/Makefile
--- a/external/bsd/pcc/libexec/cpp/Makefile     Wed Jan 20 10:33:08 2010 +0000
+++ b/external/bsd/pcc/libexec/cpp/Makefile     Wed Jan 20 11:45:54 2010 +0000
@@ -1,32 +1,31 @@
-#      $NetBSD: Makefile,v 1.3 2009/09/04 00:50:06 gmcgarry Exp $
-
-.include <bsd.own.mk>
+#      $NetBSD: Makefile,v 1.4 2010/01/20 11:45:55 plunky Exp $
 
-# USE_FORT?= yes
+.include <bsd.init.mk>
 
-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+=     -DCPP_DEBUG
 CPPFLAGS+=     -I${.OBJDIR}
-CPPFLAGS+=     -DCPP_DEBUG
+CPPFLAGS+=     -I${PCC_DIST}/mip
+CPPFLAGS+=     -I${PCC_DIST}/cc/cpp
 
-CLEANFILES+=   lex.yy.c y.tab.h cpp.cat1 scanner.c
-CLEANFILES+=    cpp.cat1
+# generate cpy.h
+YHEADER=
 
-# scanner.l expects to include y.tab.h
-cpy.c: cpy.y
-       ${YACC} ${YFLAGS} -o ${.TARGET} ${.ALLSRC}
-       mv cpy.h y.tab.h
+# some files include y.tab.h instead
+DPSRCS=                y.tab.h
+
+y.tab.h:       cpy.h
+       ${HOST_LN} -f ${.ALLSRC} ${.TARGET}
+
+CLEANFILES+=   y.tab.h
 
 .include <bsd.prog.mk>
diff -r 69030ac29a8c -r 749ad40b38ed external/bsd/pcc/usr.bin/Makefile.inc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/pcc/usr.bin/Makefile.inc     Wed Jan 20 11:45:54 2010 +0000
@@ -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
diff -r 69030ac29a8c -r 749ad40b38ed external/bsd/pcc/usr.bin/pcc/Makefile
--- a/external/bsd/pcc/usr.bin/pcc/Makefile     Wed Jan 20 10:33:08 2010 +0000
+++ b/external/bsd/pcc/usr.bin/pcc/Makefile     Wed Jan 20 11:45:54 2010 +0000
@@ -1,25 +1,23 @@
-#      $NetBSD: Makefile,v 1.1 2008/08/24 05:47:05 gmcgarry Exp $



Home | Main Index | Thread Index | Old Index