Unverified Commit d7d8948a authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Makefile: Add `install_fonts` target; expose `font_dir`

This way, distro maintainers have the option of -not- installing the bundled
NotoSans-Medium.ttf, and instead introducing a dependency on a system-wide
NotoSans package. Not sure if that's a good idea (NotoSans is pretty big),
but that's not for me to decide anyway.
parent de02b3e2
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
include config.mk

all: build-src build-man build-applications

include config.mk

build-src:
	@${MAKE} -C src

@@ -22,8 +22,7 @@ test-x11: all
	test/run-interactive
	prove test/feh-bg-i.t

install: install-man install-doc install-bin install-font install-img
install: install-icon install-examples install-applications
install: $(addprefix install-, ${INSTALL_TARGETS})

install-man: man/feh.1
	@echo installing manuals to ${man_dir}
+2 −7
Original line number Diff line number Diff line
@@ -47,18 +47,12 @@ feh's build process uses make flags to enable/disable optional features and
fine-tune the build and installation process. It uses (hopefully) reasonable
defaults, so you can skip this section if you like.

Make flags can be passed as **make** arguments or set as environment variables,
like so:
Make flags can be passed as **make** arguments, like so:

```bash
$ make flag=bool
$ make install flag=bool
```
or
```bash
$ export flag=bool
$ make && make install
```

The following flags are respected by the makefile. A default value of **1**
indicates that the corresponding feature is enabled by default.
@@ -70,6 +64,7 @@ indicates that the corresponding feature is enabled by default.
| debug | 0 | debug build, enables `--debug` |
| exif | 0 | Builtin EXIF tag display support |
| help | 0 | include help text (refers to the manpage otherwise) |
| `install_fonts` | 1 | Install the bundled NotoSans-Medium.ttf font to `font_dir`. Package maintainers may set this to 0 and adjust `font_dir` to use a system-wide NotoSans-Medium instance instead. |
| inotify | 0 | enable inotify, needed for `--auto-reload` |
| stat64 | 0 | Support CIFS shares from 64bit hosts on 32bit machines |
| magic | 0 | Use libmagic to filter unsupported file formats |
+8 −1
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ curl ?= 1
debug ?= 0
exif ?= 0
help ?= 0
install_fonts ?= 1
magic ?= 0
mkstemps ?= 1
verscmp ?= 1
@@ -28,13 +29,15 @@ man_dir = ${main_dir}/share/man
bin_dir = ${main_dir}/bin
doc_dir = ${main_dir}/share/doc/feh
image_dir = ${main_dir}/share/feh/images
font_dir = ${main_dir}/share/feh/fonts
font_dir ?= ${main_dir}/share/feh/fonts
example_dir = ${main_dir}/share/doc/feh/examples
desktop_dir = ${main_dir}/share/applications
icon_dir = ${ICON_PREFIX}/hicolor
48_icon_dir = ${icon_dir}/48x48/apps
scalable_icon_dir = ${icon_dir}/scalable/apps

INSTALL_TARGETS = man doc bin img icon examples applications

# default CFLAGS
CFLAGS ?= -g -O2
CFLAGS += -Wall -Wextra -pedantic
@@ -61,6 +64,10 @@ ifeq (${help},1)
	CFLAGS += -DINCLUDE_HELP
endif

ifeq (${install_fonts}, 1)
	INSTALL_TARGETS += font
endif

ifeq (${stat64},1)
	CFLAGS += -D_FILE_OFFSET_BITS=64
endif