-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (41 loc) · 1.28 KB
/
Makefile
File metadata and controls
54 lines (41 loc) · 1.28 KB
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
# Detect distribution and set library path
DISTRO := $(shell if [ -f /etc/fedora-release ]; then echo "fedora"; elif [ -f /etc/debian_version ]; then echo "debian"; else echo "unknown"; fi)
ifeq ($(DISTRO),fedora)
LIBDIR = /usr/lib64/xfce4/panel/plugins
else
LIBDIR = /usr/lib/xfce4/panel/plugins
endif
# Build configuration
DEBUG ?= 0
PREFIX = /usr
PLUGINDIR = $(PREFIX)/share/xfce4/panel/plugins
# Compiler and flags
CC = gcc
CFLAGS = -Wall -Wextra -fPIC -std=c99
LDFLAGS = -shared
ifeq ($(DEBUG),1)
CFLAGS += -g -DDEBUG
else
CFLAGS += -O2 -DNDEBUG
endif
PKGS = gtk+-3.0 libxfce4panel-2.0 libxfce4ui-2 libwnck-3.0 libxml-2.0 libxfconf-0
CFLAGS += $(shell pkg-config --cflags $(PKGS)) -DWNCK_I_KNOW_THIS_IS_UNSTABLE
LIBS = $(shell pkg-config --libs $(PKGS))
# Source files
SOURCES = focus-menu.c
# Output files
TARGET = libfocus-menu.so
$(TARGET): $(SOURCES)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS)
clean:
rm -f $(TARGET)
install: all
install -d $(DESTDIR)$(PREFIX)/lib64
install -d $(DESTDIR)$(LIBDIR)
install -d $(DESTDIR)$(PLUGINDIR)
install -m 755 $(TARGET) $(DESTDIR)$(LIBDIR)/
install -m 644 focus-menu.desktop $(DESTDIR)$(PLUGINDIR)/
uninstall:
rm -f $(DESTDIR)$(LIBDIR)/$(TARGET)
rm -f $(DESTDIR)$(PLUGINDIR)/focus-menu.desktop
.PHONY: all clean install uninstall