File: Makefile

package info (click to toggle)
audacious-dumb 0.57-1.1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 172 kB
  • ctags: 105
  • sloc: ansic: 539; makefile: 108
file content (84 lines) | stat: -rw-r--r-- 2,518 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
PLUGIN_FILE := libdumb.so

INSTALL_DIR := $(shell pkg-config audacious --variable=input_plugin_dir)

INSTALL_DIR_HOME := ~/.local/share/audacious/Plugins/Input

CC ?= gcc
CFLAGS ?= -O2 -pipe

CFLAGS += -Wall -fPIC -DPIC -I/usr/local/include
AUDACIOUSCFLAGS = $(shell pkg-config 'audacious >= 1.4' --cflags || echo "old")

ifeq ($(AUDACIOUSCFLAGS),old)
version:
	@false
else
CFLAGS += $(AUDACIOUSCFLAGS)
endif

DUMBLIBS := -ldumb -L/usr/local/lib
AUDACIOUSLIBS := $(shell pkg-config audacious --libs) 

SOURCES := audacious-dumb.c callbacks.c interface.c support.c
OBJDIR := obj
OBJECTS := $(SOURCES:%.c=$(OBJDIR)/%.o)

all:	$(PLUGIN_FILE)
	@echo
	@echo "The plug-in has been compiled. Run one of the following:"
	@echo "make install      - for global (root) installation to $(INSTALL_DIR)"
	@echo "make install-home - for installation to home directory $(INSTALL_DIR_HOME)"

$(PLUGIN_FILE): $(OBJECTS)
	$(CC) -shared -o $@ $^ $(DUMBLIBS) $(AUDACIOUSLIBS)

$(OBJDIR)/%.o: %.c
	$(CC) -o $@ $(CFLAGS) -c $<

install: all
	install -d $(DESTDIR)$(INSTALL_DIR)
	install -m 0755 $(PLUGIN_FILE) $(DESTDIR)$(INSTALL_DIR)
	@echo
	@echo "The plug-in has been installed."
	@echo "It is recommended you disable the Modplug plug-in"
	@echo "and any others that support the IT, XM, S3M or MOD formats."
	@echo "Enjoy!"

install-home: all
	install -d $(INSTALL_DIR_HOME)
	install -m 0755 $(PLUGIN_FILE) $(INSTALL_DIR_HOME)
	@echo
	@echo "The plug-in has been installed."
	@echo "It is recommended you disable the Modplug plug-in"
	@echo "and any others that support the IT, XM, S3M or MOD formats."
	@echo "Enjoy!"

uninstall:
	rm -f $(DESTDIR)$(INSTALL_DIR)/$(PLUGIN_FILE)
	@echo
	@echo "The plug-in has been uninstalled."

uninstall-home:
	rm -f $(INSTALL_DIR_HOME)/$(PLUGIN_FILE)
	@echo
	@echo "The plug-in has been uninstalled."

clean:
	rm -f $(OBJECTS)

distclean: clean
	rm -f $(PLUGIN_FILE) *~

DEPCC := echo "int main() { return 0; };" | $(CC) -x c -o /dev/null -
depcheck:
	@echo -n "dumb.h ... "
	@$(DEPCC) -include dumb.h && echo "found." || exit 1
	@echo -n "libdumb.so ... "
	@$(DEPCC) $(DUMBLIBS) -lm && echo "found." || exit 1
	@echo -n "Audacious ... "
	@pkg-config audacious --exists || { echo -n "pkg-config audacious not found: " && exit 1; }
	@pkg-config audacious --atleast-version=1.4 || { echo -n "version 1.4 or later not found." && exit 1; }
	@$(DEPCC) $(CFLAGS) $(AUDACIOUSLIBS) -include audacious/plugin.h && echo "`pkg-config audacious --modversion` found." || exit 1
	@echo "Everything seems to be ok."