2022-02-27 15:47:06 +01:00
|
|
|
.POSIX:
|
|
|
|
|
2022-04-21 23:14:03 +02:00
|
|
|
include config.mk
|
2021-09-23 04:17:52 +02:00
|
|
|
|
2021-09-19 10:49:56 +02:00
|
|
|
inc_fonts_0 =
|
|
|
|
inc_fonts_1 = -I/usr/include/freetype2 -I$(PREFIX)/include/freetype2
|
|
|
|
lib_fonts_0 =
|
|
|
|
lib_fonts_1 = -lXft -lfontconfig
|
2021-10-03 18:52:12 +02:00
|
|
|
lib_exif_0 =
|
|
|
|
lib_exif_1 = -lexif
|
2022-02-27 15:47:06 +01:00
|
|
|
|
2022-05-26 02:08:59 +02:00
|
|
|
nsxiv_cppflags = -D_XOPEN_SOURCE=700 \
|
2023-08-27 19:20:39 +02:00
|
|
|
-DHAVE_LIBEXIF=$(HAVE_LIBEXIF) -DHAVE_LIBFONTS=$(HAVE_LIBFONTS) \
|
2022-05-26 02:08:59 +02:00
|
|
|
-DHAVE_INOTIFY=$(HAVE_INOTIFY) $(inc_fonts_$(HAVE_LIBFONTS)) \
|
|
|
|
$(CPPFLAGS)
|
2022-04-21 23:14:03 +02:00
|
|
|
|
2022-05-26 02:08:59 +02:00
|
|
|
nsxiv_ldlibs = -lImlib2 -lX11 \
|
2023-08-27 19:20:39 +02:00
|
|
|
$(lib_exif_$(HAVE_LIBEXIF)) $(lib_fonts_$(HAVE_LIBFONTS)) \
|
2022-05-26 02:08:59 +02:00
|
|
|
$(LDLIBS)
|
2021-10-03 18:52:12 +02:00
|
|
|
|
2022-05-26 02:08:59 +02:00
|
|
|
objs = autoreload.o commands.o image.o main.o options.o \
|
2017-10-23 10:28:28 +02:00
|
|
|
thumbs.o util.o window.o
|
2017-10-12 10:56:03 +02:00
|
|
|
|
|
|
|
.SUFFIXES:
|
|
|
|
.SUFFIXES: .c .o
|
|
|
|
|
2021-09-16 11:32:59 +02:00
|
|
|
all: nsxiv
|
2021-09-14 16:42:57 +02:00
|
|
|
|
2022-05-26 02:08:59 +02:00
|
|
|
nsxiv: $(objs)
|
2017-09-08 16:49:31 +02:00
|
|
|
@echo "LINK $@"
|
2022-05-26 02:08:59 +02:00
|
|
|
$(CC) $(LDFLAGS) -o $@ $(objs) $(nsxiv_ldlibs)
|
2017-10-12 10:56:03 +02:00
|
|
|
|
2021-09-14 16:42:57 +02:00
|
|
|
.c.o:
|
|
|
|
@echo "CC $@"
|
2022-05-26 02:08:59 +02:00
|
|
|
$(CC) $(CFLAGS) $(nsxiv_cppflags) -c -o $@ $<
|
2021-09-14 16:42:57 +02:00
|
|
|
|
2022-05-26 02:08:59 +02:00
|
|
|
$(objs): Makefile config.mk nsxiv.h config.h commands.h
|
2022-08-16 10:43:50 +02:00
|
|
|
options.o: version.h optparse.h
|
2022-05-31 08:54:32 +02:00
|
|
|
window.o: icon/data.h utf8.h
|
2017-10-12 10:56:03 +02:00
|
|
|
|
|
|
|
config.h:
|
|
|
|
@echo "GEN $@"
|
2021-09-14 16:42:57 +02:00
|
|
|
cp config.def.h $@
|
2011-01-17 14:57:59 +01:00
|
|
|
|
2022-04-21 23:14:03 +02:00
|
|
|
version.h: config.mk .git/index
|
2018-06-09 11:33:30 +02:00
|
|
|
@echo "GEN $@"
|
2022-02-27 15:47:06 +01:00
|
|
|
v="$$(git describe 2>/dev/null || true)"; \
|
2021-09-14 16:42:57 +02:00
|
|
|
echo "#define VERSION \"$${v:-$(VERSION)}\"" >$@
|
2018-06-09 11:33:30 +02:00
|
|
|
|
2021-09-16 23:35:29 +02:00
|
|
|
.git/index:
|
|
|
|
|
2022-06-15 07:55:16 +02:00
|
|
|
dump_cppflags:
|
|
|
|
@echo $(nsxiv_cppflags)
|
|
|
|
|
2011-01-17 14:57:59 +01:00
|
|
|
clean:
|
2021-10-03 18:52:12 +02:00
|
|
|
rm -f *.o nsxiv version.h
|
2011-09-08 15:41:18 +02:00
|
|
|
|
2021-09-25 07:00:21 +02:00
|
|
|
install-all: install install-desktop install-icon
|
|
|
|
|
|
|
|
install-desktop:
|
2021-09-23 04:17:52 +02:00
|
|
|
@echo "INSTALL nsxiv.desktop"
|
|
|
|
mkdir -p $(DESTDIR)$(PREFIX)/share/applications
|
2022-08-09 16:21:52 +02:00
|
|
|
cp etc/nsxiv.desktop $(DESTDIR)$(PREFIX)/share/applications
|
2021-09-23 04:17:52 +02:00
|
|
|
|
2021-09-25 07:00:21 +02:00
|
|
|
install-icon:
|
2021-09-23 04:17:52 +02:00
|
|
|
@echo "INSTALL icon"
|
|
|
|
for f in $(ICONS); do \
|
|
|
|
dir="$(DESTDIR)$(PREFIX)/share/icons/hicolor/$${f%.png}/apps"; \
|
|
|
|
mkdir -p "$$dir"; \
|
|
|
|
cp "icon/$$f" "$$dir/nsxiv.png"; \
|
|
|
|
chmod 644 "$$dir/nsxiv.png"; \
|
|
|
|
done
|
|
|
|
|
2021-09-25 07:00:21 +02:00
|
|
|
uninstall-icon:
|
2021-09-23 04:17:52 +02:00
|
|
|
@echo "REMOVE icon"
|
|
|
|
for f in $(ICONS); do \
|
|
|
|
dir="$(DESTDIR)$(PREFIX)/share/icons/hicolor/$${f%.png}/apps"; \
|
|
|
|
rm -f "$$dir/nsxiv.png"; \
|
|
|
|
done
|
|
|
|
|
2011-09-08 15:41:18 +02:00
|
|
|
install: all
|
2021-09-16 11:32:59 +02:00
|
|
|
@echo "INSTALL bin/nsxiv"
|
2021-10-03 18:52:12 +02:00
|
|
|
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
|
|
|
cp nsxiv $(DESTDIR)$(PREFIX)/bin/
|
|
|
|
chmod 755 $(DESTDIR)$(PREFIX)/bin/nsxiv
|
2021-09-16 11:32:59 +02:00
|
|
|
@echo "INSTALL nsxiv.1"
|
2013-01-10 19:11:57 +01:00
|
|
|
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
|
2022-08-09 16:21:52 +02:00
|
|
|
sed "s!EGPREFIX!$(EGPREFIX)!g; s!PREFIX!$(PREFIX)!g; s!VERSION!$(VERSION)!g" \
|
|
|
|
etc/nsxiv.1 >$(DESTDIR)$(MANPREFIX)/man1/nsxiv.1
|
2021-09-16 11:32:59 +02:00
|
|
|
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/nsxiv.1
|
|
|
|
@echo "INSTALL share/nsxiv/"
|
2021-10-03 18:52:12 +02:00
|
|
|
mkdir -p $(DESTDIR)$(EGPREFIX)
|
2022-08-09 16:21:52 +02:00
|
|
|
cp etc/examples/* $(DESTDIR)$(EGPREFIX)
|
2021-10-03 18:52:12 +02:00
|
|
|
chmod 755 $(DESTDIR)$(EGPREFIX)/*
|
2011-09-08 15:41:18 +02:00
|
|
|
|
2021-09-25 07:00:21 +02:00
|
|
|
uninstall: uninstall-icon
|
2021-09-16 11:32:59 +02:00
|
|
|
@echo "REMOVE bin/nsxiv"
|
|
|
|
rm -f $(DESTDIR)$(PREFIX)/bin/nsxiv
|
|
|
|
@echo "REMOVE nsxiv.1"
|
|
|
|
rm -f $(DESTDIR)$(MANPREFIX)/man1/nsxiv.1
|
2021-09-23 04:17:52 +02:00
|
|
|
@echo "REMOVE nsxiv.desktop"
|
|
|
|
rm -f $(DESTDIR)$(PREFIX)/share/applications/nsxiv.desktop
|
2021-09-16 11:32:59 +02:00
|
|
|
@echo "REMOVE share/nsxiv/"
|
2021-10-03 18:52:12 +02:00
|
|
|
rm -rf $(DESTDIR)$(EGPREFIX)
|
2017-09-08 16:49:31 +02:00
|
|
|
|