aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-02-19 22:44:26 +0100
committerMattias Andrée <maandree@kth.se>2022-02-19 22:44:26 +0100
commit98754c3900671f88f30f40eacf9a576adb037fb6 (patch)
tree53314fa37366d6ff80c17a9cf0fdf1c4d2a33505
parentFix union of overlapping charset subset ranges (diff)
downloadlibfonts-98754c3900671f88f30f40eacf9a576adb037fb6.tar.gz
libfonts-98754c3900671f88f30f40eacf9a576adb037fb6.tar.bz2
libfonts-98754c3900671f88f30f40eacf9a576adb037fb6.tar.xz
Improve makefile
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--Makefile2
-rw-r--r--config.mk4
-rw-r--r--mk/linux.mk2
-rw-r--r--mk/macos.mk4
-rw-r--r--mk/windows.mk4
5 files changed, 12 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 978519e..57da740 100644
--- a/Makefile
+++ b/Makefile
@@ -41,6 +41,7 @@ $(LOBJ): $(HDR)
libfonts.a: $(OBJ)
@rm -f -- $@
$(AR) rc $@ $(OBJ)
+ $(AR) ts $@ > /dev/null
libfonts.$(LIBEXT): $(LOBJ)
$(CC) $(LIBFLAGS) -o $@ $(LOBJ) $(LDFLAGS)
@@ -50,6 +51,7 @@ install: libfonts.a libfonts.$(LIBEXT)
mkdir -p -- "$(DESTDIR)$(PREFIX)/include"
cp -- libfonts.a "$(DESTDIR)$(PREFIX)/lib/"
cp -- libfonts.$(LIBEXT) "$(DESTDIR)$(PREFIX)/lib/libfonts.$(LIBMINOREXT)"
+ $(FIX_INSTALL_NAME) "$(DESTDIR)$(PREFIX)/lib/libfonts.$(LIBMINOREXT)"
ln -sf -- libfonts.$(LIBMINOREXT) "$(DESTDIR)$(PREFIX)/lib/libfonts.$(LIBMAJOREXT)"
ln -sf -- libfonts.$(LIBMAJOREXT) "$(DESTDIR)$(PREFIX)/lib/libfonts.$(LIBEXT)"
cp -- libfonts.h "$(DESTDIR)$(PREFIX)/include/"
diff --git a/config.mk b/config.mk
index 9b16e1d..ab163d4 100644
--- a/config.mk
+++ b/config.mk
@@ -1,8 +1,8 @@
PREFIX = /usr
MANPREFIX = $(PREFIX)/share/man
-CC = cc
+CC = c99
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_GNU_SOURCE
-CFLAGS = -std=c99 -Wall -g
+CFLAGS = -Wall -g
LDFLAGS =
diff --git a/mk/linux.mk b/mk/linux.mk
index d016d31..ad58f69 100644
--- a/mk/linux.mk
+++ b/mk/linux.mk
@@ -2,3 +2,5 @@ LIBEXT = so
LIBFLAGS = -shared -Wl,-soname,lib$(LIB_NAME).$(LIBEXT).$(LIB_MAJOR)
LIBMAJOREXT = $(LIBEXT).$(LIB_MAJOR)
LIBMINOREXT = $(LIBEXT).$(LIB_VERSION)
+
+FIX_INSTALL_NAME = :
diff --git a/mk/macos.mk b/mk/macos.mk
index bd92de6..0138ee4 100644
--- a/mk/macos.mk
+++ b/mk/macos.mk
@@ -1,4 +1,6 @@
LIBEXT = dylib
-LIBFLAGS = -dynamiclib
+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/libfonts.$(LIBMAJOREXT)"
diff --git a/mk/windows.mk b/mk/windows.mk
index e9602e1..ed5ec8d 100644
--- a/mk/windows.mk
+++ b/mk/windows.mk
@@ -1,4 +1,6 @@
LIBEXT = dll
-LIBFLAGS = -mdll
+LIBFLAGS = -shared
LIBMAJOREXT = $(LIB_MAJOR).$(LIBEXT)
LIBMINOREXT = $(LIB_VERSION).$(LIBEXT)
+
+FIX_INSTALL_NAME = :