-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
66 lines (51 loc) · 1.65 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
PREFIX = /usr/local
LD = ld
CC = cc
PKG_CONFIG = pkg-config
INSTALL = install
CFLAGS = -g -O2 -Wall -Wextra
LDFLAGS = -pthread
LIBS =
VLC_PLUGIN_CFLAGS := $(shell $(PKG_CONFIG) --cflags vlc-plugin)
VLC_PLUGIN_LIBS := $(shell $(PKG_CONFIG) --libs vlc-plugin)
VLC_PLUGIN_DIR := $(shell $(PKG_CONFIG) --variable=pluginsdir vlc-plugin)
plugindir = $(VLC_PLUGIN_DIR)/misc
SOURCES = listenbrainz.c
SOURCES_DIR = vlc-3.0
override CC += -std=gnu11
override CPPFLAGS += -DPIC -I. -Isrc
override CFLAGS += -fPIC
override CPPFLAGS += -DMODULE_STRING=\"listenbrainz\"
override CFLAGS += $(VLC_PLUGIN_CFLAGS)
override LIBS += $(VLC_PLUGIN_LIBS)
ifeq ($(OS),Windows_NT)
SUFFIX := dll
override LDFLAGS += -Wl,-no-undefined
else
SYSTEM_NAME=$(shell uname -s)
ifeq ($(SYSTEM_NAME),Linux)
SUFFIX := so
override LDFLAGS += -Wl,-no-undefined
else
ifeq ($(SYSTEM_NAME),Darwin)
SUFFIX := dylib
override LDFLAGS += -Wl
endif
endif
endif
TARGETS = liblistenbrainz_plugin.$(SUFFIX)
all: liblistenbrainz_plugin.$(SUFFIX)
install: all
mkdir -p -- $(DESTDIR)$(plugindir)
$(INSTALL) --mode 0755 liblistenbrainz_plugin.$(SUFFIX) $(DESTDIR)$(plugindir)
install-strip:
$(MAKE) install INSTALL="$(INSTALL) -s"
uninstall:
rm -f $(plugindir)/liblistenbrainz_plugin.$(SUFFIX)
clean:
rm -rf liblistenbrainz_plugin.$(SUFFIX) **/*.o
mostlyclean: clean
$(SOURCES:%.c=$(SOURCES_DIR)/%.o): %: $(SOURCES_DIR)/listenbrainz.c
liblistenbrainz_plugin.$(SUFFIX): $(SOURCES:%.c=$(SOURCES_DIR)/%.o)
$(CC) $(LDFLAGS) -shared -o $@ $^ $(LIBS)
.PHONY: all install install-strip uninstall clean mostlyclean