Makefile: Handle static library at clean/install

pull/14/head
Gabriel Ivașcu 2019-04-12 10:48:24 +03:00
parent 05cb8ecbee
commit 2e15b38327
2 changed files with 5 additions and 1 deletions

1
.gitignore vendored
View File

@ -34,5 +34,6 @@ Makefile.in
*.o *.o
test_libucontext test_libucontext
libucontext.a
libucontext.so libucontext.so
libucontext.so.* libucontext.so.*

View File

@ -11,6 +11,7 @@ LIBUCONTEXT_NAME = libucontext.so
LIBUCONTEXT_STATIC_NAME = libucontext.a LIBUCONTEXT_STATIC_NAME = libucontext.a
LIBUCONTEXT_SONAME = libucontext.so.${LIBUCONTEXT_SOVERSION} LIBUCONTEXT_SONAME = libucontext.so.${LIBUCONTEXT_SOVERSION}
LIBUCONTEXT_PATH = /lib/${LIBUCONTEXT_SONAME} LIBUCONTEXT_PATH = /lib/${LIBUCONTEXT_SONAME}
LIBUCONTEXT_STATIC_PATH = /lib/${LIBUCONTEXT_STATIC_NAME}
all: ${LIBUCONTEXT_SONAME} ${LIBUCONTEXT_STATIC_NAME} all: ${LIBUCONTEXT_SONAME} ${LIBUCONTEXT_STATIC_NAME}
@ -31,10 +32,12 @@ ${LIBUCONTEXT_SONAME}: ${LIBUCONTEXT_NAME}
$(CC) -fPIC -DPIC ${CFLAGS} ${CPPFLAGS} -c -o $@ $< $(CC) -fPIC -DPIC ${CFLAGS} ${CPPFLAGS} -c -o $@ $<
clean: clean:
rm -f ${LIBUCONTEXT_NAME} ${LIBUCONTEXT_SONAME} ${LIBUCONTEXT_OBJ} test_libucontext rm -f ${LIBUCONTEXT_NAME} ${LIBUCONTEXT_SONAME} ${LIBUCONTEXT_STATIC_NAME} \
${LIBUCONTEXT_OBJ} test_libucontext
install: all install: all
install -D -m755 ${LIBUCONTEXT_NAME} ${DESTDIR}/${LIBUCONTEXT_PATH} install -D -m755 ${LIBUCONTEXT_NAME} ${DESTDIR}/${LIBUCONTEXT_PATH}
install -D -m664 ${LIBUCONTEXT_STATIC_NAME} ${DESTDIR}/${LIBUCONTEXT_STATIC_PATH}
ln -sf ${LIBUCONTEXT_SONAME} ${DESTDIR}/lib/${LIBUCONTEXT_NAME} ln -sf ${LIBUCONTEXT_SONAME} ${DESTDIR}/lib/${LIBUCONTEXT_NAME}
check: test_libucontext ${LIBUCONTEXT_SONAME} check: test_libucontext ${LIBUCONTEXT_SONAME}