freebsd-dev/lib/libthr/support/Makefile.inc
Warner Losh 10f3ae5899 Merge from tbemd, with a small amount of rework:
For all libthr contexts, use ${MACHINE_CPUARCH}
for all libc contexts, use ${MACHINE_ARCH} if it exists, otherwise use
${MACHINE_CPUARCH}
Move some common code up a layer (the .PATH statement was the same in
all the arch submakefiles).

# Hope she hasn't busted powerpc64 with this...
2010-09-13 01:43:10 +00:00

30 lines
821 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/$/.So/}
${SYSCALL_SRC}:
printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' > ${.TARGET}
LIBC_OBJS=
SOBJS+= thr_libc.So
CLEANFILES+= ${SYSCALL_SRC} ${SYSCALL_OBJ} ${LIBC_OBJS}
thr_libc.So: ${SYSCALL_OBJ} ${LIBC_OBJS}
${CC} -fPIC -nostdlib -o ${.TARGET} -r ${.ALLSRC}