forked from abrasive/shairport
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
70 lines (53 loc) · 1.4 KB
/
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
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
ifeq ($(wildcard config.mk),)
$(warning config.mk does not exist, configuring.)
config.mk:
sh ./configure
$(MAKE) shairport
endif
CFLAGS ?= -O2 -Wall
-include config.mk
PREFIX ?= /usr/local
SRCS := shairport.c daemon.c rtsp.c mdns.c mdns_external.c mdns_tinysvcmdns.c common.c rtp.c metadata.c player.c alac.c audio.c audio_dummy.c audio_pipe.c tinysvcmdns.c
DEPS := config.mk alac.h audio.h common.h daemon.h getopt_long.h mdns.h metadata.h player.h rtp.h rtsp.h tinysvcmdns.h
ifdef CONFIG_SNDIO
SRCS += audio_sndio.c
endif
ifdef CONFIG_AO
SRCS += audio_ao.c
endif
ifdef CONFIG_PULSE
SRCS += audio_pulse.c
endif
ifdef CONFIG_ALSA
SRCS += audio_alsa.c
endif
ifdef CONFIG_AVAHI
SRCS += mdns_avahi.c
endif
ifdef CONFIG_HAVE_DNS_SD_H
SRCS += mdns_dns_sd.c
endif
ifndef CONFIG_HAVE_GETOPT_H
SRCS += getopt_long.c
endif
# default target
all: shairport
install: shairport
install -m 755 -d $(PREFIX)/bin
install -m 755 shairport $(PREFIX)/bin/shairport
GITREV=$(shell git describe --always)
DIRTY:=$(shell if ! git diff --quiet --exit-code; then echo -dirty; fi)
VERSION=\"$(GITREV)$(DIRTY)\"
__version_file:
@if [ ! -f version.h -o "`cat .version 2>/dev/null`" != '$(VERSION)' ]; then \
echo $(VERSION) > version.h; \
fi
%.o: %.c $(DEPS)
$(CC) -c $(CFLAGS) $<
shairport.o: __version_file
OBJS := $(SRCS:.c=.o)
shairport: $(OBJS)
$(CC) $(OBJS) $(LDFLAGS) -o shairport
clean:
rm -f shairport version.h
rm -f $(OBJS)