Makefile.am revision 8e90942c7af2508f88c7284a0b116caf7ec854a9
# ------------------------------------------------------------------------------
# Copyright (C) 2008-2012 Kay Sievers <kay.sievers@vrfy.org>
# Copyright (C) 2009 Diego Elio 'Flameeyes' Pettenò <flameeyes@gmail.com>
# ------------------------------------------------------------------------------
SUBDIRS = .
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
AM_MAKEFLAGS = --no-print-directory
AM_CPPFLAGS = \
-include $(top_builddir)/config.h \
-I$(top_srcdir)/src \
-DSYSCONFDIR=\""$(sysconfdir)"\" \
-DPKGLIBEXECDIR=\""$(libexecdir)/udev"\"
AM_CFLAGS = \
${my_CFLAGS} \
-fvisibility=hidden \
-ffunction-sections \
-fdata-sections
AM_LDFLAGS = \
-Wl,--gc-sections \
-Wl,--as-needed
DISTCHECK_CONFIGURE_FLAGS = \
--enable-debug \
--enable-rule_generator \
--enable-floppy \
--with-selinux \
--enable-gtk-doc \
--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
BUILT_SOURCES =
EXTRA_DIST =
CLEANFILES =
INSTALL_EXEC_HOOKS =
INSTALL_DATA_HOOKS =
UNINSTALL_EXEC_HOOKS =
DISTCHECK_HOOKS =
DISTCLEAN_LOCAL_HOOKS =
udevhomedir = $(libexecdir)/udev
udevhome_SCRIPTS =
dist_udevhome_SCRIPTS =
dist_udevhome_DATA =
dist_man_MANS =
SED_PROCESS = \
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
-e 's,@VERSION\@,$(VERSION),g' \
-e 's,@prefix\@,$(prefix),g' \
-e 's,@rootprefix\@,$(rootprefix),g' \
-e 's,@exec_prefix\@,$(exec_prefix),g' \
-e 's,@libdir\@,$(libdir),g' \
-e 's,@includedir\@,$(includedir),g' \
-e 's,@bindir\@,$(bindir),g' \
-e 's,@pkglibexecdir\@,$(libexecdir)/udev,g' \
< $< > $@ || rm $@
%.pc: %.pc.in Makefile
$(SED_PROCESS)
%.rules: %.rules.in Makefile
$(SED_PROCESS)
%.service: %.service.in Makefile
$(SED_PROCESS)
%.sh: %.sh.in Makefile
$(SED_PROCESS)
$(AM_V_GEN)chmod +x $@
%.pl: %.pl.in Makefile
$(SED_PROCESS)
$(AM_V_GEN)chmod +x $@
# ------------------------------------------------------------------------------
# libudev
# ------------------------------------------------------------------------------
LIBUDEV_CURRENT=13
LIBUDEV_REVISION=1
LIBUDEV_AGE=13
SUBDIRS += src/docs
include_HEADERS = src/libudev.h
lib_LTLIBRARIES = src/libudev.la
src_libudev_la_SOURCES =\
src_libudev_la_LDFLAGS = \
$(AM_LDFLAGS) \
-version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE)
noinst_LTLIBRARIES = \
src_libudev_private_la_SOURCES =\
$(src_libudev_la_SOURCES) \
if WITH_SELINUX
src_libudev_private_la_SOURCES += src/libudev-selinux-private.c
src_libudev_private_la_LIBADD = $(SELINUX_LIBS)
endif
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = src/libudev.pc
EXTRA_DIST += src/libudev.pc.in
CLEANFILES += src/libudev.pc
EXTRA_DIST += src/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)/udev/devices
INSTALL_DATA_HOOKS += udev-confdirs
udevrulesdir = $(libexecdir)/udev/rules.d
dist_udevrules_DATA = \
rules/42-qemu-usb.rules \
rules/50-udev-default.rules \
rules/60-persistent-storage-tape.rules \
rules/60-persistent-serial.rules \
rules/60-persistent-input.rules \
rules/60-persistent-alsa.rules \
rules/60-persistent-storage.rules \
rules/75-net-description.rules \
rules/75-tty-description.rules \
rules/78-sound-card.rules \
rules/80-drivers.rules \
rules/95-udev-late.rules
udevconfdir = $(sysconfdir)/udev
dist_udevconf_DATA = src/udev.conf
sharepkgconfigdir = $(datadir)/pkgconfig
sharepkgconfig_DATA = src/udev.pc
EXTRA_DIST += src/udev.pc.in
CLEANFILES += src/udev.pc
if WITH_SYSTEMD
dist_systemdsystemunit_DATA = \
systemdsystemunit_DATA = \
EXTRA_DIST += \
CLEANFILES += \
systemd-install-hook:
mkdir -p $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants
ln -sf ../udev-control.socket $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants/udev-control.socket
ln -sf ../udev-kernel.socket $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants/udev-kernel.socket
mkdir -p $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants
ln -sf ../udev.service $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants/udev.service
ln -sf ../udev-trigger.service $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants/udev-trigger.service
INSTALL_DATA_HOOKS += systemd-install-hook
endif
bin_PROGRAMS = \
pkglibexec_PROGRAMS = \
udev_common_sources = \
udev_common_CFLAGS = \
$(BLKID_CFLAGS) \
$(KMOD_CFLAGS)
udev_common_LDADD = \
$(BLKID_LIBS) \
$(KMOD_LIBS)
udev_common_CPPFLAGS = \
$(AM_CPPFLAGS) \
-DFIRMWARE_PATH="$(FIRMWARE_PATH)" \
-DUSB_DATABASE=\"$(USB_DATABASE)\" -DPCI_DATABASE=\"$(PCI_DATABASE)\"
src_udevd_SOURCES = \
$(udev_common_sources) \
src_udevd_CFLAGS = $(udev_common_CFLAGS)
src_udevd_LDADD = $(udev_common_LDADD)
src_udevd_CPPFLAGS = $(udev_common_CPPFLAGS)
src_udevadm_SOURCES = \
$(udev_common_sources) \
src_udevadm_CFLAGS = $(udev_common_CFLAGS)
src_udevadm_LDADD = $(udev_common_LDADD)
src_udevadm_CPPFLAGS = $(udev_common_CPPFLAGS)
# ------------------------------------------------------------------------------
# udev man pages
# ------------------------------------------------------------------------------
if ENABLE_MANPAGES
dist_man_MANS += \
endif
EXTRA_DIST += \
if HAVE_XSLTPROC
dist_noinst_DATA = \
src/%.7 src/%.8 : src/%.xml
$(AM_V_GEN)$(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
src/%.html : src/%.xml
$(AM_V_GEN)$(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $<
endif
# ------------------------------------------------------------------------------
# udev tests
# ------------------------------------------------------------------------------
TESTS = \
check_PROGRAMS = \
src_test_libudev_SOURCES = src/test-libudev.c
src_test_libudev_LDADD = src/libudev.la
src_test_udev_SOURCES = \
$(udev_common_sources) \
src_test_udev_CFLAGS = $(udev_common_CFLAGS)
src_test_udev_LDADD = $(udev_common_LDADD)
src_test_udev_CPPFLAGS = $(udev_common_CPPFLAGS)
src_test_udev_DEPENDENCIES = test/sys
# packed sysfs test tree
$(AM_V_GEN)mkdir -p test && tar -C test/ -xJf $(top_srcdir)/test/sys.tar.xz
test-sys-distclean:
-rm -rf test/sys
DISTCLEAN_LOCAL_HOOKS += test-sys-distclean
EXTRA_DIST += test/sys.tar.xz
# ------------------------------------------------------------------------------
# ata_id - ATA identify
# ------------------------------------------------------------------------------
src_ata_id_ata_id_SOURCES = src/ata_id/ata_id.c
src_ata_id_ata_id_LDADD = src/libudev-private.la
pkglibexec_PROGRAMS += src/ata_id/ata_id
# ------------------------------------------------------------------------------
# cdrom_id - optical drive/media capability
# ------------------------------------------------------------------------------
src_cdrom_id_cdrom_id_SOURCES = src/cdrom_id/cdrom_id.c
src_cdrom_id_cdrom_id_LDADD = src/libudev-private.la
pkglibexec_PROGRAMS += src/cdrom_id/cdrom_id
dist_udevrules_DATA += src/cdrom_id/60-cdrom_id.rules
# ------------------------------------------------------------------------------
# collect - trigger action when a collection of devices appeared
# ------------------------------------------------------------------------------
src_collect_collect_SOURCES = src/collect/collect.c
src_collect_collect_LDADD = src/libudev-private.la
pkglibexec_PROGRAMS += src/collect/collect
# ------------------------------------------------------------------------------
# scsi_id - SCSI inquiry to get various serial numbers
# ------------------------------------------------------------------------------
src_scsi_id_scsi_id_SOURCES =\
src_scsi_id_scsi_id_LDADD = src/libudev-private.la
pkglibexec_PROGRAMS += src/scsi_id/scsi_id
dist_man_MANS += src/scsi_id/scsi_id.8
EXTRA_DIST += src/scsi_id/README
# ------------------------------------------------------------------------------
# v4l_id - video4linux capabilities
# ------------------------------------------------------------------------------
src_v4l_id_v4l_id_SOURCES = src/v4l_id/v4l_id.c
src_v4l_id_v4l_id_LDADD = src/libudev-private.la
pkglibexec_PROGRAMS += src/v4l_id/v4l_id
dist_udevrules_DATA += src/v4l_id/60-persistent-v4l.rules
# ------------------------------------------------------------------------------
# accelerometer - updates device orientation
# ------------------------------------------------------------------------------
src_accelerometer_accelerometer_SOURCES = src/accelerometer/accelerometer.c
src_accelerometer_accelerometer_LDADD = src/libudev-private.la -lm
pkglibexec_PROGRAMS += src/accelerometer/accelerometer
dist_udevrules_DATA += src/accelerometer/61-accelerometer.rules
if ENABLE_GUDEV
# ------------------------------------------------------------------------------
# GUdev - libudev gobject interface
# ------------------------------------------------------------------------------
LIBGUDEV_CURRENT=1
LIBGUDEV_REVISION=1
LIBGUDEV_AGE=1
SUBDIRS += src/gudev/docs
src_gudev_libgudev_includedir=$(includedir)/gudev-1.0/gudev
src_gudev_libgudev_include_HEADERS = \
lib_LTLIBRARIES += src/gudev/libgudev-1.0.la
pkgconfig_DATA += src/gudev/gudev-1.0.pc
EXTRA_DIST += src/gudev/gudev-1.0.pc.in
CLEANFILES += src/gudev/gudev-1.0.pc
src_gudev_libgudev_1_0_la_SOURCES = \
nodist_src_gudev_libgudev_1_0_la_SOURCES = \
BUILT_SOURCES += $(nodist_src_gudev_libgudev_1_0_la_SOURCES)
src_gudev_libgudev_1_0_la_CPPFLAGS = \
$(AM_CPPFLAGS) \
-I$(top_builddir)/src\
-I$(top_srcdir)/src\
-I$(top_builddir)/src/gudev \
-I$(top_srcdir)/src/gudev \
-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \
-D_GUDEV_COMPILATION \
-DG_LOG_DOMAIN=\"GUdev\"
src_gudev_libgudev_1_0_la_CFLAGS = \
-fvisibility=default \
$(GLIB_CFLAGS)
src_gudev_libgudev_1_0_la_LIBADD = src/libudev.la $(GLIB_LIBS)
src_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
src/gudev/GUdev-1.0.gir: src/gudev/libgudev-1.0.la $(G_IR_SCANNER)
$(AM_V_GEN)$(G_IR_SCANNER) -v \
--warn-all \
--namespace GUdev \
--nsversion=1.0 \
--include=GObject-2.0 \
--library=gudev-1.0 \
--library-path=$(top_builddir)/src \
--library-path=$(top_builddir)/src/gudev \
--output $@ \
--pkg=glib-2.0 \
--pkg=gobject-2.0 \
--pkg-export=gudev-1.0 \
--c-include=gudev/gudev.h \
-I$(top_srcdir)/src/\
-I$(top_builddir)/src/\
-D_GUDEV_COMPILATION \
-D_GUDEV_WORK_AROUND_DEV_T_BUG \
$(top_srcdir)/src/gudev/gudev.h \
$(top_srcdir)/src/gudev/gudevtypes.h \
$(top_srcdir)/src/gudev/gudevenums.h \
$(or $(wildcard $(top_builddir)/src/gudev/gudevenumtypes.h),$(top_srcdir)/src/gudev/gudevenumtypes.h) \
$(top_srcdir)/src/gudev/gudevclient.h \
$(top_srcdir)/src/gudev/gudevdevice.h \
$(top_srcdir)/src/gudev/gudevenumerator.h \
$(top_srcdir)/src/gudev/gudevclient.c \
$(top_srcdir)/src/gudev/gudevdevice.c \
$(top_srcdir)/src/gudev/gudevenumerator.c
src/gudev/GUdev-1.0.typelib: src/gudev/GUdev-1.0.gir $(G_IR_COMPILER)
$(AM_V_GEN)g-ir-compiler $< -o $@
girdir = $(GIRDIR)
gir_DATA = src/gudev/GUdev-1.0.gir
typelibsdir = $(GIRTYPELIBDIR)
typelibs_DATA = src/gudev/GUdev-1.0.typelib
CLEANFILES += $(gir_DATA) $(typelibs_DATA)
endif # ENABLE_INTROSPECTION
# move lib from $(libdir) to $(rootlib_execdir) and update devel link, if needed
libgudev-install-move-hook:
if test "$(libdir)" != "$(rootlib_execdir)"; then \
mkdir -p $(DESTDIR)$(rootlib_execdir) && \
so_img_name=$$(readlink $(DESTDIR)$(libdir)/libgudev-1.0.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)/libgudev-1.0.so && \
mv $(DESTDIR)$(libdir)/libgudev-1.0.so.* $(DESTDIR)$(rootlib_execdir); \
fi
libgudev-uninstall-move-hook:
rm -f $(DESTDIR)$(rootlib_execdir)/libgudev-1.0.so*
INSTALL_EXEC_HOOKS += libgudev-install-move-hook
UNINSTALL_EXEC_HOOKS += libgudev-uninstall-move-hook
endif
if ENABLE_KEYMAP
# ------------------------------------------------------------------------------
# keymap - map custom hardware's multimedia keys
# ------------------------------------------------------------------------------
src_keymap_keymap_SOURCES = src/keymap/keymap.c
src_keymap_keymap_CPPFLAGS = $(AM_CPPFLAGS) -I src/keymap
nodist_src_keymap_keymap_SOURCES = \
BUILT_SOURCES += $(nodist_src_keymap_keymap_SOURCES)
pkglibexec_PROGRAMS += src/keymap/keymap
dist_doc_DATA = src/keymap/README.keymap.txt
dist_udevrules_DATA += \
dist_udevhome_SCRIPTS += src/keymap/findkeyboards
udevhome_SCRIPTS += src/keymap/keyboard-force-release.sh
EXTRA_DIST += \
CLEANFILES += \
udevkeymapdir = $(libexecdir)/udev/keymaps
dist_udevkeymap_DATA = \
udevkeymapforcereldir = $(libexecdir)/udev/keymaps/force-release
dist_udevkeymapforcerel_DATA = \
src/keymap/keys.txt: $(INCLUDE_PREFIX)/linux/input.h
$(AM_V_at)mkdir -p src/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 < $< > $@
src/keymap/keys-to-name.h: src/keymap/keys.txt Makefile
$(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@
keymaps-distcheck-hook: src/keymap/keys.txt
$(top_srcdir)/src/keymap/check-keymaps.sh $(top_srcdir) $^
DISTCHECK_HOOKS += keymaps-distcheck-hook
endif
if ENABLE_MTD_PROBE
# ------------------------------------------------------------------------------
# mtd_probe - autoloads FTL module for mtd devices
# ------------------------------------------------------------------------------
src_mtd_probe_mtd_probe_SOURCES = \
src_mtd_probe_mtd_probe_CPPFLAGS = $(AM_CPPFLAGS)
dist_udevrules_DATA += src/mtd_probe/75-probe_mtd.rules
pkglibexec_PROGRAMS += src/mtd_probe/mtd_probe
endif
if ENABLE_RULE_GENERATOR
# ------------------------------------------------------------------------------
# rule_generator - persistent network and optical device rule generator
# ------------------------------------------------------------------------------
dist_udevhome_SCRIPTS += \
dist_udevhome_DATA += \
dist_udevrules_DATA += \
endif
if ENABLE_FLOPPY
# ------------------------------------------------------------------------------
# create_floppy_devices - historical floppy kernel device nodes (/dev/fd0h1440, ...)
# ------------------------------------------------------------------------------
src_create_floppy_devices_SOURCES = src/floppy/create_floppy_devices.c
src_create_floppy_devices_LDADD = src/libudev-private.la
pkglibexec_PROGRAMS += src/create_floppy_devices
dist_udevrules_DATA += src/floppy/60-floppy.rules
endif
# ------------------------------------------------------------------------------
# install, uninstall, clean hooks
# ------------------------------------------------------------------------------
clean-local:
rm -rf udev-test-install
distclean-local:
rm -rf autom4te.cache
EXTRA_DIST += \
$(TESTS) \
CLEANFILES += \
$(BUILT_SOURCES)
install-exec-hook: $(INSTALL_EXEC_HOOKS)
install-data-hook: $(INSTALL_DATA_HOOKS)
uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
distcheck-hook: $(DISTCHECK_HOOKS)
distclean-local: $(DISTCLEAN_LOCAL_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)"
git tag -m "udev $(VERSION)" -s $(VERSION)
git gc --prune=0
git-sync:
git push
git push --tags
tar-sync:
rm -f udev-$(VERSION).tar.sign
doc-sync:
for i in src/*.html; do echo $$i; kup put $$i $$i.sign /pub/linux/utils/kernel/hotplug/udev/; done
for i in src/docs/html/*.{html,css,png}; do rm -f $$i.sign; gpg --armor --detach-sign --output=$$i.sign $$i; done
for i in src/docs/html/*.{html,css,png}; do echo $$i; kup put $$i $$i.sign /pub/linux/utils/kernel/hotplug/libudev/; done
for i in src/gudev/docs/html/*.{html,css,png}; do rm -f $$i.sign; gpg --armor --detach-sign --output=$$i.sign $$i; done
for i in src/gudev/docs/html/*.{html,css,png}; do echo $$i; kup put $$i $$i.sign /pub/linux/utils/kernel/hotplug/gudev/; done