-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGNUmakefile
More file actions
65 lines (47 loc) · 1.9 KB
/
Copy pathGNUmakefile
File metadata and controls
65 lines (47 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
#
# note: ps2pdf produces better results
# note: if libncursesw.so.* is missing create symbolic link of libncurses.so.* and run ldconfig
DESTDIR ?=
prefix ?= /usr/local
bindir ?= $(prefix)/bin
mandir ?= $(prefix)/share/man
man1dir ?= $(mandir)/man1
man5dir ?= $(mandir)/man5
APPNAME := notes
ADDMODS := str.o nc-readstr.o nc-core.o nc-keyb.o nc-view.o nc-list.o notes.o list.o errio.o
CFLAGS := -O -Wall -Wformat=0 -D_GNU_SOURCE
LDLIBS := -lncursesw -lncurses
M2RFLAGS := -z
all: $(APPNAME)
clean:
rm -f *.o $(APPNAME) $(APPNAME).man $(APPNAME).1.gz $(APPNAME)rc.man $(APPNAME)rc.5.gz nc-colors nc-getch > /dev/null
$(APPMODS): %.o: %.c
$(APPNAME): $(ADDMODS)
$(APPNAME).man: $(APPNAME).md
md2roff $(M2RFLAGS) $(APPNAME).md > $(APPNAME).man
$(APPNAME).1.gz: $(APPNAME).md
md2roff $(M2RFLAGS) $(APPNAME).md > $(APPNAME).1
gzip -f $(APPNAME).1
$(APPNAME)rc.man: $(APPNAME)rc.md
md2roff $(M2RFLAGS) $(APPNAME)rc.md > $(APPNAME)rc.man
$(APPNAME)rc.5.gz: $(APPNAME)rc.md
md2roff $(M2RFLAGS) $(APPNAME)rc.md > $(APPNAME)rc.5
gzip -f $(APPNAME)rc.5
html: $(APPNAME).man
md2roff -q $(APPNAME).md > $(APPNAME).man
groff $(APPNAME).man -Thtml -man > $(APPNAME).html
pdf: $(APPNAME).md
md2roff -q $(APPNAME).md > $(APPNAME).man
groff $(APPNAME).man -Tpdf -man -dPDF.EXPORT=1 -dLABEL.REFS=1 -P -e > $(APPNAME).pdf
install: $(APPNAME) $(APPNAME).1.gz $(APPNAME)rc.5.gz
install -m 755 -o root -g root -d $(DESTDIR)$(bindir)
install -m 755 -o root -g root -d $(DESTDIR)$(man1dir)
install -m 755 -o root -g root -d $(DESTDIR)$(man5dir)
install -m 755 -o root -g root -s $(APPNAME) $(DESTDIR)$(bindir)
install -m 644 -o root -g root $(APPNAME).1.gz $(DESTDIR)$(man1dir)
install -m 644 -o root -g root $(APPNAME)rc.5.gz $(DESTDIR)$(man5dir)
uninstall:
rm -f $(DESTDIR)$(bindir)/$(APPNAME) $(DESTDIR)$(man1dir)/$(APPNAME).1.gz $(DESTDIR)$(man5dir)/$(APPNAME)rc.5.gz
# utilities
nc-colors: nc-colors.c
nc-getch: nc-getch.c