forked from azeam/powerupp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
74 lines (57 loc) · 1.85 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
67
68
69
70
71
72
73
74
# application name
TARGET=powerupp
# compiler
CC=gcc
# debug
DEBUG=-g
# optimisation
OPT=-O0
# warnings
WARN=-Wall
PTHREAD=-pthread
CCFLAGS=$(DEBUG) $(OPT) $(WARN) $(PTHREAD) -pipe
GTKLIB=`pkg-config --cflags --libs gtk+-3.0`
GIOLIB=`pkg-config --cflags --libs glib-2.0`
GIO=glib-compile-resources
# linker
LD=gcc
LDFLAGS=$(PTHREAD) $(GTKLIB) -export-dynamic
OBJS=main.o resources.o active.o defaults.o apply.o save.o
ifeq ($(PREFIX),)
PREFIX := /usr
endif
all: $(OBJS)
$(LD) -o $(TARGET) $(OBJS) $(LDFLAGS)
GLIB_COMPILE_RESOURCES = $(shell) $(GIO)
res/resources.c: glade/gio.xml
$(GLIB_COMPILE_RESOURCES) --target=res/resources.c --sourcedir=glade --generate-source glade/gio.xml
resources.o: res/resources.c
$(CC) -c $(CCFLAGS) res/resources.c $(GIOLIB) -o resources.o -c
main.o: src/main.c
$(CC) -c $(CCFLAGS) src/main.c $(GTKLIB) -o main.o
active.o: src/active.c
$(CC) -c $(CCFLAGS) src/active.c $(GTKLIB) -o active.o
apply.o: src/apply.c
$(CC) -c $(CCFLAGS) src/apply.c $(GTKLIB) -o apply.o
save.o: src/save.c
$(CC) -c $(CCFLAGS) src/save.c $(GTKLIB) -o save.o
defaults.o: src/defaults.c
$(CC) -c $(CCFLAGS) src/defaults.c $(GTKLIB) -o defaults.o
clean:
rm -f *.o $(TARGET)
rm -f res/resources.c
.PHONY: install
install: powerupp
install -d $(DESTDIR)$(PREFIX)/bin
install -m 755 $< $(DESTDIR)$(PREFIX)/bin/powerupp
install -d $(DESTDIR)$(PREFIX)/share/pixmaps
install -m 644 res/icon.png $(DESTDIR)$(PREFIX)/share/pixmaps/powerupp.png
install -d $(DESTDIR)$(PREFIX)/share/applications
install -m 644 powerupp.desktop $(DESTDIR)$(PREFIX)/share/applications/powerupp.desktop
.PHONY: uninstall
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/powerupp
rm -f /usr/bin/powerupp_startup_script_card*.sh
rm -f $(DESTDIR)$(PREFIX)/share/pixmaps/powerupp.png
rm -f $(DESTDIR)$(PREFIX)/share/applications/powerupp.desktop
rm -f /etc/udev/rules.d/80-powerupp*.rules