diff --git a/usr.bin/pcc/Makefile b/usr.bin/pcc/Makefile new file mode 100644 index 000000000000..a0a255f452c4 --- /dev/null +++ b/usr.bin/pcc/Makefile @@ -0,0 +1,5 @@ +# $NetBSD: Makefile,v 1.1 2007/09/21 21:10:54 abs Exp $ + +SUBDIR=cc + +.include diff --git a/usr.bin/pcc/cc/Makefile b/usr.bin/pcc/cc/Makefile new file mode 100644 index 000000000000..352f85b2c016 --- /dev/null +++ b/usr.bin/pcc/cc/Makefile @@ -0,0 +1,5 @@ +# $NetBSD: Makefile,v 1.1 2007/09/21 21:10:55 abs Exp $ + +SUBDIR=cc cpp ccom + +.include diff --git a/usr.bin/pcc/cc/Makefile.inc b/usr.bin/pcc/cc/Makefile.inc new file mode 100644 index 000000000000..babad43f4ecc --- /dev/null +++ b/usr.bin/pcc/cc/Makefile.inc @@ -0,0 +1,22 @@ +# $NetBSD: Makefile.inc,v 1.1 2007/09/21 21:10:55 abs Exp $ + +MDIR= ${DIST}/arch/${TARGMACH} +MIPDIR= ${DIST}/mip + +TARGOS = netbsd +# XXX Currently only handles x86 (i386) +.if ${MACHINE_ARCH} == "i386" +TARGMACH = x86 +.elif ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" +TARGMACH = mips +.elif ${MACHINE_ARCH} == "vax" +TARGMACH = vax +.else +ERROR!= echo "ERROR: ${MACHINE_ARCH} not yet supported - write code!" >&2;echo +.endif + +libexecdir = ${DESTDIR}/usr/libexec +includedir = ${DESTDIR}/usr/include + +CPPFLAGS+= -DLIBEXECDIR=\"${libexecdir}\" -DINCLUDEDIR=\"${includedir}\" +CPPFLAGS+= -I${DIST}/os/${TARGOS} -I${MDIR} -Dmach_${TARGMACH} -Dos_${TARGOS} diff --git a/usr.bin/pcc/cc/cc/Makefile b/usr.bin/pcc/cc/cc/Makefile new file mode 100644 index 000000000000..88d72c191bff --- /dev/null +++ b/usr.bin/pcc/cc/cc/Makefile @@ -0,0 +1,18 @@ +# $NetBSD: Makefile,v 1.1 2007/09/21 21:10:55 abs Exp $ + +.include + +USE_FORT?= yes + +DIST= ${NETBSDSRCDIR}/dist/pcc +SUBDIST=${DIST}/cc/cc +.PATH: ${SUBDIST} + +PROG= pcc +SRCS= cc.c + +MAN= cc.1 + +CLEANFILES+= cc.cat1 + +.include diff --git a/usr.bin/pcc/cc/ccom/Makefile b/usr.bin/pcc/cc/ccom/Makefile new file mode 100644 index 000000000000..840cc1c125d7 --- /dev/null +++ b/usr.bin/pcc/cc/ccom/Makefile @@ -0,0 +1,37 @@ +# $NetBSD: Makefile,v 1.1 2007/09/21 21:10:55 abs Exp $ + +.include + +# USE_FORT?= yes + +DIST= ${NETBSDSRCDIR}/dist/pcc +SUBDIST=${DIST}/cc/ccom + +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 + +BINDIR= /usr/libexec + +CPPFLAGS+= -I${SUBDIST} -I${.CURDIR} -I${DIST}/mip +CPPFLAGS+= -DPCC_DEBUG -DGCC_COMPAT +YFLAGS+= -d + +CLEANFILES+= external.h external.c ccom.cat1 cgram.h mkext + +trees.c: pass2.h + +pass2.h: external.h + +optim2.o reader.o: external.h + +.include + +.PATH: ${SUBDIST} ${MIPDIR} ${MDIR} + +external.h external.c: ${MIPDIR}/mkext.c $(MDIR)/table.c + $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -DMKEXT -o mkext ${MIPDIR}/mkext.c \ + $(MDIR)/table.c ${MIPDIR}/common.c + ./mkext diff --git a/usr.bin/pcc/cc/cpp/Makefile b/usr.bin/pcc/cc/cpp/Makefile new file mode 100644 index 000000000000..4476d02aa475 --- /dev/null +++ b/usr.bin/pcc/cc/cpp/Makefile @@ -0,0 +1,27 @@ +# $NetBSD: Makefile,v 1.1 2007/09/21 21:10:55 abs Exp $ + +.include + +# USE_FORT?= yes + +DIST= ${NETBSDSRCDIR}/dist/pcc +SUBDIST=${DIST}/cc/cpp +.PATH: ${SUBDIST} + +PROG= cpp +SRCS= cpy.y scanner.c cpp.c + +BINDIR= /usr/libexec + +YFLAGS+= -d +CPPFLAGS+= -I${DIST}/cc/cpp -I${.CURDIR} +CPPFLAGS+= -DCPP_DEBUG + +CLEANFILES+= lex.yy.c y.tab.h cpp.cat1 + +# scanner.l expects to include y.tab.h +cpy.c: cpy.y + ${YACC} ${YFLAGS} -o ${.TARGET} ${.ALLSRC} + mv cpy.h y.tab.h + +.include