forked from hrkfdn/mpdas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (28 loc) · 842 Bytes
/
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
VERSION = 0.4-dev
CXX ?= g++
OBJ = main.o md5.o http.o utils.o song.o mpd.o audioscrobbler.o cache.o config.o
OUT = mpdas
PREFIX ?= /usr/local
MANPREFIX ?= ${PREFIX}/man/man1
CONFIG ?= $(PREFIX)/etc
CXXFLAGS += --std=c++11
CXXFLAGS += `pkg-config --cflags libmpdclient libcurl`
LIBS = `pkg-config --libs libmpdclient libcurl`
CXXFLAGS += -DCONFDIR="\"$(CONFIG)\"" -DVERSION="\"$(VERSION)\""
all: $(OUT)
.cpp.o:
@echo [CXX] $<
@$(CXX) $(CXXFLAGS) -c -o $@ $<
$(OUT): $(OBJ)
@echo [LD] $@
@$(CXX) $(LDFLAGS) $(OBJ) $(LIBS) -o $(OUT)
clean:
rm -rf $(OBJ) $(OUT)
install: all
install -d ${DESTDIR}${PREFIX}/bin
install -d ${DESTDIR}${MANPREFIX}
install -m 755 mpdas ${DESTDIR}${PREFIX}/bin
install -m 644 mpdas.1 ${DESTDIR}${MANPREFIX}/mpdas.1
uninstall:
-rm ${DESTDIR}${PREFIX}/bin/mpdas
-rm ${DESTDIR}${MANPREFIX}/mpdas.1