Makefile.am revision b2ad12eb0291832134bf3757f98abfeeec2fb166
# ------------------------------------------------------------------------------
# Copyright (C) 2008-2009 Kay Sievers <kay.sievers@vrfy.org>
# Copyright (C) 2009 Diego Elio 'Flameeyes' Pettenò <flameeyes@gmail.com>
# ------------------------------------------------------------------------------
SUBDIRS = .
EXTRA_DIST = autogen.sh
ACLOCAL_AMFLAGS = -I m4
AM_MAKEFLAGS = --no-print-directory
AM_CPPFLAGS = \
-include $(top_builddir)/config.h \
-I$(top_srcdir)/libudev \
-DSYSCONFDIR=\""$(sysconfdir)"\" \
-DLIBEXECDIR=\""$(libexecdir)"\"
AM_LDFLAGS = \
-Wl,--as-needed
DISTCHECK_CONFIGURE_FLAGS = \
--enable-gtk-doc \
--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
CLEANFILES =
INSTALL_EXEC_HOOKS =
INSTALL_DATA_HOOKS =
UNINSTALL_EXEC_HOOKS =
DISTCHECK_HOOKS =
# ------------------------------------------------------------------------------
# libudev
# ------------------------------------------------------------------------------
LIBUDEV_CURRENT=9
LIBUDEV_REVISION=1
LIBUDEV_AGE=9
SUBDIRS += libudev/docs
include_HEADERS = libudev/libudev.h
lib_LTLIBRARIES = libudev/libudev.la
libudev_libudev_la_SOURCES =\
libudev_libudev_la_LDFLAGS = \
-version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE) \
-export-symbols $(top_srcdir)/libudev/exported_symbols
noinst_LTLIBRARIES = \
libudev_libudev_private_la_SOURCES =\
$(libudev_libudev_la_SOURCES) \
if WITH_SELINUX
libudev_libudev_private_la_SOURCES += libudev/libudev-selinux-private.c
libudev_libudev_private_la_LIBADD = $(SELINUX_LIBS)
endif
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libudev/libudev.pc
EXTRA_DIST += libudev/exported_symbols libudev/COPYING
# move lib from $(libdir) to $(rootlib_execdir) and update devel link, if needed
libudev-install-move-hook:
if test "$(libdir)" != "$(rootlib_execdir)"; then \
mkdir -p $(DESTDIR)$(rootlib_execdir) && \
so_img_name=$$(readlink $(DESTDIR)$(libdir)/libudev.so) && \
so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
ln -sf $$so_img_rel_target_prefix$(rootlib_execdir)/$$so_img_name $(DESTDIR)$(libdir)/libudev.so && \
mv $(DESTDIR)$(libdir)/libudev.so.* $(DESTDIR)$(rootlib_execdir); \
fi
libudev-uninstall-move-hook:
rm -f $(DESTDIR)$(rootlib_execdir)/libudev.so*
INSTALL_EXEC_HOOKS += libudev-install-move-hook
UNINSTALL_EXEC_HOOKS += libudev-uninstall-move-hook
# ------------------------------------------------------------------------------
# main udev
# ------------------------------------------------------------------------------
udev-confdirs:
-mkdir -p $(DESTDIR)$(sysconfdir)/udev/rules.d
-mkdir -p $(DESTDIR)$(libexecdir)/devices
INSTALL_DATA_HOOKS += udev-confdirs
EXTRA_DIST += \
udevrulesdir = $(libexecdir)/rules.d
dist_udevrules_DATA = \
udevconfdir = $(sysconfdir)/udev
dist_udevconf_DATA = udev.conf
sharepkgconfigdir = $(datadir)/pkgconfig
sharepkgconfig_DATA = udev/udev.pc
if WITH_SYSTEMD
systemdsystemunit_DATA = \
systemd-install-hook:
mkdir -p $(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants
ln -sf ../udev.service $(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants/udev.service
ln -sf ../udev-settle.service $(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants/udev-settle.service
ln -sf ../udev-retry.service $(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants/udev-retry.service
INSTALL_DATA_HOOKS += systemd-install-hook
endif
sbin_PROGRAMS = \
udev_common_sources =\
udev_udevd_SOURCES = \
$(udev_common_sources) \
udev_udevd_LDADD = libudev/libudev-private.la
udev_udevadm_SOURCES = \
$(udev_common_sources) \
udev_udevadm_LDADD = libudev/libudev-private.la
# ------------------------------------------------------------------------------
# udev man pages
# ------------------------------------------------------------------------------
dist_man_MANS = \
EXTRA_DIST += \
%.7 %.8 : %.xml
$(AM_V_GEN)$(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
# ------------------------------------------------------------------------------
# udev tests
# ------------------------------------------------------------------------------
TESTS = test/udev-test.pl test/rules-test.sh
check_PROGRAMS = \
libudev_test_libudev_SOURCES = libudev/test-libudev.c
libudev_test_libudev_LDADD = libudev/libudev.la
udev_test_udev_SOURCES = \
$(udev_common_sources) \
udev_test_udev_LDADD = libudev/libudev-private.la
# ------------------------------------------------------------------------------
# rule_generator - persistent network and optical device rule generator
# ------------------------------------------------------------------------------
dist_libexec_SCRIPTS = \
udevhomedir = $(libexecdir)
dist_udevhome_DATA = extras/rule_generator/rule_generator.functions
dist_udevrules_DATA += \
# ------------------------------------------------------------------------------
# firmware - firmware loading
# ------------------------------------------------------------------------------
extras_firmware_firmware_SOURCES = extras/firmware/firmware.c
extras_firmware_firmware_LDADD = libudev/libudev-private.la
extras_firmware_firmware_CPPFLAGS = $(AM_CPPFLAGS) -DFIRMWARE_PATH="$(FIRMWARE_PATH)"
dist_udevrules_DATA += extras/firmware/50-firmware.rules
libexec_PROGRAMS = extras/firmware/firmware
# ------------------------------------------------------------------------------
# ata_id - ATA identify
# ------------------------------------------------------------------------------
extras_ata_id_ata_id_SOURCES = extras/ata_id/ata_id.c
extras_ata_id_ata_id_LDADD = libudev/libudev-private.la
libexec_PROGRAMS += extras/ata_id/ata_id
# ------------------------------------------------------------------------------
# cdrom_id - optical drive/media capability
# ------------------------------------------------------------------------------
extras_cdrom_id_cdrom_id_SOURCES = extras/cdrom_id/cdrom_id.c
extras_cdrom_id_cdrom_id_LDADD = libudev/libudev-private.la
libexec_PROGRAMS += extras/cdrom_id/cdrom_id
dist_udevrules_DATA += extras/cdrom_id/60-cdrom_id.rules
# ------------------------------------------------------------------------------
# collect - trigger action when a collection of devices appeared
# ------------------------------------------------------------------------------
extras_collect_collect_SOURCES = extras/collect/collect.c
extras_collect_collect_LDADD = libudev/libudev-private.la
libexec_PROGRAMS += extras/collect/collect
# ------------------------------------------------------------------------------
# edd_id - BIOS EDD block device match
# ------------------------------------------------------------------------------
extras_edd_id_edd_id_SOURCES = extras/edd_id/edd_id.c
extras_edd_id_edd_id_LDADD = libudev/libudev-private.la
libexec_PROGRAMS += extras/edd_id/edd_id
dist_udevrules_DATA += extras/edd_id/61-persistent-storage-edd.rules
# ------------------------------------------------------------------------------
# create_floppy_devices - historical floppy kernel device nodes (/dev/fd0h1440, ...)
# ------------------------------------------------------------------------------
extras_floppy_create_floppy_devices_SOURCES = extras/floppy/create_floppy_devices.c
extras_floppy_create_floppy_devices_LDADD = libudev/libudev-private.la
libexec_PROGRAMS += extras/floppy/create_floppy_devices
dist_udevrules_DATA += extras/floppy/60-floppy.rules
# ------------------------------------------------------------------------------
# input_id - import input device class
# ------------------------------------------------------------------------------
extras_input_id_input_id_SOURCES = extras/input_id/input_id.c
extras_input_id_input_id_LDADD = libudev/libudev-private.la
libexec_PROGRAMS += extras/input_id/input_id
# ------------------------------------------------------------------------------
# path_id - compose identifier of persistent elements of the parent buses
# ------------------------------------------------------------------------------
extras_path_id_path_id_SOURCES = extras/path_id/path_id.c
extras_path_id_path_id_LDADD = libudev/libudev-private.la
libexec_PROGRAMS += extras/path_id/path_id
# ------------------------------------------------------------------------------
# fstab_import - import /etc/fstab entry for block device
# ------------------------------------------------------------------------------
extras_fstab_import_fstab_import_SOURCES = extras/fstab_import/fstab_import.c
extras_fstab_import_fstab_import_LDADD = libudev/libudev-private.la
libexec_PROGRAMS += extras/fstab_import/fstab_import
dist_udevrules_DATA += extras/fstab_import/79-fstab_import.rules
# ------------------------------------------------------------------------------
# scsi_id - SCSI inquiry to get various serial numbers
# ------------------------------------------------------------------------------
extras_scsi_id_scsi_id_SOURCES =\
extras_scsi_id_scsi_id_LDADD = libudev/libudev-private.la
libexec_PROGRAMS += extras/scsi_id/scsi_id
dist_man_MANS += extras/scsi_id/scsi_id.8
# ------------------------------------------------------------------------------
# usb_id - USB device property import
# ------------------------------------------------------------------------------
extras_usb_id_usb_id_SOURCES = extras/usb_id/usb_id.c
extras_usb_id_usb_id_LDADD = libudev/libudev-private.la
libexec_PROGRAMS += extras/usb_id/usb_id
# ------------------------------------------------------------------------------
# v4l_id - video4linux capabilities
# ------------------------------------------------------------------------------
extras_v4l_id_v4l_id_SOURCES = extras/v4l_id/v4l_id.c
extras_v4l_id_v4l_id_LDADD = libudev/libudev-private.la
libexec_PROGRAMS += extras/v4l_id/v4l_id
dist_udevrules_DATA += extras/v4l_id/60-persistent-v4l.rules
if ENABLE_EXTRAS
# ------------------------------------------------------------------------------
# conditional extras (need glib, libusb, libacl, ...)
# ------------------------------------------------------------------------------
dist_udevrules_DATA += \
# ------------------------------------------------------------------------------
# GUdev - libudev gobject interface
# ------------------------------------------------------------------------------
LIBGUDEV_CURRENT=0
LIBGUDEV_REVISION=1
LIBGUDEV_AGE=0
SUBDIRS += extras/gudev/docs
libgudev_includedir=$(includedir)/gudev-1.0/gudev
libgudev_include_HEADERS = \
lib_LTLIBRARIES += extras/gudev/libgudev-1.0.la
pkgconfig_DATA += extras/gudev/gudev-1.0.pc
extras_gudev_libgudev_1_0_la_SOURCES = \
dist_extras_gudev_libgudev_1_0_la_SOURCES = \
BUILT_SOURCES = $(dist_extras_gudev_libgudev_1_0_la_SOURCES)
extras_gudev_libgudev_1_0_la_CPPFLAGS = \
$(AM_CPPFLAGS) \
-I$(top_builddir)/extras \
-I$(top_srcdir)/extras \
-I$(top_builddir)/extras/gudev \
-I$(top_srcdir)/extras/gudev \
-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \
-D_GUDEV_COMPILATION \
-DG_LOG_DOMAIN=\"GUdev\"
extras_gudev_libgudev_1_0_la_CFLAGS = $(GLIB_CFLAGS)
extras_gudev_libgudev_1_0_la_LIBADD = libudev/libudev.la $(GLIB_LIBS)
extras_gudev_libgudev_1_0_la_LDFLAGS = \
-version-info $(LIBGUDEV_CURRENT):$(LIBGUDEV_REVISION):$(LIBGUDEV_AGE) \
-export-dynamic -no-undefined \
-export-symbols-regex '^g_udev_.*'
EXTRA_DIST += \
$(AM_V_GEN)glib-genmarshal $< --prefix=g_udev_marshal --header > $@
$(AM_V_GEN)echo "#include \"gudevmarshal.h\"" > $@ && \
glib-genmarshal $< --prefix=g_udev_marshal --body >> $@
$(AM_V_GEN)glib-mkenums --template $^ > \
$@.tmp && mv $@.tmp $@
$(AM_V_GEN)glib-mkenums --template $^ > \
$@.tmp && mv $@.tmp $@
if ENABLE_INTROSPECTION
$(AM_V_GEN)PKG_CONFIG_PATH=$(top_builddir)/data:$$PKG_CONFIG_PATH \
LD_LIBRARY_PATH=$(top_builddir)/extras/gudev:$$LD_LIBRARY_PATH \
$(G_IR_SCANNER) -v \
--namespace GUdev \
--nsversion=1.0 \
--include=GObject-2.0 \
--library=gudev-1.0 \
--library-path=extras/gudev \
--output $@ \
--pkg=glib-2.0 \
--pkg=gobject-2.0 \
-I$(top_builddir)/extras \
-I$(top_srcdir)/extras \
-D_GUDEV_COMPILATION \
-D_GUDEV_WORK_AROUND_DEV_T_BUG \
$(top_srcdir)/extras/gudev/gudev.h \
$(top_srcdir)/extras/gudev/gudevtypes.h \
$(top_srcdir)/extras/gudev/gudevenums.h \
$(or $(wildcard $(top_builddir)/extras/gudev/gudevenumtypes.h),$(top_srcdir)/extras/gudev/gudevenumtypes.h) \
$(top_srcdir)/extras/gudev/gudevclient.h \
$(top_srcdir)/extras/gudev/gudevdevice.h \
$(top_srcdir)/extras/gudev/gudevclient.c \
$(top_srcdir)/extras/gudev/gudevdevice.c
extras/gudev/GUdev-1.0.typelib: extras/gudev/GUdev-1.0.gir $(G_IR_COMPILER)
$(AM_V_GEN)g-ir-compiler $< -o $@
girdir = $(GIRDIR)
gir_DATA = extras/gudev/GUdev-1.0.gir
typelibsdir = $(GIRTYPELIBDIR)
typelibs_DATA = extras/gudev/GUdev-1.0.typelib
CLEANFILES += $(gir_DATA) $(typelibs_DATA)
endif # ENABLE_INTROSPECTION
# ------------------------------------------------------------------------------
# Bluetooth HID devices with special magic to switch the device
# ------------------------------------------------------------------------------
extras_hid2hci_hid2hci_SOURCES = extras/hid2hci/hid2hci.c
extras_hid2hci_hid2hci_CPPFLAGS = $(AM_CPPFLAGS) $(LIBUSB_CFLAGS)
extras_hid2hci_hid2hci_LDADD = libudev/libudev-private.la $(LIBUSB_LIBS)
dist_udevrules_DATA += extras/hid2hci/70-hid2hci.rules
libexec_PROGRAMS += extras/hid2hci/hid2hci
# ------------------------------------------------------------------------------
# udev_acl - apply ACLs for users with local forground sessions
# ------------------------------------------------------------------------------
extras_udev_acl_udev_acl_SOURCES = extras/udev-acl/udev-acl.c
extras_udev_acl_udev_acl_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
extras_udev_acl_udev_acl_LDADD = libudev/libudev-private.la -lacl $(GLIB_LIBS)
dist_udevrules_DATA += extras/udev-acl/70-acl.rules
libexec_PROGRAMS += extras/udev-acl/udev-acl
udevacl-install-hook:
mkdir -p $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d
ln -sf $(libexecdir)/udev-acl $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d/udev-acl.ck
INSTALL_EXEC_HOOKS += udevacl-install-hook
# ------------------------------------------------------------------------------
# usb-db - read USB vendor/device string database
# ------------------------------------------------------------------------------
extras_usb_db_usb_db_SOURCES = extras/usb-db/usb-db.c
extras_usb_db_usb_db_CPPFLAGS = $(AM_CPPFLAGS) -DUSB_DATABASE=\"$(USB_DATABASE)\" -DBUILD_FOR_USB
extras_usb_db_usb_db_LDADD = libudev/libudev-private.la
libexec_PROGRAMS += extras/usb-db/usb-db
# ------------------------------------------------------------------------------
# pci-db - read PCI vendor/device string database
# ------------------------------------------------------------------------------
extras_usb_db_pci_db_SOURCES = extras/usb-db/usb-db.c
extras_usb_db_pci_db_CPPFLAGS = $(AM_CPPFLAGS) -DPCI_DATABASE=\"$(PCI_DATABASE)\" -DBUILD_FOR_PCI
extras_usb_db_pci_db_LDADD = libudev/libudev-private.la
libexec_PROGRAMS += extras/usb-db/pci-db
# ------------------------------------------------------------------------------
# mobile-action-modeswitch - switch Mobile Action cables into serial mode
# ------------------------------------------------------------------------------
extras_mobile_action_modeswitch_mobile_action_modeswitch_SOURCES =\
extras_mobile_action_modeswitch_mobile_action_modeswitch_CPPFLAGS = $(AM_CPPFLAGS) $(LIBUSB_CFLAGS)
extras_mobile_action_modeswitch_mobile_action_modeswitch_LDADD = libudev/libudev-private.la $(LIBUSB_LIBS)
dist_udevrules_DATA += \
libexec_PROGRAMS += extras/mobile-action-modeswitch/mobile-action-modeswitch
# ------------------------------------------------------------------------------
# mtd_probe - autoloads FTL module for mtd devices
# ------------------------------------------------------------------------------
extras_mtd_probe_mtd_probe_SOURCES = \
extras_mtd_probe_mtd_probe_CPPFLAGS = $(AM_CPPFLAGS)
dist_udevrules_DATA += extras/mtd_probe/75-probe_mtd.rules
libexec_PROGRAMS += extras/mtd_probe/mtd_probe
# ------------------------------------------------------------------------------
# keymap - map custom hardware's multimedia keys
# ------------------------------------------------------------------------------
extras_keymap_keymap_SOURCES = extras/keymap/keymap.c
extras_keymap_keymap_CPPFLAGS = $(AM_CPPFLAGS) -I extras/keymap
nodist_extras_keymap_keymap_SOURCES = \
BUILT_SOURCES += $(nodist_extras_keymap_keymap_SOURCES)
EXTRA_DIST += extras/keymap/check-keymaps.sh
dist_udevrules_DATA += extras/keymap/95-keymap.rules
dist_udevrules_DATA += extras/keymap/95-keyboard-force-release.rules
libexec_PROGRAMS += extras/keymap/keymap
dist_libexec_SCRIPTS += extras/keymap/findkeyboards
dist_libexec_SCRIPTS += extras/keymap/keyboard-force-release.sh
dist_doc_DATA = extras/keymap/README.keymap.txt
CLEANFILES += \
udevkeymapdir = $(libexecdir)/keymaps
dist_udevkeymap_DATA = \
udevkeymapforcereldir = $(libexecdir)/keymaps/force-release
dist_udevkeymapforcerel_DATA = \
extras/keymap/keys.txt: $(INCLUDE_PREFIX)/linux/input.h
$(AM_V_at)mkdir -p extras/keymap
$(AM_V_GEN)$(AWK) '/^#define.*KEY_[^ ]+[ \t]+[0-9]/ { if ($$2 != "KEY_MAX") { print $$2 } }' < $< | sed 's/^KEY_COFFEE$$/KEY_SCREENLOCK/' > $@
$(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print $$1 ", " $$1 }' < $< > $@
$(AM_V_GEN)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_key -H hash_key_name -p -C < $< > $@
$(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@
keymaps-distcheck-hook: extras/keymap/keys.txt
$(top_srcdir)/extras/keymap/check-keymaps.sh $(top_srcdir) $^
DISTCHECK_HOOKS += keymaps-distcheck-hook
endif # ENABLE_EXTRAS
# ------------------------------------------------------------------------------
# install, uninstall, clean hooks
# ------------------------------------------------------------------------------
clean-local:
rm -rf udev-test-install
distclean-local:
rm -rf autom4te.cache
CLEANFILES += \
udev-$(VERSION).tar.gz \
udev-$(VERSION).tar.bz2 \
$(BUILT_SOURCES)
EXTRA_DIST += $(TESTS)
EXTRA_DIST += test/rule-syntax-check.py
install-exec-hook: $(INSTALL_EXEC_HOOKS)
install-data-hook: $(INSTALL_DATA_HOOKS)
uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
distcheck-hook: $(DISTCHECK_HOOKS)
# ------------------------------------------------------------------------------
# custom release helpers
# ------------------------------------------------------------------------------
PREVIOUS_VERSION = `expr $(VERSION) - 1`
changelog:
@ head -1 ChangeLog | grep -q "to v$(PREVIOUS_VERSION)"
@ mv ChangeLog ChangeLog.tmp
@ echo "Summary of changes from v$(PREVIOUS_VERSION) to v$(VERSION)" >> ChangeLog
@ echo "============================================" >> ChangeLog
@ echo >> ChangeLog
@ git log --pretty=short $(PREVIOUS_VERSION)..HEAD | git shortlog >> ChangeLog
@ echo >> ChangeLog
@ cat ChangeLog
@ cat ChangeLog.tmp >> ChangeLog
@ rm ChangeLog.tmp
test-install:
rm -rf $(PWD)/udev-test-install/
make DESTDIR=$(PWD)/udev-test-install install
tree $(PWD)/udev-test-install/
git-release:
head -1 ChangeLog | grep -q "to v$(VERSION)"
head -1 NEWS | grep -q "udev $(VERSION)"
git commit -a -m "release $(VERSION)"
cat .git/refs/heads/master > .git/refs/tags/$(VERSION)
git gc
git prune
doc-sync: