File: Makefile

package info (click to toggle)
sleepenh 1.7-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 64 kB
  • sloc: ansic: 128; makefile: 29
file content (30 lines) | stat: -rw-r--r-- 625 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Q ?= @
ifneq ($(Q),@)
Q :=
endif

CC = gcc
CFLAGS = -std=gnu11 -Wall -Wextra -O2 $(EXTRA_CFLAGS)

targets := sleepenh sleepenh.1.gz

all: $(targets)

.clean = $(wildcard $(targets))
distclean clean:
ifneq ($(.clean),)
	rm -f $(.clean)
endif

sleepenh: CFLAGS += -DVCSVERSION=$(call vcsversion)

%.1.gz: %.1
	gzip -9 < $< > $@

install: $(targets)
	install -D -m 0755 -o root -g root sleepenh ${DESTDIR}/usr/bin/sleepenh
	install -D -m 0644 -o root -g root sleepenh.1.gz ${DESTDIR}/usr/share/man/man1/sleepenh.1.gz

define vcsversion
'$(shell git describe --dirty | sed -e 's,^\(.*\)/\([^/]\+\),\2/\1,;s,^.*$$,\"&\",')'
endef