Imported Upstream version 1.0.4
[psensor-pkg-debian.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 \
14         -DDEFAULT_WWW_DIR=\""$(pkgdatadir)/www"\"\
15         -DDATADIR=\""$(datadir)"\"\
16         -I$(top_srcdir)/src/lib \
17         -I$(top_srcdir)/src/unity \
18         $(GTK_CFLAGS)\
19         $(GCONF_CFLAGS)\
20         $(SENSORS_CFLAGS)
21
22 DEFS = -DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" -DLOCALEDIR=\"$(localedir)\" @DEFS@
23
24 LIBS = \
25         lib/libpsensor.a \
26         $(GTK_LIBS)\
27         $(GCONF_LIBS)\
28         $(PTHREAD_LIBS)\
29         $(SENSORS_LIBS)
30
31 if GTK
32 if X11
33 if XEXT
34 if GCONF
35 bin_PROGRAMS = psensor
36 dist_man_MANS = psensor.1
37 endif
38 endif
39 endif
40 endif
41
42 psensor_SOURCES = \
43         cfg.h cfg.c \
44         notify_cmd.c notify_cmd.h \
45         graph.h graph.c \
46         main.c \
47         ui.h ui.c \
48         ui_appindicator.h \
49         ui_color.h ui_color.c \
50         ui_graph.h ui_graph.c \
51         ui_pref.h ui_pref.c \
52         ui_sensorlist.h ui_sensorlist.c \
53         ui_sensorpref.h ui_sensorpref.c \
54         ui_status.h ui_status.c \
55         pxdg.h pxdg.c
56
57 if GTOP
58 AM_CPPFLAGS += $(GTOP_CFLAGS)
59 LIBS += $(GTOP_LIBS)
60 endif
61
62 if LIBNOTIFY
63 psensor_SOURCES += ui_notify.h ui_notify.c
64 LIBS += $(LIBNOTIFY_LIBS)
65 AM_CPPFLAGS += $(LIBNOTIFY_CFLAGS)
66 endif
67
68 if APPINDICATOR 
69 psensor_SOURCES += ui_appindicator.c 
70 LIBS += $(APPINDICATOR_LIBS)
71 AM_CPPFLAGS += $(APPINDICATOR_CFLAGS)
72 endif
73
74 if NVIDIA
75 if X11
76 AM_CPPFLAGS += $(NVIDIA_CFLAGS)
77 LIBS +=  $(NVIDIA_LIBS)
78 endif
79 endif
80
81 if LIBATIADL
82 AM_CPPFLAGS += $(LIBATIADL_CFLAGS)
83 LIBS += $(LIBATIADL_LIBS)
84 endif
85
86 if ATASMART
87 AM_CPPFLAGS += $(ATASMART_CFLAGS)
88 LIBS += $(ATASMART_LIBS)
89 endif
90
91 if UNITY
92 psensor_SOURCES += ui_unity.h ui_unity.c
93 AM_CPPFLAGS += $(UNITY_CFLAGS)
94 LIBS += $(UNITY_LIBS) 
95 endif
96
97 if CURL
98 if JSON
99 psensor_SOURCES += rsensor.h rsensor.c
100 LIBS += $(CURL_LIBS) $(JSON_LIBS)
101 AM_CPPFLAGS += $(CURL_CFLAGS) $(JSON_CFLAGS)
102 endif
103 endif
104
105 EXTRA_DIST = description.txt psensor.schemas
106
107 if GCONF
108 schemadir = $(GCONF_SCHEMA_FILE_DIR)
109 schema_DATA = psensor.schemas
110
111 install-data-local:
112         GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(top_srcdir)/src/$(schema_DATA)
113 endif
114
115 psensor.1: main.c $(top_srcdir)/configure.ac
116         $(MAKE) $(AM_MAKEFLAGS) psensor$(EXEEXT)
117         help2man --include=description.txt -N --name="Temperature monitoring application" --output=psensor.1 ./psensor$(EXEEXT)
118