1#   Makefile for MP3Info and GMP3Info
2#
3#   Copyright (C) 2000-2006 Cedric Tefft <cedric@phreaker.net>
4#
5#   This program is free software; you can redistribute it and/or modify
6#   it under the terms of the GNU General Public License as published by
7#   the Free Software Foundation; either version 2 of the License, or
8#   (at your option) any later version.
9#
10#   This program is distributed in the hope that it will be useful,
11#   but WITHOUT ANY WARRANTY; without even the implied warranty of
12#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13#   GNU General Public License for more details.
14#
15#   You should have received a copy of the GNU General Public License
16#   along with this program; if not, write to the Free Software
17#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18#
19# ***************************************************************************
20#
21#  This program is based in part on:
22#
23#	* MP3Info 0.5 by Ricardo Cerqueira <rmc@rccn.net>
24#	* MP3Stat 0.9 by Ed Sweetman <safemode@voicenet.com> and
25#			 Johannes Overmann <overmann@iname.com>
26#
27
28# bindir = where binaries get installed (default = /usr/local/bin)
29# mandir = where the manual page gets installed (default = /usr/local/man/man1)
30
31prefix=/usr/local
32bindir=${prefix}/bin
33mandir = $(prefix)/man/man1
34
35# No changes necessary below this line
36
37PROG =	mp3info
38SRCS =	mp3info.c textfunc.c mp3curs.c mp3tech.c
39OBJS =  mp3info.o textfunc.o mp3curs.o mp3tech.o
40XSRC =	gmp3info.c
41XOBJ =  mp3tech.o
42RM = /bin/rm
43INSTALL = /usr/bin/install -c
44STRIP = strip
45
46LIBS = $(LDFLAGS) -lncurses
47CC ?= cc
48CFLAGS ?= -O -pipe
49
50all: mp3info gmp3info doc
51
52doc: mp3info.txt
53
54mp3info: $(OBJS)
55	$(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
56
57gmp3info: $(XSRC) $(XOBJ)
58	$(CC) $(XSRC) $(CFLAGS) -o $@ $(XOBJ) `pkg-config --cflags --libs gtk+-2.0`
59
60mp3info.txt: mp3info.1
61	groff -t -e -mandoc -Tascii mp3info.1 | col -bx > mp3info.txt
62
63clean:
64	$(RM) -f $(OBJS) $(XOBJ) mp3info gmp3info core
65
66dist: clean doc
67
68distclean: clean
69	$(RM) -f mp3info.txt
70
71install-mp3info: mp3info
72	$(STRIP) mp3info
73	$(INSTALL) mp3info $(bindir)/mp3info
74	$(INSTALL) mp3info.1 $(mandir)/mp3info.1
75
76install-gmp3info: gmp3info
77	$(STRIP) gmp3info
78	$(INSTALL) gmp3info $(bindir)/gmp3info
79
80install: install-mp3info install-gmp3info
81
82
83uninstall:
84	rm -f $(bindir)/mp3info
85	rm -f $(bindir)/gmp3info
86	rm -f $(mandir)/mp3info.1
87
88