1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00

Merge libudev, udev, and the unconditional extras in a single Makefile.am.

Instead of using multiple recursive Makefile.am files, use a single
Makefile.am that sets and builds all the basic suite of libraries and
binaries for udev. This reduces the number of files in the source tree, and
also reduces drastically the build time when using parallel-make.

With this setup, all the compile steps will be executed in parallel, and
just the linking stage will be (partially) serialised on the libraries
creation.
This commit is contained in:
Diego Elio 'Flameeyes' Pettenò 2009-08-07 02:01:29 +02:00 committed by Kay Sievers
parent 4de08374d0
commit 59d93adb29
20 changed files with 241 additions and 375 deletions

1
.gitignore vendored
View File

@ -5,6 +5,7 @@
*.la
.libs
.deps
.dirstamp
Makefile
Makefile.in
aclocal.m4

View File

@ -1,18 +1,14 @@
include $(top_srcdir)/Makefile.am.inc
SUBDIRS = \
docs \
libudev \
udev \
rules \
extras
SUBDIRS = . libudev/docs
udevconfdir = $(sysconfdir)/udev
dist_udevconf_DATA = \
udev.conf
EXTRA_DIST = \
autogen.sh
autogen.sh \
libudev/exported_symbols
CLEANFILES = \
udev-$(VERSION).tar.gz udev-$(VERSION).tar.bz2
@ -64,3 +60,239 @@ git-release:
doc-sync:
rsync -av --delete libudev/docs/html/ master.kernel.org:/pub/linux/utils/kernel/hotplug/libudev/
rsync -av --delete extras/gudev/docs/html/ master.kernel.org:/pub/linux/utils/kernel/hotplug/gudev/
include_HEADERS = libudev/libudev.h
# ------------------------------------------------------------------------------
# Libraries
# ------------------------------------------------------------------------------
lib_LTLIBRARIES = libudev/libudev.la
libudev_libudev_la_SOURCES =\
libudev/libudev-private.h \
libudev/libudev.c \
libudev/libudev-list.c \
libudev/libudev-util.c \
libudev/libudev-device.c \
libudev/libudev-enumerate.c \
libudev/libudev-monitor.c \
libudev/libudev-queue.c
LIBUDEV_CURRENT=5
LIBUDEV_REVISION=0
LIBUDEV_AGE=5
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
libudev_libudev_private_la_SOURCES =\
$(libudev_libudev_la_SOURCES) \
libudev/libudev-ctrl.c \
libudev/libudev-util-private.c \
libudev/libudev-device-private.c \
libudev/libudev-queue-private.c
libudev_libudev_private_la_LIBADD =
# ------------------------------------------------------------------------------
# Programs
# ------------------------------------------------------------------------------
sbin_PROGRAMS = \
udev/udevd \
udev/udevadm
udev_common_sources =\
udev/udev.h \
udev/udev-event.c \
udev/udev-watch.c \
udev/udev-node.c \
udev/udev-rules.c
udev_common_libs = libudev/libudev-private.la
udev_udevd_SOURCES = \
$(udev_common_sources) \
udev/udevd.c
udev_udevd_LDADD = $(udev_common_libs)
udev_udevadm_SOURCES = \
$(udev_common_sources) \
udev/udevadm.c \
udev/udevadm-info.c \
udev/udevadm-control.c \
udev/udevadm-test.c \
udev/udevadm-monitor.c \
udev/udevadm-settle.c \
udev/udevadm-trigger.c
udev_udevadm_LDADD = $(udev_common_libs)
libexec_PROGRAMS = \
extras/ata_id/ata_id \
extras/cdrom_id/cdrom_id \
extras/collect/collect \
extras/edd_id/edd_id \
extras/floppy/create_floppy_devices \
extras/path_id/path_id \
extras/fstab_import/fstab_import \
extras/scsi_id/scsi_id \
extras/usb_id/usb_id \
extras/v4l_id/v4l_id
dist_libexec_SCRIPTS = \
extras/firmware/firmware.sh \
extras/rule_generator/write_cd_rules \
extras/rule_generator/write_net_rules
udevhomedir = $(libexecdir)
dist_udevhome_DATA = \
extras/rule_generator/rule_generator.functions
extras_ata_id_ata_id_SOURCES = extras/ata_id/ata_id.c
extras_ata_id_ata_id_LDADD = libudev/libudev-private.la
extras_cdrom_id_cdrom_id_SOURCES = extras/cdrom_id/cdrom_id.c
extras_cdrom_id_cdrom_id_LDADD = libudev/libudev-private.la
extras_collect_collect_SOURCES = extras/collect/collect.c
extras_collect_collect_LDADD = libudev/libudev-private.la
extras_edd_id_edd_id_SOURCES = extras/edd_id/edd_id.c
extras_edd_id_edd_id_LDADD = libudev/libudev-private.la
extras_floppy_create_floppy_devices_SOURCES = extras/floppy/create_floppy_devices.c
extras_floppy_create_floppy_devices_LDADD = libudev/libudev-private.la
extras_path_id_path_id_SOURCES = extras/path_id/path_id.c
extras_path_id_path_id_LDADD = libudev/libudev-private.la
extras_fstab_import_fstab_import_SOURCES = extras/fstab_import/fstab_import.c
extras_fstab_import_fstab_import_LDADD = libudev/libudev-private.la
extras_scsi_id_scsi_id_SOURCES =\
extras/scsi_id/scsi_id.c \
extras/scsi_id/scsi_serial.c \
extras/scsi_id/scsi.h \
extras/scsi_id/scsi_id.h \
extras/scsi_id/bsg.h
extras_scsi_id_scsi_id_LDADD = libudev/libudev-private.la
extras_usb_id_usb_id_SOURCES = extras/usb_id/usb_id.c
extras_usb_id_usb_id_LDADD = libudev/libudev-private.la
extras_v4l_id_v4l_id_SOURCES = extras/v4l_id/v4l_id.c
extras_v4l_id_v4l_id_LDADD = libudev/libudev-private.la
# ------------------------------------------------------------------------------
# Tests
# ------------------------------------------------------------------------------
check_PROGRAMS = \
libudev/test-libudev \
udev/test-udev
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.c
udev_test_udev_LDADD = $(udev_common_libs)
# ------------------------------------------------------------------------------
# Basic rules
# ------------------------------------------------------------------------------
dist_udevrules_DATA = \
rules/rules.d/50-udev-default.rules \
rules/rules.d/60-persistent-storage.rules \
rules/rules.d/60-persistent-storage-tape.rules \
rules/rules.d/60-persistent-serial.rules \
rules/rules.d/60-persistent-input.rules \
rules/rules.d/60-persistent-alsa.rules \
rules/rules.d/80-drivers.rules \
rules/rules.d/95-udev-late.rules \
extras/rule_generator/75-cd-aliases-generator.rules \
extras/rule_generator/75-persistent-net-generator.rules \
extras/cdrom_id/60-cdrom_id.rules \
extras/edd_id/61-persistent-storage-edd.rules \
extras/firmware/50-firmware.rules \
extras/fstab_import/79-fstab_import.rules \
extras/v4l_id/60-persistent-v4l.rules
EXTRA_DIST += \
rules/packages \
rules/redhat \
rules/suse \
rules/gentoo
# ------------------------------------------------------------------------------
# Conditionals (SElinux, etc…)
# ------------------------------------------------------------------------------
if WITH_SELINUX
libudev_libudev_private_la_SOURCES += \
libudev/libudev-selinux-private.c
libudev_libudev_private_la_LIBADD += \
$(SELINUX_LIBS)
endif
if ENABLE_EXTRAS
dist_udevrules_DATA += \
rules/rules.d/75-net-description.rules \
rules/rules.d/75-tty-description.rules \
rules/rules.d/78-sound-card.rules
SUBDIRS += \
extras/udev-acl \
extras/usb-db \
extras/hid2hci \
extras/keymap \
extras/modem-modeswitch \
extras/gudev
endif
# ------------------------------------------------------------------------------
# Pkg-config, docs and man pages
# ------------------------------------------------------------------------------
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = \
libudev/libudev.pc \
udev/udev.pc
writing_udev_rulesdir = $(docdir)/writing_udev_rules
dist_writing_udev_rules_DATA = \
docs/writing_udev_rules/index.html
dist_man_MANS = \
udev/udev.7 \
udev/udevadm.8 \
udev/udevd.8 \
extras/scsi_id/scsi_id.8
EXTRA_DIST += \
udev/udev.xml \
udev/udevadm.xml \
udev/udevd.xml
%.7 %.8 : %.xml
$(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
# ------------------------------------------------------------------------------
# Install and uninstall hooks
# ------------------------------------------------------------------------------
# move lib from $(libdir) to $(rootlib_execdir) and update devel link, if needed
install-exec-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
uninstall-hook:
rm -f $(DESTDIR)$(rootlib_execdir)/libudev.so*

View File

@ -1,6 +1,6 @@
AC_INIT([udev], [146], [linux-hotplug@vger.kernel.org])
AC_PREREQ(2.60)
AM_INIT_AUTOMAKE([check-news foreign 1.9 dist-bzip2])
AM_INIT_AUTOMAKE([check-news foreign 1.9 dist-bzip2 subdir-objects])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_DISABLE_STATIC
AC_USE_SYSTEM_EXTENSIONS
@ -101,27 +101,10 @@ AM_CONDITIONAL([ENABLE_INTROSPECTION], [test "x$enable_introspection" = xyes])
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_FILES([
Makefile
docs/Makefile
libudev/Makefile
libudev/libudev.pc
libudev/docs/Makefile
libudev/docs/version.xml
udev/Makefile
udev/udev.pc
rules/Makefile
extras/Makefile
extras/ata_id/Makefile
extras/cdrom_id/Makefile
extras/edd_id/Makefile
extras/path_id/Makefile
extras/firmware/Makefile
extras/collect/Makefile
extras/floppy/Makefile
extras/fstab_import/Makefile
extras/rule_generator/Makefile
extras/scsi_id/Makefile
extras/usb_id/Makefile
extras/v4l_id/Makefile
extras/hid2hci/Makefile
extras/udev-acl/Makefile
extras/usb-db/Makefile

View File

@ -1,5 +0,0 @@
include $(top_srcdir)/Makefile.am.inc
writing_udev_rulesdir = $(docdir)/writing_udev_rules
dist_writing_udev_rules_DATA = \
writing_udev_rules/index.html

View File

@ -1,25 +0,0 @@
include $(top_srcdir)/Makefile.am.inc
SUBDIRS = \
ata_id \
cdrom_id \
edd_id \
path_id \
firmware \
collect \
floppy \
fstab_import \
rule_generator \
scsi_id \
usb_id \
v4l_id
if ENABLE_EXTRAS
SUBDIRS += \
udev-acl \
usb-db \
hid2hci \
keymap \
modem-modeswitch \
gudev
endif

View File

@ -1,11 +0,0 @@
include $(top_srcdir)/Makefile.am.inc
libexec_PROGRAMS = \
ata_id
ata_id_SOURCES = \
ata_id.c
ata_id_LDADD = \
$(top_builddir)/libudev/libudev-private.la

View File

@ -1,13 +0,0 @@
include $(top_srcdir)/Makefile.am.inc
libexec_PROGRAMS = \
cdrom_id
dist_udevrules_DATA = \
60-cdrom_id.rules
cdrom_id_SOURCES = \
cdrom_id.c
cdrom_id_LDADD = \
$(top_builddir)/libudev/libudev-private.la

View File

@ -1,11 +0,0 @@
include $(top_srcdir)/Makefile.am.inc
libexec_PROGRAMS = \
collect
collect_SOURCES = \
collect.c
collect_LDADD = \
$(top_builddir)/libudev/libudev-private.la

View File

@ -1,14 +0,0 @@
include $(top_srcdir)/Makefile.am.inc
libexec_PROGRAMS = \
edd_id
dist_udevrules_DATA = \
61-persistent-storage-edd.rules
edd_id_SOURCES = \
edd_id.c
edd_id_LDADD = \
$(top_builddir)/libudev/libudev-private.la

View File

@ -1,7 +0,0 @@
include $(top_srcdir)/Makefile.am.inc
dist_libexec_SCRIPTS = \
firmware.sh
dist_udevrules_DATA = \
50-firmware.rules

View File

@ -1,15 +0,0 @@
include $(top_srcdir)/Makefile.am.inc
libexec_PROGRAMS = \
create_floppy_devices
create_floppy_devices_SOURCES = \
create_floppy_devices.c
create_floppy_devices_LDADD = \
$(top_builddir)/libudev/libudev-private.la
if WITH_SELINUX
create_floppy_devices_LDADD += \
$(SELINUX_LIBS)
endif

View File

@ -1,13 +0,0 @@
include $(top_srcdir)/Makefile.am.inc
libexec_PROGRAMS = \
fstab_import
dist_udevrules_DATA = \
79-fstab_import.rules
fstab_import_SOURCES = \
fstab_import.c
fstab_import_LDADD = \
$(top_builddir)/libudev/libudev-private.la

View File

@ -1,11 +0,0 @@
include $(top_srcdir)/Makefile.am.inc
libexec_PROGRAMS = \
path_id
path_id_SOURCES = \
path_id.c
path_id_LDADD = \
$(top_builddir)/libudev/libudev-private.la

View File

@ -1,14 +0,0 @@
include $(top_srcdir)/Makefile.am.inc
dist_libexec_SCRIPTS = \
write_cd_rules \
write_net_rules
udevhomedir = $(libexecdir)
dist_udevhome_DATA = \
rule_generator.functions
dist_udevrules_DATA = \
75-cd-aliases-generator.rules \
75-persistent-net-generator.rules

View File

@ -1,18 +0,0 @@
include $(top_srcdir)/Makefile.am.inc
libexec_PROGRAMS = \
scsi_id
scsi_id_SOURCES = \
scsi_id.c \
scsi_serial.c \
scsi.h \
scsi_id.h \
bsg.h
scsi_id_LDADD = \
$(top_builddir)/libudev/libudev-private.la
dist_man_MANS = \
scsi_id.8

View File

@ -1,11 +0,0 @@
include $(top_srcdir)/Makefile.am.inc
libexec_PROGRAMS = \
usb_id
usb_id_SOURCES = \
usb_id.c
usb_id_LDADD = \
$(top_builddir)/libudev/libudev-private.la

View File

@ -1,10 +0,0 @@
include $(top_srcdir)/Makefile.am.inc
libexec_PROGRAMS = \
v4l_id
dist_udevrules_DATA = \
60-persistent-v4l.rules
v4l_id_SOURCES = \
v4l_id.c

View File

@ -1,71 +0,0 @@
include $(top_srcdir)/Makefile.am.inc
SUBDIRS = \
docs
noinst_PROGRAMS = \
test-libudev
test_libudev_SOURCES = \
test-libudev.c
test_libudev_LDADD = \
libudev.la
lib_LTLIBRARIES = \
libudev.la
include_HEADERS =\
libudev.h
libudev_la_SOURCES =\
libudev-private.h \
libudev.c \
libudev-list.c \
libudev-util.c \
libudev-device.c \
libudev-enumerate.c \
libudev-monitor.c \
libudev-queue.c
noinst_LTLIBRARIES = \
libudev-private.la
libudev_private_la_SOURCES =\
$(libudev_la_SOURCES) \
libudev-ctrl.c \
libudev-util-private.c \
libudev-device-private.c \
libudev-queue-private.c
if WITH_SELINUX
libudev_private_la_SOURCES += \
libudev-selinux-private.c
endif
LT_CURRENT=5
LT_REVISION=0
LT_AGE=5
libudev_la_LDFLAGS = \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
-export-symbols $(top_srcdir)/libudev/exported_symbols
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = \
libudev.pc
EXTRA_DIST = \
exported_symbols
# move lib from $(libdir) to $(rootlib_execdir) and update devel link, if needed
install-exec-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
uninstall-hook:
rm -f $(DESTDIR)$(rootlib_execdir)/libudev.so*

View File

@ -1,27 +0,0 @@
include $(top_srcdir)/Makefile.am.inc
dist_udevrules_DATA = \
rules.d/50-udev-default.rules \
rules.d/60-persistent-storage.rules \
rules.d/60-persistent-storage-tape.rules \
rules.d/60-persistent-serial.rules \
rules.d/60-persistent-input.rules \
rules.d/60-persistent-alsa.rules \
rules.d/80-drivers.rules \
rules.d/95-udev-late.rules
if ENABLE_EXTRAS
dist_udevrules_DATA += \
rules.d/75-net-description.rules \
rules.d/75-tty-description.rules \
rules.d/78-sound-card.rules
endif
install-data-local:
-mkdir -p $(DESTDIR)$(sysconfdir)/udev/rules.d
EXTRA_DIST = \
packages \
redhat \
suse \
gentoo

View File

@ -1,74 +0,0 @@
include $(top_srcdir)/Makefile.am.inc
sbin_PROGRAMS = \
udevd \
udevadm
noinst_PROGRAMS = \
test-udev
common_files =\
udev.h \
udev-event.c \
udev-watch.c \
udev-node.c \
udev-rules.c
common_ldadd = \
$(top_builddir)/libudev/libudev-private.la
if WITH_SELINUX
common_ldadd += \
$(SELINUX_LIBS)
endif
udevd_SOURCES = \
$(common_files) \
udevd.c
udevd_LDADD = \
$(common_ldadd)
udevadm_SOURCES = \
$(common_files) \
udevadm.c \
udevadm-info.c \
udevadm-control.c \
udevadm-test.c \
udevadm-monitor.c \
udevadm-settle.c \
udevadm-trigger.c
udevadm_LDADD = \
$(common_ldadd)
test_udev_SOURCES = \
$(common_files) \
test-udev.c
test_udev_LDADD = \
$(common_ldadd)
dist_man_MANS = \
udev.7 \
udevadm.8 \
udevd.8
pkgconfigdir = $(datadir)/pkgconfig
pkgconfig_DATA = udev.pc
EXTRA_DIST = \
udev.pc.in \
udev.xml \
udevadm.xml \
udevd.xml
%.7 %.8 : %.xml
$(XSLTPROC) -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
MAINTAINERCLEANFILES = \
$(dist_man_MANS)
git-clean:
rm -f Makefile.in