aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>2001-12-18 03:11:35 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2001-12-18 03:11:35 +0000
commit3a7789cfeb789b970a110eccac99ed93f00d0f38 (patch)
treeb747c102886286ebacc94616441fcde085ac1165 /gnu
parent1a2f149713e852ef5aa1d2e7162b2f4d5c72faca (diff)
Notes
Diffstat (limited to 'gnu')
-rw-r--r--gnu/lib/csu/Makefile89
-rw-r--r--gnu/usr.bin/cc/Makefile.inc58
-rw-r--r--gnu/usr.bin/cc/cc1obj/Makefile36
3 files changed, 183 insertions, 0 deletions
diff --git a/gnu/lib/csu/Makefile b/gnu/lib/csu/Makefile
new file mode 100644
index 000000000000..c3a3f3e152ed
--- /dev/null
+++ b/gnu/lib/csu/Makefile
@@ -0,0 +1,89 @@
+# $FreeBSD$
+
+GCCDIR= ${.CURDIR}/../../../contrib/gcc
+
+TARGET_ARCH?= ${MACHINE_ARCH}
+
+.if ${TARGET_ARCH} == "alpha"
+.PATH: ${GCCDIR}/config/alpha
+SRCS= crtbegin.s crtend.s
+UGLYHACK= -x assembler
+.else
+.PATH: ${GCCDIR}
+SRCS= crtstuff.c tm.h
+.endif
+
+OBJS= crtbegin.o crtend.o
+SOBJS= crtbegin.So crtend.So
+CFLAGS+= -I${GCCDIR}/config -I${GCCDIR} -I. \
+ -I${.CURDIR}/../../usr.bin/cc/cc_tools -I../../usr.bin/cc/cc_tools \
+ -DIN_GCC \
+ -finhibit-size-directive -fno-inline-functions \
+ -fno-exceptions -fno-omit-frame-pointer
+NOMAN= true
+NOPIC= true
+NOPROFILE= true
+INTERNALLIB= true
+CLEANFILES+= tm.h
+
+CRTS_CFLAGS= -DCRTSTUFFS_O ${PICFLAG}
+
+all: ${OBJS} ${SOBJS}
+
+.if ${TARGET_ARCH} == "alpha"
+crtbegin.o crtbegin.So: crtbegin.s
+crtend.o crtend.So: crtend.s
+.for PART in begin end
+CLEANFILES+= crt${PART}.s
+crt${PART}.s: crt${PART}.asm
+ ln -sf ${.ALLSRC} ${.TARGET}
+.endfor
+.else
+crtbegin.o crtbegin.So crtend.o crtend.So: crtstuff.c tm.h
+.endif
+
+crtbegin.o:
+ ${CC} ${CFLAGS} -g0 -DCRT_BEGIN \
+ -c -o ${.TARGET} ${UGLYHACK} ${.ALLSRC:N*.h}
+
+crtbegin.So:
+ ${CC} ${CFLAGS} -g0 -DCRT_BEGIN ${CRTS_CFLAGS} \
+ -c -o ${.TARGET} ${UGLYHACK} ${.ALLSRC:N*.h}
+
+crtend.o:
+ ${CC} ${CFLAGS} -g0 -DCRT_END \
+ -c -o ${.TARGET} ${UGLYHACK} ${.ALLSRC:N*.h}
+
+crtend.So:
+ ${CC} ${CFLAGS} -g0 -DCRT_END ${CRTS_CFLAGS} \
+ -c -o ${.TARGET} ${UGLYHACK} ${.ALLSRC:N*.h}
+
+# KEEP THIS IN SYNC with src/gnu/usr.bin/cc/cc_tools/Makefile !!
+tm.h:
+ echo '#include "gansidecl.h"' > ${.TARGET}
+ echo '#include "${MACHINE_ARCH}/${MACHINE_ARCH}.h"' >> ${.TARGET}
+.if ${MACHINE_ARCH} == "i386"
+ echo '#include "${MACHINE_ARCH}/att.h"' >> ${.TARGET}
+.endif
+ echo '#include <freebsd-native.h>' >> ${.TARGET}
+ echo '#include <freebsd.h>' >> ${.TARGET}
+.if exists(${MACHINE_ARCH}/config/${MACHINE_ARCH}/elf.h)
+ echo '#include "${MACHINE_ARCH}/elf.h"' >> ${.TARGET}
+.endif
+ echo '#include "${MACHINE_ARCH}/freebsd.h"' >> ${.TARGET}
+.if ${MACHINE_ARCH} == "i386"
+ echo '#include "${MACHINE_ARCH}/perform.h"' >> ${.TARGET}
+.endif
+ echo '#include "defaults.h"' >> ${.TARGET}
+ echo '#ifndef GENERATOR_FILE' >> ${.TARGET}
+ echo '#include "insn-codes.h"' >> ${.TARGET}
+ echo '#include "insn-flags.h"' >> ${.TARGET}
+ echo '#endif' >> ${.TARGET}
+
+realinstall:
+.for file in ${OBJS} ${SOBJS}
+ ${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+ ${file} ${DESTDIR}${LIBDIR}/${file:S/.So$/S.o/}
+.endfor
+
+.include <bsd.lib.mk>
diff --git a/gnu/usr.bin/cc/Makefile.inc b/gnu/usr.bin/cc/Makefile.inc
new file mode 100644
index 000000000000..97c0bb09b612
--- /dev/null
+++ b/gnu/usr.bin/cc/Makefile.inc
@@ -0,0 +1,58 @@
+# $FreeBSD$
+
+.include "../Makefile.inc"
+
+# Sometimes this is .include'd several times...
+.if !defined(GCCDIR)
+GCCDIR= ${.CURDIR}/../../../../contrib/gcc
+
+TARGET_ARCH?= ${MACHINE_ARCH}
+GCC_ARCH= ${TARGET_ARCH}
+
+# Machine description.
+MD_FILE= ${GCCDIR}/config/${GCC_ARCH}/${GCC_ARCH}.md
+OUT_FILE= ${GCC_ARCH}.c
+OUT_OBJ= ${GCC_ARCH}
+target= ${TARGET_ARCH}-unknown-freebsd
+
+version!= sed -n /version_string/p ${GCCDIR}/version.c | sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/'
+
+CFLAGS+= -DIN_GCC -DHAVE_CONFIG_H
+CFLAGS+= -DPREFIX=\"${TOOLS_PREFIX}/usr\"
+CFLAGS+= -DWANT_COMPILER_INVARIANTS
+
+# If building 64-bit longs for the i386, "_LARGE_LONG" should also be defined
+# to get the proper sizes in limits.h
+.if defined(LONG_TYPE_SIZE)
+CFLAGS+= -DLONG_TYPE_SIZE=${LONG_TYPE_SIZE}
+.endif
+
+.if ${TARGET_ARCH} != ${MACHINE_ARCH}
+CFLAGS+= -DCROSS_COMPILE
+.endif
+
+.if defined(WANT_FORCE_OPTIMIZATION_DOWNGRADE)
+CFLAGS+= -DFORCE_OPTIMIZATION_DOWNGRADE=${WANT_FORCE_OPTIMIZATION_DOWNGRADE}
+.endif
+
+.if exists(${.OBJDIR}/../cc_tools)
+CFLAGS+= -I${.OBJDIR}/../cc_tools
+.endif
+CFLAGS+= -I${.CURDIR}/../cc_tools
+# This must go after the -I for cc_tools to resolve ambiguities for hash.h
+# correctly.
+CFLAGS+= -I${GCCDIR} -I${GCCDIR}/config
+
+.if exists(${.OBJDIR}/../cc_fbsd)
+LIBCC_FBSD= ${.OBJDIR}/../cc_fbsd/libcc_fbsd.a
+.else
+LIBCC_FBSD= ${.CURDIR}/../cc_fbsd/libcc_fbsd.a
+.endif
+
+.if exists(${.OBJDIR}/../cc_int)
+LIBCC_INT= ${.OBJDIR}/../cc_int/libcc_int.a
+.else
+LIBCC_INT= ${.CURDIR}/../cc_int/libcc_int.a
+.endif
+
+.endif # !GCCDIR
diff --git a/gnu/usr.bin/cc/cc1obj/Makefile b/gnu/usr.bin/cc/cc1obj/Makefile
new file mode 100644
index 000000000000..dff38fb4b583
--- /dev/null
+++ b/gnu/usr.bin/cc/cc1obj/Makefile
@@ -0,0 +1,36 @@
+# $FreeBSD$
+
+.include "../Makefile.inc"
+
+.PATH: ../cc_tools ${GCCDIR}/objc ${GCCDIR}
+
+PROG= cc1obj
+SRCS= objc-parse.c objc-parse.h objc-parse.h objc-act.c
+# Ugh, compiled twice...
+SRCS+= c-decl.c c-lex.c c-typeck.c
+BINDIR= /usr/libexec
+NOMAN= 1
+NOSHARED=yes
+
+CFLAGS+= -I${GCCDIR}/objc -I.
+
+DPADD+= ${LIBCC_INT}
+LDADD+= ${LIBCC_INT}
+
+#-----------------------------------------------------------------------
+# objc parser
+.ORDER: objc-parse.c objc-parse.h
+objc-parse.c objc-parse.h: c-parse.in
+ sed -e "/^ifc$$/,/^end ifc$$/d" \
+ -e "/^ifobjc$$/d" -e "/^end ifobjc$$/d" \
+ ${GCCDIR}/c-parse.in > objc-parse.y
+ ${YACC} -d -o objc-parse.c objc-parse.y
+ ln -sf objc-parse.h c-parse.h
+ mv objc-parse.y objc-parse.y.out
+
+CLEANFILES+= objc-parse.c objc-parse.h c-parse.h \
+ objc-parse.y objc-parse.y.out # insurance
+
+#-----------------------------------------------------------------------
+
+.include <bsd.prog.mk>