1# Makefile for [Open|Free|Net]BSD and Mac OS X
2
3# install locations
4PREFIX?=/usr/local
5BINDIR=$(PREFIX)/bin
6MANDIR=$(PREFIX)/man/man1
7
8# non-base dependency build info
9CDEPS=`taglib-config --cflags`
10LDEPS=`taglib-config --libs` -ltag_c
11
12# build info
13CC?=/usr/bin/cc
14CFLAGS+=-c -std=c89 -Wall -Wextra -Wno-unused-value $(CDEPS) $(CDEBUG)
15LDFLAGS+=-lm -lncursesw -lutil $(LDEPS)
16
17OBJS=commands.o compat.o e_commands.o \
18	  keybindings.o medialib.o meta_info.o \
19	  mplayer.o paint.o player.o player_utils.o \
20	  playlist.o socket.o str2argv.o \
21	  uinterface.o vitunes.o
22
23.PATH: players
24
25# main targets
26
27.PHONY: debug clean install uninstall publish-repos man-debug linux
28
29vitunes: $(OBJS)
30	$(CC) -o $@ $(LDFLAGS) $(OBJS)
31
32.c.o:
33	$(CC) $(CFLAGS) $<
34
35debug:
36	make CDEBUG="-DDEBUG -g"
37
38clean:
39	rm -f *.o
40	rm -f vitunes vitunes.core vitunes-debug.log
41
42install: vitunes
43	${BSD_INSTALL_PROGRAM} -c -m 0555 vitunes $(DESTDIR)$(BINDIR)
44	${BSD_INSTALL_MAN} -c -m 0444 vitunes.1 $(DESTDIR)$(MANDIR)
45
46uninstall:
47	rm -f $(BINDIR)/vitunes
48	rm -f $(MANDIR)/vitunes.1
49
50# misc.
51
52linux:
53	make -f Makefile.linux
54
55man-debug:
56	mandoc -Wall vitunes.1 > /dev/null
57
58vitunes.html: vitunes.1
59	man2web vitunes > vitunes.html
60
61cscope.out: *.h *.c
62	cscope -bke
63
64