2 SOURCE
:= $(filter-out $(MAIN
),$(wildcard *.c
))
3 OBJECT
:= $(subst .c
,.o
,$(SOURCE
))
4 DEP
:= $(subst .c
,.d
,$(SOURCE
))
8 CFLAGS
+= -Os
-Wall
-MD
-W
-I.
/include/
11 CFLAGS
+= -DEXTERN_ONLY
13 ifeq ($(shell uname
-s
), NetBSD
)
16 ifeq ($(shell uname
-s
), Darwin
)
17 CFLAGS
+= -D__darwin__
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
)
32 .PHONY
: clean tags cscope
37 $(CC
) -shared
-Wl
,-soname
,$(LIB
) -o
$(LIB
) $(OBJECT
)
40 $(AR
) -cvq
$(STATIC
) $(OBJECT
)
42 $(BINARY
) : $(STATIC
) $(MAIN
)
43 $(CC
) $(CFLAGS
) $(LDFLAGS
) $(MAIN
) $(STATIC
) $(LDLIBS
) -o
$(BINARY
)
46 rm -f
$(OBJECT
) $(BINARY
) $(LIB
) $(STATIC
) $(DEP
)