build: make and install libucontext_posix
parent
ed1e5752fc
commit
2688747f8a
27
Makefile
27
Makefile
|
@ -39,8 +39,27 @@ LIBUCONTEXT_HEADERS = \
|
||||||
include/libucontext/bits.h
|
include/libucontext/bits.h
|
||||||
LIBUCONTEXT_EXAMPLES = \
|
LIBUCONTEXT_EXAMPLES = \
|
||||||
examples/cooperative_threading
|
examples/cooperative_threading
|
||||||
|
LIBUCONTEXT_POSIX_NAME = libucontext_posix.so
|
||||||
|
LIBUCONTEXT_POSIX_STATIC_NAME = libucontext_posix.a
|
||||||
|
LIBUCONTEXT_POSIX_C_SRC = libucontext_posix.c
|
||||||
|
LIBUCONTEXT_POSIX_OBJ = ${LIBUCONTEXT_POSIX_C_SRC:.c=.o}
|
||||||
|
LIBUCONTEXT_POSIX_SONAME = libucontext_posix.so.${LIBUCONTEXT_SOVERSION}
|
||||||
|
LIBUCONTEXT_POSIX_PATH = ${LIBDIR}/${LIBUCONTEXT_POSIX_SONAME}
|
||||||
|
LIBUCONTEXT_POSIX_STATIC_PATH = ${LIBDIR}/${LIBUCONTEXT_POSIX_STATIC_NAME}
|
||||||
|
|
||||||
all: ${LIBUCONTEXT_SONAME} ${LIBUCONTEXT_STATIC_NAME} ${LIBUCONTEXT_PC}
|
ifeq ($(FREESTANDING),yes)
|
||||||
|
LIBUCONTEXT_POSIX_NAME =
|
||||||
|
LIBUCONTEXT_POSIX_STATIC_NAME =
|
||||||
|
endif
|
||||||
|
|
||||||
|
all: ${LIBUCONTEXT_SONAME} ${LIBUCONTEXT_STATIC_NAME} ${LIBUCONTEXT_POSIX_NAME} ${LIBUCONTEXT_POSIX_STATIC_NAME} ${LIBUCONTEXT_PC}
|
||||||
|
|
||||||
|
${LIBUCONTEXT_POSIX_NAME}: ${LIBUCONTEXT_NAME} ${LIBUCONTEXT_POSIX_OBJ}
|
||||||
|
$(CC) -fPIC -o ${LIBUCONTEXT_POSIX_NAME} -Wl,-soname,${LIBUCONTEXT_POSIX_SONAME} \
|
||||||
|
-shared ${LIBUCONTEXT_POSIX_OBJ} ${LDFLAGS}
|
||||||
|
|
||||||
|
${LIBUCONTEXT_POSIX_STATIC_NAME}: ${LIBUCONTEXT_POSIX_OBJ}
|
||||||
|
$(AR) rcs ${LIBUCONTEXT_POSIX_STATIC_NAME} ${LIBUCONTEXT_POSIX_OBJ}
|
||||||
|
|
||||||
${LIBUCONTEXT_STATIC_NAME}: ${LIBUCONTEXT_OBJ}
|
${LIBUCONTEXT_STATIC_NAME}: ${LIBUCONTEXT_OBJ}
|
||||||
$(AR) rcs ${LIBUCONTEXT_STATIC_NAME} ${LIBUCONTEXT_OBJ}
|
$(AR) rcs ${LIBUCONTEXT_STATIC_NAME} ${LIBUCONTEXT_OBJ}
|
||||||
|
@ -81,7 +100,7 @@ docs: ${MANPAGES}
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f ${LIBUCONTEXT_NAME} ${LIBUCONTEXT_SONAME} ${LIBUCONTEXT_STATIC_NAME} \
|
rm -f ${LIBUCONTEXT_NAME} ${LIBUCONTEXT_SONAME} ${LIBUCONTEXT_STATIC_NAME} \
|
||||||
${LIBUCONTEXT_OBJ} ${LIBUCONTEXT_PC} \
|
${LIBUCONTEXT_OBJ} ${LIBUCONTEXT_PC} ${LIBUCONTEXT_POSIX_NAME} ${LIBUCONTEXT_POSIX_STATIC_NAME} \
|
||||||
include/libucontext/bits.h test_libucontext ${MANPAGES}
|
include/libucontext/bits.h test_libucontext ${MANPAGES}
|
||||||
|
|
||||||
install: all
|
install: all
|
||||||
|
@ -93,6 +112,10 @@ install: all
|
||||||
install -D -m644 $$i ${DESTDIR}${INCLUDEDIR}/$$destfn; \
|
install -D -m644 $$i ${DESTDIR}${INCLUDEDIR}/$$destfn; \
|
||||||
done
|
done
|
||||||
install -D -m644 ${LIBUCONTEXT_PC} ${DESTDIR}${PKGCONFIGDIR}/${LIBUCONTEXT_PC}
|
install -D -m644 ${LIBUCONTEXT_PC} ${DESTDIR}${PKGCONFIGDIR}/${LIBUCONTEXT_PC}
|
||||||
|
if [ -n ${LIBUCONTEXT_POSIX_NAME} ]; then \
|
||||||
|
install -D -m755 ${LIBUCONTEXT_POSIX_NAME} ${DESTDIR}${LIBUCONTEXT_POSIX_PATH}; \
|
||||||
|
install -D -m644 ${LIBUCONTEXT_STATIC_POSIX_NAME} ${DESTDIR}${LIBUCONTEXT_STATIC_POSIX_PATH}; \
|
||||||
|
fi
|
||||||
|
|
||||||
install_docs: docs
|
install_docs: docs
|
||||||
install -D -m644 doc/libucontext.3 ${DESTDIR}/usr/share/man/man3/libucontext.3
|
install -D -m644 doc/libucontext.3 ${DESTDIR}/usr/share/man/man3/libucontext.3
|
||||||
|
|
Loading…
Reference in New Issue