summaryrefslogtreecommitdiffstats
path: root/lib/csu/arm/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csu/arm/Makefile')
-rw-r--r--lib/csu/arm/Makefile44
1 files changed, 44 insertions, 0 deletions
diff --git a/lib/csu/arm/Makefile b/lib/csu/arm/Makefile
new file mode 100644
index 0000000..095a9ad
--- /dev/null
+++ b/lib/csu/arm/Makefile
@@ -0,0 +1,44 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../common
+
+SRCS= crt1.c crti.S crtn.S
+OBJS= ${SRCS:N*.h:R:S/$/.o/g}
+OBJS+= Scrt1.o gcrt1.o
+CFLAGS+= -I${.CURDIR}/../common \
+ -I${.CURDIR}/../../libc/include
+
+all: ${OBJS}
+
+CLEANFILES= ${OBJS}
+CLEANFILES+= crt1.s gcrt1.s Scrt1.s
+
+# See the comment in lib/csu/common/crtbrand.c for the reason crt1.c is not
+# directly compiled to .o files.
+
+crt1.s: crt1.c
+ ${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c
+ sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET}
+
+crt1.o: crt1.s
+ ${CC} ${CFLAGS} -c -o ${.TARGET} crt1.s
+
+gcrt1.s: crt1.c
+ ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c
+ sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET}
+
+gcrt1.o: gcrt1.s
+ ${CC} ${CFLAGS} -c -o ${.TARGET} gcrt1.s
+
+Scrt1.s: crt1.c
+ ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c
+ sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET}
+
+Scrt1.o: Scrt1.s
+ ${CC} ${CFLAGS} -c -o ${.TARGET} Scrt1.s
+
+realinstall:
+ ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+ ${OBJS} ${DESTDIR}${LIBDIR}
+
+.include <bsd.lib.mk>
OpenPOWER on IntegriCloud