forked from mikejuni/shairport
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
46 lines (31 loc) · 1.01 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
# the audio subsystem, currently supported: ao, alsa
AUDIO:=alsa
# how volume changes should be handled
# either soft for software
# or alsa to use the alsa mixer
VOL:=soft
# ----
CFLAGS+=-Wall $(shell pkg-config --cflags openssl) -DDISABLESTUFF
DEBUGCFLAGS+=-DDEBUGCTL
ifneq ($(VOL),soft)
USECFLAGS:=$(shell pkg-config --cflags alsa)
USELDFLAGS:=$(shell pkg-config --libs alsa)
else
CFLAGS+=-DSOFT_VOL
endif
LDFLAGS+=-lm -lpthread $(shell pkg-config --libs openssl)
USECFLAGS+=$(shell pkg-config --cflags $(AUDIO))
USELDFLAGS+=$(shell pkg-config --libs $(AUDIO))
USEOBJS+=socketlib.o shairport.o alac.o hairtunes.o audio_$(AUDIO).o vol_$(VOL).o
all: shairport
shairport: $(USEOBJS)
$(CC) $(CFLAGS) $(DEBUGCFLAGS) $(USECFLAGS) $(USEOBJS) -o $@ $(LDFLAGS) $(USELDFLAGS)
clean:
-@rm -rf hairtunes shairport *.o
%.o: %.c Makefile
$(CC) $(CFLAGS) $(DEBUGCFLAGS) -c $< -o $@
prefix=/usr/local
install: shairport
install -D -m 0755 shairport $(DESTDIR)$(prefix)/bin/shairport
.PHONY: all clean install
.SILENT: clean