X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=Makefile.am;h=9105274c0da0101720d4506db7e9d08aad3c8948;hp=290ec1eb603b1359e1aaf21e97ad415708744aa6;hb=b4ecc959733d9d258d8ed0e8179368ee844a5578;hpb=a8b409dbc9e1e853a0f92d92603d9bb74592b1ff diff --git a/Makefile.am b/Makefile.am index 290ec1eb6..9105274c0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -174,6 +174,7 @@ AM_CPPFLAGS = \ -I $(top_srcdir)/src/core \ -I $(top_srcdir)/src/libudev \ -I $(top_srcdir)/src/udev \ + -I $(top_builddir)/src/udev \ -I $(top_srcdir)/src/libsystemd-bus \ $(OUR_CPPFLAGS) @@ -1388,6 +1389,44 @@ test_sched_prio_LDADD = \ libsystemd-core.la \ libsystemd-daemon.la +# ------------------------------------------------------------------------------ +## .PHONY so it always rebuilds it +.PHONY: coverage lcov-run lcov-report + +# run lcov from scratch, always +coverage: + $(MAKE) lcov-run + $(MAKE) lcov-report + +coverage_dir = coverage +coverage_opts = --base-directory $(srcdir) --directory $(builddir) --rc 'geninfo_adjust_src_path=$(abspath $(srcdir))=>$(abspath $(builddir))' + +if ENABLE_COVERAGE +# reset run coverage tests +lcov-run: + @rm -rf $(coverage_dir) + lcov $(coverage_opts) --zerocounters + -$(MAKE) check + +# generate report based on current coverage data +lcov-report: + $(MKDIR_P) $(coverage_dir) + lcov $(coverage_opts) --compat-libtool --capture --no-external \ + | sed 's|$(abspath $(builddir))|$(abspath $(srcdir))|' > $(coverage_dir)/.lcov.info + genhtml -t "systemd test coverage" -o $(coverage_dir) $(coverage_dir)/.lcov.info + @echo "Coverage report generated in $(abs_builddir)/$(coverage_dir)/index.html" + +# lcov doesn't work properly with vpath builds, make sure that bad +# output is not uploaded by mistake. +coverage-sync: coverage + test "$(builddir)" = "$(srcdir)" + rsync -rlv --delete --omit-dir-times coverage/ $(www_target)/coverage + +else +lcov-run lcov-report: + echo "Need to reconfigure with --enable-coverage" +endif + # ------------------------------------------------------------------------------ systemd_initctl_SOURCES = \ src/initctl/initctl.c @@ -1464,10 +1503,18 @@ nodist_systemunit_DATA += \ SYSINIT_TARGET_WANTS += \ systemd-modules-load.service +if ENABLE_TMPFILES +nodist_systemunit_DATA += \ + units/kmod-static-nodes.service + +SYSINIT_TARGET_WANTS += \ + kmod-static-nodes.service +endif endif EXTRA_DIST += \ - units/systemd-modules-load.service.in + units/systemd-modules-load.service.in \ + units/kmod-static-nodes.service.in # ------------------------------------------------------------------------------ if ENABLE_TMPFILES @@ -2086,6 +2133,7 @@ dist_udevrules_DATA += \ rules/99-systemd.rules \ rules/42-usb-hid-pm.rules \ rules/50-udev-default.rules \ + rules/60-keyboard.rules \ rules/60-persistent-storage-tape.rules \ rules/60-persistent-serial.rules \ rules/60-persistent-input.rules \ @@ -2149,6 +2197,19 @@ rootlibexec_PROGRAMS += \ noinst_LTLIBRARIES += \ libudev-core.la +src/udev/keyboard-keys.txt: Makefile + $(AM_V_at)$(MKDIR_P) $(dir $@) + $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include linux/input.h - < /dev/null | $(AWK) '/^#define[ \t]+KEY_[^ ]+[ \t]+[0-9]/ { if ($$2 != "KEY_MAX") { print $$2 } }' | sed 's/^KEY_COFFEE$$/KEY_SCREENLOCK/' > $@ + +src/udev/keyboard-keys-from-name.gperf: src/udev/keyboard-keys.txt Makefile + $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print tolower(substr($$1 ,5)) ", " $$1 }' < $< > $@ + +src/udev/keyboard-keys-from-name.h: src/udev/keyboard-keys-from-name.gperf Makefile + $(AM_V_GPERF)$(GPERF) -L ANSI-C -t -N keyboard_lookup_key -H hash_key_name -p -C < $< > $@ + +src/udev/keyboard-keys-to-name.h: src/udev/keyboard-keys.txt Makefile + $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@ + libudev_core_la_SOURCES = \ src/udev/udev.h \ src/udev/udev-event.c \ @@ -2160,10 +2221,22 @@ libudev_core_la_SOURCES = \ src/udev/udev-builtin-btrfs.c \ src/udev/udev-builtin-hwdb.c \ src/udev/udev-builtin-input_id.c \ + src/udev/udev-builtin-keyboard.c \ src/udev/udev-builtin-net_id.c \ src/udev/udev-builtin-path_id.c \ src/udev/udev-builtin-usb_id.c +nodist_libudev_core_la_SOURCES = \ + src/udev/keyboard-keys-from-name.h \ + src/udev/keyboard-keys-to-name.h + +BUILT_SOURCES += \ + $(nodist_libudev_core_la_SOURCES) + +CLEANFILES += \ + src/udev/keyboard-keys-from-name.gperf \ + src/udev/keyboard-keys.txt + libudev_core_la_CFLAGS = \ $(AM_CFLAGS) \ $(BLKID_CFLAGS) \ @@ -4137,6 +4210,8 @@ substitutions = \ '|SUSHELL=$(SUSHELL)|' \ '|DEBUGTTY=$(DEBUGTTY)|' \ '|KILL=$(KILL)|' \ + '|KMOD=$(KMOD)|' \ + '|MKDIR_P=$(MKDIR_P)|' \ '|QUOTAON=$(QUOTAON)|' \ '|QUOTACHECK=$(QUOTACHECK)|' \ '|SYSTEM_SYSVINIT_PATH=$(sysvinitdir)|' \