chiark / gitweb /
man: html - cross-ref man page references and add Index link
[elogind.git] / Makefile.am
index c9ea8047ad6673e4aab92b5ff404ae418ed1a713..ab143da8bec7bd09cf3c0cd54faee6c8ff2f8f1f 100644 (file)
@@ -141,6 +141,7 @@ AM_CPPFLAGS = \
        -I $(top_srcdir)/src/login \
        -I $(top_srcdir)/src/journal \
        -I $(top_srcdir)/src/systemd \
+       -I $(top_builddir)/src/core \
        -I $(top_srcdir)/src/core \
        -I $(top_srcdir)/src/libudev \
        -I $(top_srcdir)/src/udev
@@ -658,14 +659,31 @@ noinst_DATA = \
 
 CLEANFILES += \
        $(MANPAGES) \
-       $(MANPAGES_ALIAS)
+       $(MANPAGES_ALIAS) \
+       ${XML_FILES:.xml=.html}
+
+if HAVE_PYTHON
+noinst_DATA += \
+       man/index.html
+
+CLEANFILES += \
+       man/index.html
+
+$(builddir)/man/index.html: $(XML_FILES:.xml=.html) $(top_srcdir)/make-man-index.py
+       $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
+       $(PYTHON) $(top_srcdir)/make-man-index.py $(XML_FILES) > $@ || rm $@
+
+EXTRA_DIST += man/index.html
+endif
+
 endif
 
 EXTRA_DIST += \
        $(XML_FILES) \
        ${XML_FILES:.xml=.html} \
        $(MANPAGES) \
-       $(MANPAGES_ALIAS)
+       $(MANPAGES_ALIAS) \
+       make-man-index.py
 
 # ------------------------------------------------------------------------------
 noinst_LTLIBRARIES += \
@@ -674,6 +692,8 @@ noinst_LTLIBRARIES += \
 libsystemd_shared_la_SOURCES = \
        src/shared/linux/auto_dev-ioctl.h \
        src/shared/linux/fanotify.h \
+       src/shared/linux/seccomp.h \
+       src/shared/linux/seccomp-bpf.h \
        src/shared/missing.h \
        src/shared/list.h \
        src/shared/macro.h \
@@ -947,11 +967,15 @@ libsystemd_core_la_SOURCES = \
        src/core/switch-root.h \
        src/core/switch-root.c \
        src/core/killall.h \
-       src/core/killall.c
+       src/core/killall.c \
+       src/core/syscall-list.c \
+       src/core/syscall-list.h
 
 nodist_libsystemd_core_la_SOURCES = \
        src/core/load-fragment-gperf.c \
-       src/core/load-fragment-gperf-nulstr.c
+       src/core/load-fragment-gperf-nulstr.c \
+       src/core/syscall-from-name.h \
+       src/core/syscall-to-name.h
 
 libsystemd_core_la_CFLAGS = \
        $(AM_CFLAGS) \
@@ -984,7 +1008,27 @@ EXTRA_DIST += \
 CLEANFILES += \
        src/core/load-fragment-gperf.gperf \
        src/core/load-fragment-gperf.c \
-       src/core/load-fragment-gperf-nulstr.c
+       src/core/load-fragment-gperf-nulstr.c \
+       src/core/syscall-list.txt \
+       src/core/syscall-from-name.gperf \
+       src/core/syscall-from-name.h \
+       src/core/syscall-to-name.h
+
+BUILT_SOURCES += \
+       src/core/syscall-from-name.h \
+       src/core/syscall-to-name.h
+
+src/core/syscall-list.txt: Makefile
+       $(AM_V_GEN)cpp $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include sys/syscall.h < /dev/null | $(AWK) '/^#define[ \t]+__NR_[^ ]+[ \t]+[0-9]/ { sub(/__NR_/, "", $$2); print $$2; }' > $@ || rm $@
+
+src/core/syscall-from-name.gperf: src/core/syscall-list.txt Makefile
+       $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct syscall_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, __NR_%s\n", $$1, $$1 }' < $< > $@ || rm $@
+
+src/core/syscall-from-name.h: src/core/syscall-from-name.gperf Makefile
+       $(AM_V_GEN)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_syscall -H hash_syscall_name -p -C < $< > $@ || rm $@
+
+src/core/syscall-to-name.h: src/core/syscall-list.txt Makefile
+       $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const syscall_names[] = { "} { printf "[__NR_%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' < $< > $@ || rm $@
 
 # ------------------------------------------------------------------------------
 systemd_SOURCES = \
@@ -2149,18 +2193,18 @@ dist_udevkeymapforcerel_DATA = \
        keymaps-force-release/samsung-90x3a \
        keymaps-force-release/common-volume-keys
 
-src/udev/keymap/keys.txt: $(INCLUDE_PREFIX)/linux/input.h
+src/udev/keymap/keys.txt: Makefile
        $(AM_V_at)mkdir -p src/udev/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)cpp $(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/' > $@ || rm $@
 
-src/udev/keymap/keys-from-name.gperf: src/udev/keymap/keys.txt
-       $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print $$1 ", " $$1 }' < $< > $@
+src/udev/keymap/keys-from-name.gperf: src/udev/keymap/keys.txt Makefile
+       $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print $$1 ", " $$1 }' < $< > $@ || rm $@
 
 src/udev/keymap/keys-from-name.h: src/udev/keymap/keys-from-name.gperf Makefile
-       $(AM_V_GEN)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_key -H hash_key_name -p -C < $< > $@
+       $(AM_V_GEN)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_key -H hash_key_name -p -C < $< > $@ || rm $@
 
 src/udev/keymap/keys-to-name.h: src/udev/keymap/keys.txt Makefile
-       $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@
+       $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@ || rm $@
 endif
 
 # ------------------------------------------------------------------------------
@@ -3376,7 +3420,7 @@ man/%.7: man/%.xml
 man/%.8: man/%.xml
        $(XSLTPROC_PROCESS_MAN)
 
-man/%.html: man/%.xml
+man/%.html: man/%.xml man/custom-html.xsl
        $(XSLTPROC_PROCESS_HTML)
 
 CLEANFILES += \