aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 0e49f287908b2a340407b87aed9b514c80fe1cb3 (plain)
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Tabsize: 4

MAKE = make
CC = gcc
INSTALL_PATH=/

ifdef DEBUG
 EXTRA_CFLAGS+=-DDEBUG
endif


DEPS = 	bat_tray.h \
		bool.h \
		common.h \
		config_file.h \
		debug.h \
		defaults.h \
		getcore.h \
		getfreq.h \
		getgov.h \
		reload.h \
		trayfreq.h \
		tray.h \
		trayfreq_set_interface.h \
		widget_manager.h


GLIB_CFLAGS				=	-I/usr/include/glib-2.0 \
							-I/usr/lib/glib-2.0/include
GLIB_LIBS				=	-lglib-2.0

GTK_CFLAGS				=	-I/usr/include/gtk-2.0 \
							-I/usr/lib/gtk-2.0/include \
							-I/usr/include/pango-1.0 \
							-I/usr/include/cairo \
							-I/usr/include/gdk-pixbuf-2.0 \
							-I/usr/include/atk-1.0

GTK_LIBS	=	-lgtk-3 \
				-lgobject-2.0


trayfreq_CFLAGS			=	$(GTK_CFLAGS) $(GLIB_CFLAGS) -Wall -D_=gettext
trayfreq_LDFLAGS		=	$(GTK_LIBS) $(GLIB_LIBS) -lm
trayfreq_SOURCES		=	freq_tray/getcore.c \
							freq_tray/getfreq.c \
							freq_tray/getgov.c \
							tray.c \
							trayfreq.c \
							widget_manager.c \
							trayfreq_set/trayfreq_set_interface.c \
							config_file.c \
							defaults.c \
							bat_tray/bat_tray.c \
							common.c \
							reload.c

trayfreq_set_CFLAGS		=	$(GLIB_CFLAGS) -Wall -D_=gettext
trayfreq_set_LDFLAGS	=	$(GLIB_LIBS) -lm
trayfreq_set_SOURCES	=	trayfreq_set/trayfreq_set.c \
							freq_tray/getfreq.c \
							freq_tray/getcore.c


########################################################################
# Make entire suite
all: trayfreq trayfreq-set lang
########################################################################


########################################################################
# Make main trayfreq system tray program
trayfreq:	bat_tray.o \
			common.o \
			config_file.o \
			defaults.o \
			getcore.o \
			getfreq.o \
			getgov.o \
			reload.o \
			trayfreq.o \
			tray.o \
			trayfreq_set_interface.o \
			widget_manager.o
	$(CC) -o $@ $? $(trayfreq_LDFLAGS)

########################################################################
# Make trayfreq-set utility
trayfreq-set: \
			trayfreq_set.o \
			getcore.o \
			getfreq.o \
			getgov.o

	$(CC) -o $@ $? $(trayfreq_set_LDFLAGS)
########################################################################



########################################################################
%.o: %.c $(DEPS)
	$(CC) -c -o $@ $< $(trayfreq_CFLAGS) $(EXTRA_CFLAGS)
########################################################################



########################################################################
# Make language files
lang:
	msgfmt -c -o lc/fr.mo lc/fr.po
########################################################################


########################################################################
# Remove generated files
clean:
	rm -f trayfreq trayfreq-set *.o lang/*.mo
########################################################################


########################################################################
# Install entire suite
install:
	mkdir -p $(INSTALL_PATH)/usr/share/trayfreq/
	mkdir -p $(INSTALL_PATH)/usr/share/locale/fr/LC_MESSAGES/
	mkdir -p $(INSTALL_PATH)/etc/

	cp data/*.png $(INSTALL_PATH)/usr/share/trayfreq/
	cp lc/fr.mo $(INSTALL_PATH)/usr/share/locale/fr/LC_MESSAGES/trayfreq.mo

	install -Dm 644 data/trayfreq.conf $(INSTALL_PATH)/etc/trayfreq.conf
	install -Dm 644 data/trayfreq.desktop $(INSTALL_PATH)/etc/xdg/autostart/trayfreq.desktop
	install -Dm 755 trayfreq $(INSTALL_PATH)/usr/bin/trayfreq
	install -Dm 755 trayfreq-set $(INSTALL_PATH)/usr/bin/trayfreq-set

	ln -s /usr/share/licenses/common/GLPv3/license.txt $(INSTALL_PATH)/usr/share/trayfreq/LICENCE
	ln -s ../../../etc/trayfreq.conf $(INSTALL_PATH)/usr/share/trayfreq/trayfreq.conf
########################################################################