File: Makefile

package info (click to toggle)
xmms2-scrobbler 0.4.0-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 204 kB
  • sloc: ansic: 1,214; makefile: 49
file content (55 lines) | stat: -rw-r--r-- 1,394 bytes parent folder | download | duplicates (2)
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
CFLAGS += -std=gnu99 -Wall -Wwrite-strings -pthread
ENDIAN_CFLAGS=
PREFIX ?= /usr/local

VERSION := 0.4.0
TARBALL := xmms2-scrobbler-$(VERSION).tar.gz

LIBS := -lpthread -lrt
XMMS_CFLAGS := `pkg-config xmms2-client --cflags`
XMMS_LIBS := `pkg-config xmms2-client --libs`
CURL_CFLAGS := `pkg-config libcurl --cflags`
CURL_LIBS := `pkg-config libcurl --libs`

ifndef VERBOSE
	QUIET_CC = @echo '    ' CC $@;
	QUIET_LINK = @echo '    ' LINK $@;
	QUIET_MKDIR = @echo '    ' MKDIR $@;
endif

ifdef BIG_ENDIAN
	ENDIAN_CFLAGS=-DWORDS_BIGENDIAN
endif

BINARY := bin/xmms2-scrobbler
OBJECTS := src/xmms2-scrobbler.o \
           src/list.o \
           src/queue.o \
           src/strbuf.o \
           src/md5.o \
           src/submission.o

all: $(BINARY)

install: $(BINARY)
	install -d $(DESTDIR)$(PREFIX)/bin
	install -m 755 $(BINARY) $(DESTDIR)$(PREFIX)/bin

$(BINARY): $(OBJECTS) bin
	$(QUIET_LINK)$(CC) $(LDFLAGS) $(OBJECTS) $(LIBS) $(XMMS_LIBS) $(CURL_LIBS) -o $@

src/%.o : src/%.c
	$(QUIET_CC)$(CC) $(CFLAGS) $(XMMS_CFLAGS) $(CURL_CFLAGS) $(ENDIAN_CFLAGS) -o $@ -c $<

bin:
	$(QUIET_MKDIR)mkdir bin

dist:
	rm -rf $(TARBALL) xmms2-scrobbler-$(VERSION)
	git archive --format=tar --prefix=xmms2-scrobbler-$(VERSION)/ HEAD | tar -x
	git log > xmms2-scrobbler-$(VERSION)/ChangeLog
	tar czvf $(TARBALL) xmms2-scrobbler-$(VERSION)
	rm -rf xmms2-scrobbler-$(VERSION)

clean:
	rm -rf $(OBJECTS) bin