gconf optionnal
[psensor.git] / src / Makefile.am
1 SUBDIRS = lib glade
2
3 # -export-dynamic is need for defining handlers in the glade file.
4 AM_LDFLAGS = -Wl,--as-needed -export-dynamic
5
6 if LIBMICROHTTPD
7 if JSON
8 SUBDIRS += server
9 endif
10 endif
11
12 # -no-deprecated-declarations to avoid some glib deprecation warnings
13 AM_CPPFLAGS = -Wno-deprecated-declarations -Wall -Werror -DDEFAULT_WWW_DIR=\""$(pkgdatadir)/www"\"\
14         -I$(top_srcdir)/src/lib \
15         -I$(top_srcdir)/src/unity \
16         $(GTK_CFLAGS)\
17         $(GCONF_CFLAGS)\
18         $(SENSORS_CFLAGS)
19
20 DEFS = -DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" -DLOCALEDIR=\"$(localedir)\" @DEFS@
21
22 LIBS = \
23         lib/libpsensor.a \
24         $(GTK_LIBS)\
25         $(GCONF_LIBS)\
26         $(PTHREAD_LIBS)\
27         $(SENSORS_LIBS)
28
29 bin_PROGRAMS = psensor
30 psensor_SOURCES = \
31         cfg.h cfg.c \
32         graph.h graph.c \
33         main.c \
34         ui.h ui.c \
35         ui_appindicator.h \
36         ui_color.h ui_color.c \
37         ui_graph.h ui_graph.c \
38         ui_pref.h ui_pref.c \
39         ui_sensorlist.h ui_sensorlist.c \
40         ui_sensorpref.h ui_sensorpref.c \
41         ui_status.h ui_status.c
42
43 if GTOP
44 AM_CPPFLAGS += $(GTOP_CFLAGS)
45 LIBS += $(GTOP_LIBS)
46 endif
47
48 if LIBNOTIFY
49 psensor_SOURCES += ui_notify.h ui_notify.c
50 LIBS += $(LIBNOTIFY_LIBS)
51 AM_CPPFLAGS += $(LIBNOTIFY_CFLAGS)
52 endif
53
54 if APPINDICATOR 
55 psensor_SOURCES += ui_appindicator.c 
56 LIBS += $(APPINDICATOR_LIBS)
57 AM_CPPFLAGS += $(APPINDICATOR_CFLAGS)
58 endif
59
60 if NVIDIA
61 AM_CPPFLAGS += $(NVIDIA_CFLAGS)
62 LIBS +=  $(NVIDIA_LIBS)
63 endif
64
65 if LIBATIADL
66 AM_CPPFLAGS += $(LIBATIADL_CFLAGS)
67 LIBS += $(LIBATIADL_LIBS)
68 endif
69
70 if ATASMART
71 AM_CPPFLAGS += $(ATASMART_CFLAGS)
72 LIBS += $(ATASMART_LIBS)
73 endif
74
75 if UNITY
76 psensor_SOURCES += ui_unity.h ui_unity.c
77 AM_CPPFLAGS += $(UNITY_CFLAGS)
78 LIBS += $(UNITY_LIBS) 
79 endif
80
81 if CURL
82 if JSON
83 psensor_SOURCES += rsensor.h rsensor.c
84 LIBS += $(CURL_LIBS) $(JSON_LIBS)
85 AM_CPPFLAGS += $(CURL_CFLAGS) $(JSON_CFLAGS)
86 endif
87 endif
88
89 dist_man_MANS = psensor.1
90 EXTRA_DIST = description.txt psensor.schemas
91
92
93 if GCONF
94 schemadir = $(GCONF_SCHEMA_FILE_DIR)
95 schema_DATA = psensor.schemas
96
97 install-data-local:
98         GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(top_srcdir)/src/$(schema_DATA)
99 endif
100
101 psensor.1: main.c $(top_srcdir)/configure.ac
102         $(MAKE) $(AM_MAKEFLAGS) psensor$(EXEEXT)
103         help2man --include=description.txt -N --name="Temperature monitoring application" --output=psensor.1 ./psensor$(EXEEXT)
104