chiark / gitweb /
Also merge into the top-level Makefile.am the simpler extras.
[elogind.git] / Makefile.am
1 include $(top_srcdir)/Makefile.am.inc
2
3 SUBDIRS = . libudev/docs
4
5 udevconfdir = $(sysconfdir)/udev
6 dist_udevconf_DATA = \
7         udev.conf
8
9 EXTRA_DIST = \
10         autogen.sh \
11         libudev/exported_symbols
12
13 CLEANFILES = \
14         udev-$(VERSION).tar.gz udev-$(VERSION).tar.bz2
15
16 ACLOCAL_AMFLAGS = -I m4
17
18 AM_MAKEFLAGS = --no-print-directory
19
20 DISTCHECK_CONFIGURE_FLAGS = \
21         --enable-gtk-doc \
22         --enable-extras
23
24 clean-local:
25         rm -rf udev-test-install
26
27 distclean-local:
28         rm -rf autom4te.cache
29
30 PREVIOUS_VERSION = `expr $(VERSION) - 1`
31
32 changelog:
33         @ head -1 ChangeLog | grep -q "to v$(PREVIOUS_VERSION)"
34         @ mv ChangeLog ChangeLog.tmp
35         @ echo "Summary of changes from v$(PREVIOUS_VERSION) to v$(VERSION)" >> ChangeLog
36         @ echo "============================================" >> ChangeLog
37         @ echo >> ChangeLog
38         @ git log --pretty=short $(PREVIOUS_VERSION)..HEAD | git shortlog  >> ChangeLog
39         @ echo >> ChangeLog
40         @ cat ChangeLog
41         @ cat ChangeLog.tmp >> ChangeLog
42         @ rm ChangeLog.tmp
43
44 test-install:
45         rm -rf $(PWD)/udev-test-install/
46         make DESTDIR=$(PWD)/udev-test-install install
47         tree $(PWD)/udev-test-install/
48
49 git-release:
50         head -1 ChangeLog | grep -q "to v$(VERSION)"
51         head -1 NEWS | grep -q "udev $(VERSION)"
52         git commit -a -m "release $(VERSION)"
53         cat .git/refs/heads/master > .git/refs/tags/$(VERSION)
54         git gc
55         git prune
56
57 doc-sync:
58         rsync -av --delete libudev/docs/html/ master.kernel.org:/pub/linux/utils/kernel/hotplug/libudev/
59         rsync -av --delete extras/gudev/docs/html/ master.kernel.org:/pub/linux/utils/kernel/hotplug/gudev/
60
61 include_HEADERS = libudev/libudev.h
62
63 # ------------------------------------------------------------------------------
64 # Libraries
65 # ------------------------------------------------------------------------------
66 lib_LTLIBRARIES = libudev/libudev.la
67
68 libudev_libudev_la_SOURCES =\
69         libudev/libudev-private.h \
70         libudev/libudev.c \
71         libudev/libudev-list.c \
72         libudev/libudev-util.c \
73         libudev/libudev-device.c \
74         libudev/libudev-enumerate.c \
75         libudev/libudev-monitor.c \
76         libudev/libudev-queue.c
77
78 LIBUDEV_CURRENT=5
79 LIBUDEV_REVISION=0
80 LIBUDEV_AGE=5
81 libudev_libudev_la_LDFLAGS = \
82         -version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE) \
83         -export-symbols $(top_srcdir)/libudev/exported_symbols
84
85 noinst_LTLIBRARIES = \
86         libudev/libudev-private.la
87
88 libudev_libudev_private_la_SOURCES =\
89         $(libudev_libudev_la_SOURCES) \
90         libudev/libudev-ctrl.c \
91         libudev/libudev-util-private.c \
92         libudev/libudev-device-private.c \
93         libudev/libudev-queue-private.c
94
95 libudev_libudev_private_la_LIBADD =
96
97 # ------------------------------------------------------------------------------
98 # Programs
99 # ------------------------------------------------------------------------------
100
101 sbin_PROGRAMS = \
102         udev/udevd \
103         udev/udevadm
104
105 udev_common_sources =\
106         udev/udev.h \
107         udev/udev-event.c \
108         udev/udev-watch.c \
109         udev/udev-node.c \
110         udev/udev-rules.c
111 udev_common_libs = libudev/libudev-private.la
112
113 udev_udevd_SOURCES = \
114         $(udev_common_sources) \
115         udev/udevd.c
116
117 udev_udevd_LDADD = $(udev_common_libs)
118
119 udev_udevadm_SOURCES = \
120         $(udev_common_sources) \
121         udev/udevadm.c \
122         udev/udevadm-info.c \
123         udev/udevadm-control.c \
124         udev/udevadm-test.c \
125         udev/udevadm-monitor.c \
126         udev/udevadm-settle.c \
127         udev/udevadm-trigger.c
128
129 udev_udevadm_LDADD = $(udev_common_libs)
130
131 libexec_PROGRAMS = \
132         extras/ata_id/ata_id \
133         extras/cdrom_id/cdrom_id \
134         extras/collect/collect \
135         extras/edd_id/edd_id \
136         extras/floppy/create_floppy_devices \
137         extras/path_id/path_id \
138         extras/fstab_import/fstab_import \
139         extras/scsi_id/scsi_id \
140         extras/usb_id/usb_id \
141         extras/v4l_id/v4l_id
142
143 dist_libexec_SCRIPTS = \
144         extras/firmware/firmware.sh \
145         extras/rule_generator/write_cd_rules \
146         extras/rule_generator/write_net_rules
147
148 udevhomedir = $(libexecdir)
149 dist_udevhome_DATA = \
150         extras/rule_generator/rule_generator.functions
151
152 extras_ata_id_ata_id_SOURCES = extras/ata_id/ata_id.c
153 extras_ata_id_ata_id_LDADD = libudev/libudev-private.la
154
155 extras_cdrom_id_cdrom_id_SOURCES = extras/cdrom_id/cdrom_id.c
156 extras_cdrom_id_cdrom_id_LDADD = libudev/libudev-private.la
157
158 extras_collect_collect_SOURCES = extras/collect/collect.c
159 extras_collect_collect_LDADD = libudev/libudev-private.la
160
161 extras_edd_id_edd_id_SOURCES = extras/edd_id/edd_id.c
162 extras_edd_id_edd_id_LDADD = libudev/libudev-private.la
163
164 extras_floppy_create_floppy_devices_SOURCES = extras/floppy/create_floppy_devices.c
165 extras_floppy_create_floppy_devices_LDADD = libudev/libudev-private.la
166
167 extras_path_id_path_id_SOURCES = extras/path_id/path_id.c
168 extras_path_id_path_id_LDADD = libudev/libudev-private.la
169
170 extras_fstab_import_fstab_import_SOURCES = extras/fstab_import/fstab_import.c
171 extras_fstab_import_fstab_import_LDADD = libudev/libudev-private.la
172
173 extras_scsi_id_scsi_id_SOURCES =\
174         extras/scsi_id/scsi_id.c \
175         extras/scsi_id/scsi_serial.c \
176         extras/scsi_id/scsi.h \
177         extras/scsi_id/scsi_id.h \
178         extras/scsi_id/bsg.h
179 extras_scsi_id_scsi_id_LDADD = libudev/libudev-private.la
180
181 extras_usb_id_usb_id_SOURCES = extras/usb_id/usb_id.c
182 extras_usb_id_usb_id_LDADD = libudev/libudev-private.la
183
184 extras_v4l_id_v4l_id_SOURCES = extras/v4l_id/v4l_id.c
185 extras_v4l_id_v4l_id_LDADD = libudev/libudev-private.la
186
187 extras_hid2hci_hid2hci_SOURCES = extras/hid2hci/hid2hci.c
188 extras_hid2hci_hid2hci_CPPFLAGS = $(AM_CPPFLAGS) $(LIBUSB_CFLAGS)
189 extras_hid2hci_hid2hci_LDADD = libudev/libudev-private.la $(LIBUSB_LIBS)
190
191 extras_udev_acl_udev_acl_SOURCES = extras/udev-acl/udev-acl.c
192 extras_udev_acl_udev_acl_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
193 extras_udev_acl_udev_acl_LDADD = libudev/libudev-private.la -lacl $(GLIB_LIBS)
194
195 extras_usb_db_usb_db_SOURCES = extras/usb-db/usb-db.c
196 extras_usb_db_usb_db_CPPFLAGS = $(AM_CPPFLAGS) -DUSB_DATABASE=\"$(USB_DATABASE)\" -DBUILD_FOR_USB
197 extras_usb_db_usb_db_LDADD = libudev/libudev-private.la
198
199 extras_usb_db_pci_db_SOURCES = extras/usb-db/usb-db.c
200 extras_usb_db_pci_db_CPPFLAGS = $(AM_CPPFLAGS) -DPCI_DATABASE=\"$(USB_DATABASE)\" -DBUILD_FOR_PCI
201 extras_usb_db_pci_db_LDADD = libudev/libudev-private.la
202
203 extras_modem_modeswitch_modem_modeswitch_SOURCES =\
204         extras/modem-modeswitch/modem-modeswitch.c \
205         extras/modem-modeswitch/utils.c \
206         extras/modem-modeswitch/utils.h \
207         extras/modem-modeswitch/ma8280p_us.c \
208         extras/modem-modeswitch/ma8280p_us.h \
209         extras/modem-modeswitch/option.c \
210         extras/modem-modeswitch/option.h
211 extras_modem_modeswitch_modem_modeswitch_CPPFLAGS = $(AM_CPPFLAGS) $(LIBUSB_CFLAGS)
212 extras_modem_modeswitch_modem_modeswitch_LDADD = libudev/libudev-private.la $(LIBUSB_LIBS)
213
214 # ------------------------------------------------------------------------------
215 # Tests
216 # ------------------------------------------------------------------------------
217
218 TESTS = test/udev-test.pl
219
220 check_PROGRAMS = \
221         libudev/test-libudev \
222         udev/test-udev
223
224 libudev_test_libudev_SOURCES = libudev/test-libudev.c
225 libudev_test_libudev_LDADD = libudev/libudev.la
226
227 udev_test_udev_SOURCES = \
228         $(udev_common_sources) \
229         udev/test-udev.c
230 udev_test_udev_LDADD = $(udev_common_libs)
231
232 # ------------------------------------------------------------------------------
233 # Basic rules
234 # ------------------------------------------------------------------------------
235
236 dist_udevrules_DATA = \
237         rules/rules.d/50-udev-default.rules \
238         rules/rules.d/60-persistent-storage.rules \
239         rules/rules.d/60-persistent-storage-tape.rules \
240         rules/rules.d/60-persistent-serial.rules \
241         rules/rules.d/60-persistent-input.rules \
242         rules/rules.d/60-persistent-alsa.rules \
243         rules/rules.d/80-drivers.rules \
244         rules/rules.d/95-udev-late.rules \
245         extras/rule_generator/75-cd-aliases-generator.rules \
246         extras/rule_generator/75-persistent-net-generator.rules \
247         extras/cdrom_id/60-cdrom_id.rules \
248         extras/edd_id/61-persistent-storage-edd.rules \
249         extras/firmware/50-firmware.rules \
250         extras/fstab_import/79-fstab_import.rules \
251         extras/v4l_id/60-persistent-v4l.rules
252
253 EXTRA_DIST += \
254         rules/packages \
255         rules/redhat \
256         rules/suse \
257         rules/gentoo
258
259 # ------------------------------------------------------------------------------
260 # Conditionals (SElinux, etc…)
261 # ------------------------------------------------------------------------------
262 if WITH_SELINUX
263 libudev_libudev_private_la_SOURCES += \
264         libudev/libudev-selinux-private.c
265 libudev_libudev_private_la_LIBADD += \
266         $(SELINUX_LIBS)
267 endif
268
269 if ENABLE_EXTRAS
270 dist_udevrules_DATA += \
271         rules/rules.d/75-net-description.rules \
272         rules/rules.d/75-tty-description.rules \
273         rules/rules.d/78-sound-card.rules \
274         extras/hid2hci/70-hid2hci.rules \
275         extras/modem-modeswitch/61-option-modem-modeswitch.rules \
276         extras/modem-modeswitch/61-mobile-action.rules
277
278 libexec_PROGRAMS += \
279         extras/hid2hci/hid2hci \
280         extras/udev-acl/udev-acl \
281         extras/usb-db/usb-db \
282         extras/usb-db/pci-db \
283         extras/modem-modeswitch/modem-modeswitch
284
285 install-exec-hook: udevacl-install-hook
286
287 SUBDIRS += \
288         extras/keymap \
289         extras/gudev
290 endif
291
292 # ------------------------------------------------------------------------------
293 # Pkg-config, docs and man pages
294 # ------------------------------------------------------------------------------
295 pkgconfigdir = $(libdir)/pkgconfig
296 pkgconfig_DATA = \
297         libudev/libudev.pc \
298         udev/udev.pc
299
300 writing_udev_rulesdir = $(docdir)/writing_udev_rules
301 dist_writing_udev_rules_DATA = \
302         docs/writing_udev_rules/index.html
303
304 dist_man_MANS = \
305         udev/udev.7 \
306         udev/udevadm.8 \
307         udev/udevd.8 \
308         extras/scsi_id/scsi_id.8
309
310 EXTRA_DIST += \
311         udev/udev.xml \
312         udev/udevadm.xml \
313         udev/udevd.xml
314
315 %.7 %.8 : %.xml
316         $(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
317
318 # ------------------------------------------------------------------------------
319 # Install and uninstall hooks
320 # ------------------------------------------------------------------------------
321 install-exec-hook: libudev-install-move-hook
322
323 uninstall-hook: libudev-uninstall-move-hook
324
325 # move lib from $(libdir) to $(rootlib_execdir) and update devel link, if needed
326 libudev-install-move-hook:
327         if test "$(libdir)" != "$(rootlib_execdir)"; then \
328                 mkdir -p $(DESTDIR)$(rootlib_execdir) && \
329                 so_img_name=$$(readlink $(DESTDIR)$(libdir)/libudev.so) && \
330                 so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
331                 ln -sf $$so_img_rel_target_prefix$(rootlib_execdir)/$$so_img_name $(DESTDIR)$(libdir)/libudev.so && \
332                 mv $(DESTDIR)$(libdir)/libudev.so.* $(DESTDIR)$(rootlib_execdir); \
333         fi
334
335 libudev-uninstall-move-hook:
336         rm -f $(DESTDIR)$(rootlib_execdir)/libudev.so*
337
338 udevacl-install-hook:
339         mkdir -p $(DESTDIR)$(prefix)/lib/ConsoleKit/run-session.d
340         ln -sf $(libexecdir)/udev-acl $(DESTDIR)$(prefix)/lib/ConsoleKit/run-session.d/udev-acl.ck