Release notes for v0.8.
[shell-fm.git] / source / Makefile
blobe87204ed161498bd902d64ca2c9871ca5683ef00
1 MAIN := main.c
2 SOURCE := $(filter-out $(MAIN),$(wildcard *.c))
3 OBJECT := $(subst .c,.o,$(SOURCE))
4 DEP := $(subst .c,.d,$(SOURCE))
5 BINARY := shell-fm
6 LIB := libshellfm.so
7 STATIC := libshellfm.a
8 CFLAGS += -Os -Wall -MD -W -I./include/
10 ifdef EXTERN_ONLY
11 CFLAGS += -DEXTERN_ONLY
12 else
13 ifeq ($(shell uname -s), NetBSD)
14 LDLIBS += -lossaudio
15 endif
16 ifeq ($(shell uname -s), Darwin)
17 CFLAGS += -D__darwin__
18 endif
20 CFLAGS += -DLIBAO \
21 $(shell pkg-config --cflags mad) \
22 $(shell pkg-config --cflags ao)
23 LDLIBS += $(shell pkg-config --libs mad) \
24 $(shell pkg-config --libs ao)
26 ifeq ($(shell pkg-config --exists taglib_c && echo 1), 1)
27 CFLAGS += $(shell pkg-config --cflags taglib_c) -DTAGLIB
28 LDLIBS += $(shell pkg-config --libs taglib_c)
29 endif
30 endif
32 .PHONY: clean tags cscope
34 all : $(BINARY)
36 $(LIB) : $(OBJECT)
37 $(CC) -shared -Wl,-soname,$(LIB) -o $(LIB) $(OBJECT)
39 $(STATIC) : $(OBJECT)
40 $(AR) -cvq $(STATIC) $(OBJECT)
42 $(BINARY) : $(STATIC) $(MAIN)
43 $(CC) $(CFLAGS) $(LDFLAGS) $(MAIN) $(STATIC) $(LDLIBS) -o $(BINARY)
45 clean :
46 rm -f $(OBJECT) $(BINARY) $(LIB) $(STATIC) $(DEP)
48 tags cscope :
49 $(MAKE) -C .. $@
51 sinclude $(DEP)