17592f2cf9
build can break when different source files create the same target files (case-insensitivity speaking). This is the case for object files compiled with -fpic and shared libraries. The former uses an extension of ".So", and the latter an extension ".so". Rename shared object files from *.So to *.pico to match what NetBSD does. See also r305855 MFC after: 1 month Sponsored by: Bracket Computing Differential Revision: https://reviews.freebsd.org/D7906
30 lines
827 B
Makefile
30 lines
827 B
Makefile
# $FreeBSD$
|
|
|
|
.PATH: ${.CURDIR}/support ${.CURDIR}/../libc/gen ${.CURDIR}/../libc/string
|
|
|
|
# libc must search machine_arch, then machine_cpuarch, but libthr has all its
|
|
# code implemented in machine_cpuarch. Cope.
|
|
.if exists(${.CURDIR}/../libc/${MACHINE_ARCH}/sys)
|
|
.PATH: ${.CURDIR}/../libc/${MACHINE_ARCH}/sys
|
|
CFLAGS+= -I${.CURDIR}/../libc/${MACHINE_ARCH}
|
|
.else
|
|
.PATH: ${.CURDIR}/../libc/${MACHINE_CPUARCH}/sys
|
|
CFLAGS+= -I${.CURDIR}/../libc/${MACHINE_CPUARCH}
|
|
.endif
|
|
|
|
SYSCALLS= thr_new
|
|
|
|
SYSCALL_SRC= ${SYSCALLS:S/$/.S/}
|
|
SYSCALL_OBJ= ${SYSCALLS:S/$/.pico/}
|
|
|
|
${SYSCALL_SRC}:
|
|
printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' > ${.TARGET}
|
|
|
|
LIBC_OBJS=
|
|
|
|
SOBJS+= thr_libc.pico
|
|
CLEANFILES+= ${SYSCALL_SRC} ${SYSCALL_OBJ} ${LIBC_OBJS}
|
|
|
|
thr_libc.pico: ${SYSCALL_OBJ} ${LIBC_OBJS}
|
|
${CC} -fPIC -nostdlib -o ${.TARGET} -r ${.ALLSRC}
|