ensure all files are in the distrib tarball
[psensor.git] / src / Makefile.am
1 SUBDIRS = lib glade
2
3 psensor_SOURCES = \
4         cfg.h cfg.c \
5         notify_cmd.c notify_cmd.h \
6         graph.h graph.c \
7         main.c \
8         ui.h ui.c \
9         ui_appindicator.h \
10         ui_color.h ui_color.c \
11         ui_graph.h ui_graph.c \
12         ui_notify.h \
13         ui_pref.h ui_pref.c \
14         ui_sensorlist.h ui_sensorlist.c \
15         ui_sensorpref.h ui_sensorpref.c \
16         ui_status.h ui_status.c \
17         pxdg.h pxdg.c
18
19 # -export-dynamic is need for defining handlers in the glade file.
20 AM_LDFLAGS = -Wl,--as-needed -export-dynamic
21
22 if LIBMICROHTTPD
23 if JSON
24 SUBDIRS += server
25 endif
26 endif
27
28 AM_CPPFLAGS =-Wall -Werror \
29         -DDEFAULT_WWW_DIR=\""$(pkgdatadir)/www"\"\
30         -DDATADIR=\""$(datadir)"\"\
31         -DPSENSOR_DESKTOP_FILE=\""psensor.desktop"\"\
32         -I$(top_srcdir)/src/lib \
33         -I$(top_srcdir)/src/unity \
34         $(GTK_CFLAGS)\
35         $(SENSORS_CFLAGS)
36
37 DEFS = -DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" -DLOCALEDIR=\"$(localedir)\" @DEFS@
38
39 LIBS = \
40         lib/libpsensor.a \
41         $(GTK_LIBS)\
42         $(PTHREAD_LIBS)\
43         $(SENSORS_LIBS) -lm
44
45 if GTK
46 if X11
47 if XEXT
48 bin_PROGRAMS = psensor
49 dist_man_MANS = psensor.1
50 endif
51 endif
52 endif
53
54 if GTOP
55 AM_CPPFLAGS += $(GTOP_CFLAGS)
56 LIBS += $(GTOP_LIBS)
57 endif
58
59 if LIBNOTIFY
60 psensor_SOURCES += ui_notify.c
61 LIBS += $(LIBNOTIFY_LIBS)
62 AM_CPPFLAGS += $(LIBNOTIFY_CFLAGS)
63 endif
64
65 if APPINDICATOR 
66 psensor_SOURCES += ui_appindicator.c 
67 LIBS += $(APPINDICATOR_LIBS)
68 AM_CPPFLAGS += $(APPINDICATOR_CFLAGS)
69 endif
70
71 if NVIDIA
72 if X11
73 AM_CPPFLAGS += $(NVIDIA_CFLAGS)
74 LIBS +=  $(NVIDIA_LIBS)
75 endif
76 endif
77
78 if LIBATIADL
79 AM_CPPFLAGS += $(LIBATIADL_CFLAGS)
80 LIBS += $(LIBATIADL_LIBS)
81 endif
82
83 if ATASMART
84 AM_CPPFLAGS += $(ATASMART_CFLAGS)
85 LIBS += $(ATASMART_LIBS)
86 endif
87
88 if LIBUDISKS2
89 LIBS += $(LIBUDISKS2_LIBS)
90 endif
91
92 if UNITY
93 psensor_SOURCES += ui_unity.h ui_unity.c
94 AM_CPPFLAGS += $(UNITY_CFLAGS)
95 LIBS += $(UNITY_LIBS) 
96 endif
97
98 if CURL
99 if JSON
100 psensor_SOURCES += rsensor.h rsensor.c
101 LIBS += $(CURL_LIBS) $(JSON_LIBS)
102 AM_CPPFLAGS += $(CURL_CFLAGS) $(JSON_CFLAGS)
103 endif
104 endif
105
106 psensor.1: main.c $(top_srcdir)/configure.ac
107         $(MAKE) $(AM_MAKEFLAGS) psensor$(EXEEXT)
108         help2man --include=description.txt -N --name="Temperature monitoring application" --output=psensor.1 ./psensor$(EXEEXT)
109
110 gsettings_SCHEMAS=psensor.gschema.xml
111
112 EXTRA_DIST = description.txt\
113         $(gsettings_SCHEMAS)\
114         rsensor.h rsensor.c\
115         ui_appindicator.c\
116         ui_notify.c\
117         ui_unity.c
118
119 @GSETTINGS_RULES@