File: Makefile

package info (click to toggle)
mp3gain 1.6.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 448 kB
  • sloc: ansic: 5,086; makefile: 262
file content (100 lines) | stat: -rw-r--r-- 1,979 bytes parent folder | download
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
96
97
98
99
100
#
# Quick 'n dirty unix Makefile
#
# Mike Oliphant (oliphant@gtk.org)
#

CC?= gcc
DESTDIR ?=
prefix ?= /usr/local
docdir ?= $(prefix)/share/doc/mp3gain
mandir ?= $(prefix)/share/man/man1

CFLAGS+= -Wall -DHAVE_MEMCPY

# all known MS Windows OS define the ComSpec environment variable
ifdef ComSpec
ifndef OSTYPE
OSTYPE = win
endif
EXE_EXT = .exe
else
EXE_EXT =
endif

ifneq ($(OSTYPE),beos)
INSTALL_PATH= $(prefix)/bin

else
INSTALL_PATH= $(HOME)/config/bin
endif

# BeOS doesn't have libm (it's all in libroot)
ifneq ($(OSTYPE),beos)
LIBS= -lm
else
# BeOS: without this it wants to use bcopy() :^)
CFLAGS+= -DHAVE_MEMCPY
endif

# Could ask pkg-config for libmpg123 flags/libs.
LIBS+= -lmpg123

ifeq ($(OSTYPE),win)
# gnu windows resource compiler
WINDRES = windres
endif

OBJS=	mp3gain.o apetag.o id3tag.o gain_analysis.o rg_error.o

ifeq ($(OSTYPE),win)
RC_OBJ = VerInfo.o
endif

all: mp3gain mp3gain.1

mp3gain.1: mp3gain.sgml
	docbook-to-man $< > $@

$(RC_OBJ): 
	$(WINDRES) $(RC_OBJ:.o=.rc) $(RC_OBJ)

mp3gain: $(RC_OBJ) $(OBJS)
	$(CC) $(LDFLAGS) -o mp3gain $(OBJS) $(RC_OBJ) $(LIBS)
ifeq ($(OSTYPE),beos)
	mimeset -f mp3gain$(EXE_EXT)
endif

install: all
ifneq ($(OSTYPE),win)
	install '-Dt$(DESTDIR)$(INSTALL_PATH)' mp3gain$(EXE_EXT)
	install '-Dt$(DESTDIR)$(docdir)' README.method
	install '-Dt$(DESTDIR)$(mandir)' mp3gain.1
ifeq ($(OSTYPE),beos)
	mimeset -f "$(DESTDIR)$(INSTALL_PATH)/mp3gain$(EXE_EXT)"
endif
else
	@echo install target is not implemented on windows
endif

uninstall:
ifneq ($(OSTYPE),win)
	-rm -f "$(INSTALL_PATH)/mp3gain$(EXE_EXT)"
	$(RM) '$(INSTALL_PATH)$(docndir)/README.method'
	$(RM) '$(INSTALL_PATH)$(mandir)/mp3gain.1'
else
	@echo uninstall target is not implemented on windows
endif

clean: 
	-rm -rf mp3gain$(EXE_EXT) mp3gain.zip $(OBJS) $(RC_OBJ)
	$(RM) mp3gain.1

dist:   clean
ifneq ($(OSTYPE),win)
ifneq ($(OSTYPE),beos)
	zip -r mp3gain.zip * -x "CVS/*" "*/CVS/*"
endif
else
	@echo dist target is not implemented on windows and beos
endif