File: Makefile

package info (click to toggle)
shell-fm 0.7%2Bgit20100414-2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 444 kB
  • ctags: 305
  • sloc: ansic: 4,422; makefile: 135; python: 80; haskell: 76; sh: 67; perl: 19
file content (54 lines) | stat: -rw-r--r-- 1,194 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
MAIN	:= main.c
SOURCE	:= $(filter-out $(MAIN),$(wildcard *.c))
OBJECT	:= $(subst .c,.o,$(SOURCE))
DEP	:= $(subst .c,.d,$(SOURCE))
BINARY	:= shell-fm
LIB	:= libshellfm.so
STATIC	:= libshellfm.a
CFLAGS  += -MD -W -I./include/

ifdef EXTERN_ONLY
	CFLAGS += -DEXTERN_ONLY
else
ifeq ($(shell uname -s), OpenBSD)
	LDLIBS += -lossaudio
endif
ifeq ($(shell uname -s), NetBSD)
	LDLIBS += -lossaudio
endif
ifeq ($(shell uname -s), Darwin)
	CFLAGS += -D__darwin__
endif

CFLAGS  += -DLIBAO \
	   $(shell pkg-config --cflags mad) \
	   $(shell pkg-config --cflags ao)
LDLIBS += $(shell pkg-config --libs mad) \
	   $(shell pkg-config --libs ao)

ifeq ($(shell pkg-config --exists taglib_c && echo 1), 1)
	CFLAGS  += $(shell pkg-config --cflags taglib_c) -DTAGLIB
	LDLIBS += $(shell pkg-config --libs taglib_c)
endif
endif

.PHONY: clean tags cscope

all	: $(BINARY)

$(LIB)	: $(OBJECT)
	$(CC) -shared -Wl,-soname,$(LIB) -o $(LIB) $(OBJECT)

$(STATIC) : $(OBJECT)
	$(AR) -cvq $(STATIC) $(OBJECT)

$(BINARY)	: $(STATIC) $(MAIN)
	$(CC) $(CFLAGS) $(LDFLAGS) $(MAIN) $(STATIC) $(LDLIBS) -o $(BINARY)

clean		:
	rm -f $(OBJECT) $(BINARY) $(LIB) $(STATIC) $(DEP)

tags cscope	:
	$(MAKE) -C .. $@

sinclude $(DEP)