From 2b6d446becdb7059074ec7aa9f83fcfd3f9fa1db Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 19 Feb 2022 22:44:12 +0100 Subject: Improve new-c-proj MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- base/new-c-proj | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'base/new-c-proj') diff --git a/base/new-c-proj b/base/new-c-proj index 982144f..48f8d83 100755 --- a/base/new-c-proj +++ b/base/new-c-proj @@ -106,6 +106,7 @@ if printf '%s\n' "$1" | grep '^lib' >/dev/null 2>/dev/null; then $1.a: \$(OBJ) x @rm -f -- \$@ x \$(AR) rc \$@ \$(OBJ) + x \$(AR) ts \$@ > /dev/null $1.\$(LIBEXT): \$(LOBJ) x \$(CC) \$(LIBFLAGS) -o \$@ \$(LOBJ) \$(LDFLAGS) @@ -115,6 +116,7 @@ if printf '%s\n' "$1" | grep '^lib' >/dev/null 2>/dev/null; then x mkdir -p -- "\$(DESTDIR)\$(PREFIX)/include" x cp -- $1.a "\$(DESTDIR)\$(PREFIX)/lib/" x cp -- $1.\$(LIBEXT) "\$(DESTDIR)\$(PREFIX)/lib/$1.\$(LIBMINOREXT)" + x \$(FIX_INSTALL_NAME) "\$(DESTDIR)\$(PREFIX)/lib/$1.\$(LIBMINOREXT)" x ln -sf -- $1.\$(LIBMINOREXT) "\$(DESTDIR)\$(PREFIX)/lib/$1.\$(LIBMAJOREXT)" x ln -sf -- $1.\$(LIBMAJOREXT) "\$(DESTDIR)\$(PREFIX)/lib/$1.\$(LIBEXT)" x cp -- $1.h "\$(DESTDIR)\$(PREFIX)/include/" @@ -141,6 +143,8 @@ if printf '%s\n' "$1" | grep '^lib' >/dev/null 2>/dev/null; then LIBFLAGS = -shared -Wl,-soname,lib\$(LIB_NAME).\$(LIBEXT).\$(LIB_MAJOR) LIBMAJOREXT = \$(LIBEXT).\$(LIB_MAJOR) LIBMINOREXT = \$(LIBEXT).\$(LIB_VERSION) + + FIX_INSTALL_NAME = : EOF cat <<-EOF | sed 's/x\t/\t/g' > mk/macos.mk @@ -148,13 +152,17 @@ if printf '%s\n' "$1" | grep '^lib' >/dev/null 2>/dev/null; then LIBFLAGS = -dynamiclib -Wl,-compatibility_version,\$(LIB_MAJOR) -Wl,-current_version,\$(LIB_VERSION) LIBMAJOREXT = \$(LIB_MAJOR).\$(LIBEXT) LIBMINOREXT = \$(LIB_VERSION).\$(LIBEXT) + + FIX_INSTALL_NAME = install_name_tool -id "\$(PREFIX)/lib/$1.\$(LIBMAJOREXT)" EOF cat <<-EOF | sed 's/x\t/\t/g' > mk/windows.mk LIBEXT = dll - LIBFLAGS = -mdll + LIBFLAGS = -shared LIBMAJOREXT = \$(LIB_MAJOR).\$(LIBEXT) LIBMINOREXT = \$(LIB_VERSION).\$(LIBEXT) + + FIX_INSTALL_NAME = : EOF else printf '%s\n' "/$1" >> .gitignore -- cgit v1.2.3-70-g09d2