-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (53 loc) · 1.9 KB
/
Makefile
File metadata and controls
75 lines (53 loc) · 1.9 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
### User configurable section
prefix = /usr/local
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
sbindir = $(exec_prefix)/sbin
datarootdir = $(prefix)/share
datadir = $(datarootdir)
mandir = $(datarootdir)/man
man1dir = $(mandir)/man1
INSTALL = install
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL) -m 644
CFLAGS +=
DESTDIR =
### End user configurable section
EXTPKG := jack sndfile # extern package dependencies
CFLAGS += -Os -g -Wall -Wextra -pipe $(shell pkg-config --cflags $(EXTPKG))
LDFLAGS += $(shell pkg-config --libs $(EXTPKG))
TMP_WILD := $(TMP_WILD) *~ *.bak cscope.*
TMP_PAT := $(subst *,%,$(TMP_WILD))
RELEASE := $(shell tr -d '"' < release.h)
MYNAME := sintvert
DISTNAME := $(MYNAME)-$(RELEASE)
PROGS := sintvert
MANS := $(addprefix man/, $(PROGS:=.1))
DESKTOPS := $(wildcard data/*.desktop)
CLEAN_FILES := $(MANS) $(PROGS)
.PHONY: clean all srcdist
all: $(PROGS) $(MANS)
sintvert: sintvert.c $(wildcard *.h) Makefile
$(CC) $(CFLAGS) -std=c99 -D_REENTRANT $< -lm -lpthread -lrt $(LDFLAGS) -o $@
man/%.1: % $(filter-out $(wildcard man), man) Makefile
help2man -N -o $@ $(abspath $<) || { $< --help || :; $< --version || :; false; }
install: all installdirs
$(INSTALL_PROGRAM) $(PROGS) $(DESTDIR)$(bindir)
$(INSTALL_DATA) $(MANS) $(DESTDIR)$(man1dir)
# $(INSTALL_DATA) $(DESKTOPS) $(DESTDIR)$(datadir)/applications
clean:
set -f; for pat in $(TMP_WILD); do find . -iname $$pat -exec rm {} \; ; done; \
rm -rf $(CLEAN_FILES)
srcdist: clean
git archive --format=tar --prefix=$(DISTNAME)/ HEAD | \
gzip -c >/tmp/$(DISTNAME).tar.gz
showvars:
@echo "RELEASE := " $(RELEASE)
@echo "TMP_PAT := " $(TMP_PAT)
@echo "CFLAGS := " $(CFLAGS)
@echo "LDFLAGS := " $(LDFLAGS)
man:
mkdir man
installdirs: mkinstalldirs
./mkinstalldirs $(DESTDIR)$(bindir) $(DESTDIR)$(datadir) \
$(DESTDIR)$(mandir) $(DESTDIR)$(man1dir) $(DESTDIR)$(datadir)/applications