forked from ryanflannery/vitunes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
96 lines (72 loc) · 2.01 KB
/
Makefile
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
include config.mk
# install locations -- OVERRIDEN by config.mk
PREFIX?=/usr/local
BINDIR?=$(PREFIX)/bin
MANDIR?=$(PREFIX)/man/man1
# combine all dependencies (from taglib & config.mk)
CDEPS=$(TAGLIB_CFLAGS) $(GSTREAMER_CFLAGS)
LDEPS=$(TAGLIB_LIBS) $(GSTREAMER_LIBS)
ODEPS=$(GSTREAMER_OBJS)
# build variables
CC ?= /usr/bin/cc
CFLAGS += -c -std=c89 -Wall -Wextra -Wno-unused-value $(CDEBUG) $(CDEPS)
LIBS += -lm -lncurses -lutil $(LDEPS)
# object files
OBJS=commands.o compat.o ecmd.o \
ecmd_add.o ecmd_addurl.o ecmd_check.o \
ecmd_flush.o ecmd_help.o ecmd_init.o \
ecmd_rmfile.o ecmd_tag.o ecmd_update.o \
keybindings.o medialib.o meta_info.o \
mplayer.o paint.o player.o player_utils.o \
playlist.o socket.o str2argv.o \
uinterface.o vitunes.o \
$(ODEPS)
# subdirectories with code (.PATH for BSD make, VPATH for GNU make)
.PATH: players
VPATH = players
.PHONY: debug clean clean-all install uninstall
# main build targets
vitunes: $(OBJS)
$(CC) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)
.c.o:
$(CC) $(CFLAGS) $<
debug:
make CDEBUG="-DDEBUG -g"
clean:
rm -f *.o
rm -f vitunes vitunes.core vitunes-debug.log
clean-all: clean
rm -rf report.*
install: vitunes
mkdir -p $(MANDIR)
install -c -m 0555 vitunes $(BINDIR)
install -c -m 0444 doc/vitunes*.1 $(MANDIR)
uninstall:
rm -f $(BINDIR)/vitunes
rm -f $(MANDIR)/vitunes*.1
# misc. targets
# this should be moved to my vitunes.org repo...
vitunes.html: vitunes.1
man2web vitunes > vitunes.html
cscope.out: *.h *.c
cscope -bke
### static analysis checks
report.mandoc: doc/*.1
@figlet "mandoc -Tlint"
-mandoc -Tlint doc/vitunes*.1 2> $@
cat $@
report.cppcheck: *.h *.c
@figlet "cppcheck"
cppcheck --std=c89 --enable=all --inline-suppr -i compat . 2> $@
@cat $@
report.scan-build: *.h *.c
@figlet "clang analyzer"
make clean
mkdir -p $@
scan-build -o $@ make
### wrapper for static checks above
.PHONY: reports
reports: report.mandoc report.cppcheck report.scan-build
@figlet "Static Checks Complete"
cat report.mandoc
cat report.cppcheck