Fix build errors under FreeBSD
[monky] / src / Makefile.am
1 # -*- mode: Makefile; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*-
2 #
3 # Conky, a system monitor, based on torsmo
4 #
5 # Any original torsmo code is licensed under the BSD license
6 #
7 # All code written since the fork of torsmo is licensed under the GPL
8 #
9 # Please see COPYING for details
10 #
11 # Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
12 # Copyright (c) 2005-2010 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
13 # All rights reserved.
14 #
15 # This program is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU General Public License as published by
17 # the Free Software Foundation, either version 3 of the License, or
18 # (at your option) any later version.
19 #
20 # This program is distributed in the hope that it will be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23 # GNU General Public License for more details.
24 # You should have received a copy of the GNU General Public License
25 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
26 #
27
28 INCLUDES = -DSYSTEM_CONFIG_FILE=\"$(sysconfdir)/conky/conky.conf\" -DPACKAGE_LIBDIR=\"$(pkglibdir)\"
29
30 bin_PROGRAMS = conky
31
32 LIBS = ${conky_LIBS}
33
34 if BUILD_CONFIG_OUTPUT
35 config_output = defconfig.h
36 config_cookie = conf_cookie.c conf_cookie.h
37 if BUILD_X11
38 config_input = $(srcdir)/../data/conky.conf
39 else
40 config_input = $(srcdir)/../data/conky_no_x11.conf
41 endif
42
43 conky_DEPENDENCIES = $(config_output)
44 BUILT_SOURCES = $(config_output)
45 CLEANFILES = $(config_output) *.gcda *.gcno
46
47 $(config_output): ${config_input}
48         sh $(srcdir)/../text2c.sh ${config_input} $@ defconfig
49 endif # BUILD_CONFIG_OUTPUT
50
51 # source files always needed for compiling
52 mandatory_sources = colours.c colours.h combine.c combine.h common.c common.h \
53                 conky.c conky.h core.c core.h diskio.c diskio.h entropy.c entropy.h \
54                 exec.c exec.h fs.c fs.h logging.h mail.c mail.h mixer.c mixer.h net_stat.c \
55                 net_stat.h template.c template.h timed_thread.c timed_thread.h mboxscan.c \
56                 mboxscan.h read_tcp.c read_tcp.h scroll.c scroll.h specials.c \
57                 specials.h tailhead.c tailhead.h temphelper.c temphelper.h \
58                 text_object.c text_object.h timeinfo.c timeinfo.h algebra.c \
59                 algebra.h proc.c proc.h user.c user.h top.c top.h
60
61 # source files only needed when the apropriate option is enabled
62 audacious = audacious.c audacious.h
63 bmpx = bmpx.c bmpx.h
64 ibm = ibm.c ibm.h smapi.c smapi.h
65 mpd = mpd.c mpd.h libmpdclient.c libmpdclient.h
66 moc = moc.c moc.h
67 xmms2 = xmms2.c xmms2.h
68 linux = linux.c linux.h users.c sony.c sony.h i8k.c i8k.h
69 solaris = solaris.c
70 freebsd = freebsd.c freebsd.h
71 netbsd = netbsd.c netbsd.h
72 openbsd = openbsd.c openbsd.h
73 port_monitors = libtcp-portmon.c libtcp-portmon.h \
74                 tcp-portmon.c tcp-portmon.h
75 x11 = x11.c x11.h fonts.c fonts.h
76 hddtemp = hddtemp.c hddtemp.h
77 eve = eve.c eve.h
78 ccurl_thread = ccurl_thread.c ccurl_thread.h
79 rss = rss.c rss.h prss.c prss.h
80 weather = weather.c weather.h
81 lua = llua.c llua.h
82 nvidia = nvidia.c nvidia.h
83 imlib2 = imlib2.c imlib2.h
84 apcupsd = apcupsd.c apcupsd.h
85 iconv = iconv_tools.c iconv_tools.h
86
87 # make sure the files from above are always included in the distfile
88 EXTRA_DIST = $(audacious) $(bmpx) $(ibm) $(mpd) $(moc) $(xmms2) $(linux) \
89              $(solaris) $(freebsd) $(netbsd) $(openbsd) $(port_monitors) \
90              $(x11) $(hddtemp) $(eve) $(ccurl_thread) $(rss) $(weather) \
91              $(lua) $(nvidia) $(imlib2) $(apcupsd)
92
93 # collect all selected optional sources
94 optional_sources =
95 if BUILD_AUDACIOUS
96 optional_sources += $(audacious)
97 endif
98 if BUILD_BMPX
99 optional_sources += $(bmpx)
100 endif
101 if BUILD_IBM
102 optional_sources += $(ibm)
103 endif
104 if BUILD_MPD
105 optional_sources += $(mpd)
106 endif
107 if BUILD_MOC
108 optional_sources += $(moc)
109 endif
110 if BUILD_XMMS2
111 optional_sources += $(xmms2)
112 endif
113 if BUILD_LINUX
114 optional_sources += $(linux)
115 endif
116 #if BUILD_SOLARIS
117 #optional_sources += $(solaris)
118 #endif
119 if BUILD_FREEBSD
120 optional_sources += $(freebsd)
121 endif
122 #if BUILD_NETBSD
123 #optional_sources += $(netbsd)
124 #endif
125 if BUILD_OPENBSD
126 optional_sources += $(openbsd)
127 endif
128 if BUILD_PORT_MONITORS
129 optional_sources += $(port_monitors)
130 endif
131 if BUILD_X11
132 optional_sources += $(x11)
133 endif
134 if BUILD_HDDTEMP
135 optional_sources += $(hddtemp)
136 endif
137 if BUILD_EVE
138 optional_sources += $(eve)
139 endif
140 if BUILD_CURL
141 optional_sources += $(ccurl_thread)
142 endif
143 if BUILD_RSS
144 optional_sources += $(rss)
145 endif
146 if BUILD_WEATHER
147 optional_sources += $(weather)
148 endif
149 if BUILD_LUA
150 optional_sources += $(lua)
151 endif
152 if BUILD_NVIDIA
153 optional_sources += $(nvidia)
154 endif
155 if BUILD_IMLIB2
156 optional_sources += $(imlib2)
157 endif
158 if BUILD_APCUPSD
159 optional_sources += $(apcupsd)
160 endif
161 if BUILD_ICONV
162 optional_sources += $(iconv)
163 endif
164
165 # linux takes the standard to the max
166 if BUILD_LINUX
167 PTHREAD_LIBS = -lpthread
168 else
169 PTHREAD_LIBS = -pthread
170 endif
171
172 conky_LDFLAGS = $(PTHREAD_LIBS) -lm
173
174 conky_SOURCES = $(config_output) $(config_cookie) \
175                 $(optional_sources) $(mandatory_sources)
176
177 # vi:set ts=4 sw=4 noet ai nocindent syntax=automake: