xref: /freebsd/lib/csu/powerpc64/Makefile (revision 23f6875a43f7ce365f2d52cf857da010c47fb03b)
1282e3762SNathan Whitehorn# $FreeBSD$
2282e3762SNathan Whitehorn
3*23f6875aSEnji Cooper.PATH: ${.CURDIR:H}/common
4282e3762SNathan Whitehorn
5282e3762SNathan WhitehornSRCS=		crt1.c crti.S crtn.S
6282e3762SNathan WhitehornOBJS=		${SRCS:N*.h:R:S/$/.o/g}
768a108e6SNathan WhitehornOBJS+=		Scrt1.o gcrt1.o
8*23f6875aSEnji CooperCFLAGS+=	-I${.CURDIR:H}/common \
9*23f6875aSEnji Cooper		-I${SRCTOP}/lib/libc/include \
10cce345c2SNathan Whitehorn		-mlongcall
11282e3762SNathan Whitehorn
124656c46dSJustin Hibbits# XXX: See the log for r232932 as to why the above -mlongcall is needed.  Since
134656c46dSJustin Hibbits# clang doesn't support -mlongcall, and testing shows a clang linked with a
144656c46dSJustin Hibbits# clang-built csu segfaults, this must currently be compiled with gcc.  Once
154656c46dSJustin Hibbits# clang supports -mlongcall, or we get a fixed ld, this can be revisited.
16de0fbc4dSBryan Drewery.include <bsd.compiler.mk>
17de0fbc4dSBryan Drewery.if ${COMPILER_TYPE} != "gcc"
1835eeaccaSJustin HibbitsCC:=		gcc
1935eeaccaSJustin HibbitsCOMPILER_TYPE:=	gcc
20de0fbc4dSBryan Drewery.endif
2135eeaccaSJustin Hibbits
225ca34122SBryan DreweryFILES=		${OBJS}
235ca34122SBryan DreweryFILESMODE=	${LIBMODE}
245ca34122SBryan DreweryFILESOWN=	${LIBOWN}
255ca34122SBryan DreweryFILESGRP=	${LIBGRP}
265ca34122SBryan DreweryFILESDIR=	${LIBDIR}
277c6cc9deSBryan Drewery# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY.
287c6cc9deSBryan Drewery.undef LIBRARIES_ONLY
29282e3762SNathan Whitehorn
30282e3762SNathan WhitehornCLEANFILES=	${OBJS}
3168a108e6SNathan WhitehornCLEANFILES+=	crt1.s gcrt1.s Scrt1.s
32282e3762SNathan Whitehorn
339ef4e3afSDimitry Andric# See the comment in lib/csu/common/crtbrand.c for the reason crt1.c is not
349ef4e3afSDimitry Andric# directly compiled to .o files.
359ef4e3afSDimitry Andric
369ef4e3afSDimitry Andriccrt1.s: crt1.c
379ef4e3afSDimitry Andric	${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c
38a22748dbSKonstantin Belousov	sed ${SED_FIX_NOTE} ${.TARGET}
399ef4e3afSDimitry Andric
409ef4e3afSDimitry Andriccrt1.o: crt1.s
41d2cc835cSDimitry Andric	${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s
429ef4e3afSDimitry Andric
439ef4e3afSDimitry Andricgcrt1.s: crt1.c
449ef4e3afSDimitry Andric	${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c
45a22748dbSKonstantin Belousov	sed ${SED_FIX_NOTE} ${.TARGET}
469ef4e3afSDimitry Andric
479ef4e3afSDimitry Andricgcrt1.o: gcrt1.s
48d2cc835cSDimitry Andric	${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s
49282e3762SNathan Whitehorn
5068a108e6SNathan WhitehornScrt1.s: crt1.c
5168a108e6SNathan Whitehorn	${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c
52a22748dbSKonstantin Belousov	sed ${SED_FIX_NOTE} ${.TARGET}
5368a108e6SNathan Whitehorn
5468a108e6SNathan WhitehornScrt1.o: Scrt1.s
55d2cc835cSDimitry Andric	${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s
5668a108e6SNathan Whitehorn
57282e3762SNathan Whitehorn.include <bsd.lib.mk>
58