aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorN-R-K <79544946+N-R-K@users.noreply.github.com>2022-02-27 14:47:06 +0000
committerGitHub <noreply@github.com>2022-02-27 14:47:06 +0000
commitd9db7d76b44e7d5c9bc48934d8b4e441104d3edc (patch)
tree15ee2977ca344cd9494670b4d63a26d00f7f9b73 /Makefile
parentbda70867ac50c35b3bb134cf408ce5ae3cf0c751 (diff)
Makefile: cleanup non-posix stuff (#225)
remove some non-posix extensions which slipped through and adjust ci to new Makefile changes users can still overwrite the variables explicitly by using `make VAR=VALUE` packagers can also add extra libs to LDLIBS, we're internally using NSXIV_LDLIBS now.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 16 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index 70913f8..be194f7 100644
--- a/Makefile
+++ b/Makefile
@@ -1,25 +1,27 @@
+.POSIX:
+
# nsxiv version
VERSION = 28
# PREFIX for install
-PREFIX ?= /usr/local
-MANPREFIX ?= $(PREFIX)/share/man
-EGPREFIX ?= $(PREFIX)/share/doc/nsxiv/examples
+PREFIX = /usr/local
+MANPREFIX = $(PREFIX)/share/man
+EGPREFIX = $(PREFIX)/share/doc/nsxiv/examples
# default value for optional dependencies. 1 = enabled, 0 = disabled
-OPT_DEP_DEFAULT ?= 1
+OPT_DEP_DEFAULT = 1
# autoreload backend: 1 = inotify, 0 = none
-HAVE_INOTIFY ?= $(OPT_DEP_DEFAULT)
+HAVE_INOTIFY = $(OPT_DEP_DEFAULT)
# optional dependencies, see README for more info
-HAVE_LIBFONTS ?= $(OPT_DEP_DEFAULT)
-HAVE_LIBGIF ?= $(OPT_DEP_DEFAULT)
-HAVE_LIBEXIF ?= $(OPT_DEP_DEFAULT)
-HAVE_LIBWEBP ?= $(OPT_DEP_DEFAULT)
+HAVE_LIBFONTS = $(OPT_DEP_DEFAULT)
+HAVE_LIBGIF = $(OPT_DEP_DEFAULT)
+HAVE_LIBEXIF = $(OPT_DEP_DEFAULT)
+HAVE_LIBWEBP = $(OPT_DEP_DEFAULT)
# CFLAGS, any optimization flags goes here
-CFLAGS ?= -std=c99 -Wall -pedantic
+CFLAGS = -std=c99 -Wall -pedantic
# icons that will be installed via `make icon`
ICONS = 16x16.png 32x32.png 48x48.png 64x64.png 128x128.png
@@ -42,15 +44,14 @@ lib_webp_0 =
lib_webp_1 = -lwebpdemux -lwebp
autoreload_0 = nop
autoreload_1 = inotify
-# using += because certain *BSD distros may need to add additional flags
-LDLIBS += -lImlib2 -lX11 \
+
+NSXIV_LDLIBS = -lImlib2 -lX11 \
$(lib_exif_$(HAVE_LIBEXIF)) $(lib_gif_$(HAVE_LIBGIF)) \
$(lib_webp_$(HAVE_LIBWEBP)) $(lib_fonts_$(HAVE_LIBFONTS))
OBJS = autoreload_$(autoreload_$(HAVE_INOTIFY)).o commands.o image.o main.o options.o \
thumbs.o util.o window.o
-.PHONY: all clean install uninstall install-all install-icon uninstall-icon install-desktop
.SUFFIXES:
.SUFFIXES: .c .o
@@ -58,7 +59,7 @@ all: nsxiv
nsxiv: $(OBJS)
@echo "LINK $@"
- $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
+ $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS) $(NSXIV_LDLIBS)
.c.o:
@echo "CC $@"
@@ -74,7 +75,7 @@ config.h:
version.h: Makefile .git/index
@echo "GEN $@"
- v="$$(git describe 2>/dev/null)"; \
+ v="$$(git describe 2>/dev/null || true)"; \
echo "#define VERSION \"$${v:-$(VERSION)}\"" >$@
.git/index: