summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-06-01 15:55:01 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-06-01 15:55:01 -0400
commit0b083d1977f410c8065e9d1f2534c83c58bfc907 (patch)
tree6b2f479626bfe02ec38bf6f13e3506fbfc387965
parent06cbbe0055ad8af01226a4f50470d139fe8c94d1 (diff)
parentc5b004f177571982989505c4aeef9c57af3353bd (diff)
Merge branch 'lukeshu/postmove' into lukeshu/master
# Conflicts: # src/journal/Makefile # src/libsystemd/Makefile # src/libsystemd/libsystemd-internal/Makefile # src/libsystemd/libsystemd-journal-internal/Makefile
-rw-r--r--Makefile.am2
-rw-r--r--discard.mk50
-rwxr-xr-xmove.sh58
-rwxr-xr-xreset.sh6
-rw-r--r--src/boot/efi/Makefile4
-rw-r--r--src/journal/Makefile11
-rw-r--r--src/libcore/Makefile2
-rw-r--r--src/libsystemd/libsystemd-journal-internal/Makefile1
-rw-r--r--src/udev/Makefile8
-rw-r--r--test/Makefile2
10 files changed, 99 insertions, 45 deletions
diff --git a/Makefile.am b/Makefile.am
index 9b072e8434..f287f86051 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3193,6 +3193,7 @@ libsystemd_internal_la_LIBADD = \
noinst_LTLIBRARIES += \
libsystemd-internal.la
+#@src/libsystemd/Makefile
EXTRA_DIST += \
src/libsystemd/libsystemd.pc.in \
src/libsystemd/sd-bus/DIFFERENCES \
@@ -4350,6 +4351,7 @@ endif
noinst_LTLIBRARIES += \
libsystemd-journal-internal.la
+#@src/journal/Makefile
rootlibexec_PROGRAMS += \
systemd-journald
diff --git a/discard.mk b/discard.mk
index 9f4fd5578a..54dbd80bb1 100644
--- a/discard.mk
+++ b/discard.mk
@@ -585,11 +585,11 @@ CLEANFILES += \
$(HTML_ALIAS) \
docs/html/man
-docs/html/man:
+$(outdir)/man:
$(AM_V_at)$(MKDIR_P) $(dir $@)
$(AM_V_LN)$(LN_S) -f ../../man $@
-man/index.html: man/systemd.index.html
+$(outdir)/index.html: man/systemd.index.html
$(AM_V_LN)$(LN_S) -f systemd.index.html $@
ifneq ($(HAVE_PYTHON),)
@@ -612,11 +612,11 @@ update-man-list: $(top_srcdir)/tools/make-man-rules.py $(XML_GLOB) man/custom-en
$(AM_V_at)mv $(top_srcdir)/Makefile-man.tmp $(top_srcdir)/Makefile-man.am
@echo "Makefile-man.am has been regenerated"
-man/systemd.index.xml: $(top_srcdir)/tools/make-man-index.py $(NON_INDEX_XML_FILES)
+$(outdir)/systemd.index.xml: $(top_srcdir)/tools/make-man-index.py $(NON_INDEX_XML_FILES)
$(AM_V_at)$(MKDIR_P) $(dir $@)
$(AM_V_GEN)$(PYTHON) $< $@ $(filter-out $<,$^)
-man/systemd.directives.xml: $(top_srcdir)/tools/make-directive-index.py man/custom-entities.ent $(SOURCE_XML_FILES)
+$(outdir)/systemd.directives.xml: $(top_srcdir)/tools/make-directive-index.py man/custom-entities.ent $(SOURCE_XML_FILES)
$(AM_V_at)$(MKDIR_P) $(dir $@)
$(AM_V_GEN)$(PYTHON) $< $@ $(SOURCE_XML_FILES)
@@ -877,13 +877,13 @@ SED_PROCESS = \
$(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
< $< > $@
-units/%: units/%.in
+$(outdir)/%: units/%.in
$(SED_PROCESS)
-man/%: man/%.in
+$(outdir)/%: man/%.in
$(SED_PROCESS)
-sysctl.d/%: sysctl.d/%.in
+$(outdir)/%: sysctl.d/%.in
$(SED_PROCESS)
%.pc: %.pc.in
@@ -892,13 +892,13 @@ sysctl.d/%: sysctl.d/%.in
%.conf: %.conf.in
$(SED_PROCESS)
-src/core/%.systemd: src/core/%.systemd.in
+$(outdir)/%.systemd: src/core/%.systemd.in
$(SED_PROCESS)
-src/%.policy.in: src/%.policy.in.in
+$(outdir)/%.policy.in: src/%.policy.in.in
$(SED_PROCESS)
-shell-completion/%: shell-completion/%.in
+$(outdir)/%: shell-completion/%.in
$(SED_PROCESS)
%.rules: %.rules.in
@@ -911,28 +911,28 @@ shell-completion/%: shell-completion/%.in
$(SED_PROCESS)
$(AM_V_GEN)chmod +x $@
-src/%.c: src/%.gperf
+$(outdir)/%.c: src/%.gperf
$(AM_V_at)$(MKDIR_P) $(dir $@)
$(AM_V_GPERF)$(GPERF) < $< > $@
-src/%: src/%.m4 $(top_builddir)/config.status
+$(outdir)/%: src/%.m4 $(top_builddir)/config.status
$(AM_V_at)$(MKDIR_P) $(dir $@)
$(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
-sysusers.d/%: sysusers.d/%.m4 $(top_builddir)/config.status
+$(outdir)/%: sysusers.d/%.m4 $(top_builddir)/config.status
$(AM_V_at)$(MKDIR_P) $(dir $@)
$(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
-tmpfiles.d/%: tmpfiles.d/%.m4 $(top_builddir)/config.status
+$(outdir)/%: tmpfiles.d/%.m4 $(top_builddir)/config.status
$(AM_V_at)$(MKDIR_P) $(dir $@)
$(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
-units/%: units/%.m4 $(top_builddir)/config.status
+$(outdir)/%: units/%.m4 $(top_builddir)/config.status
$(AM_V_at)$(MKDIR_P) $(dir $@)
$(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_SYSTEM=1 < $< > $@
-units/user/%: units/user/%.m4 $(top_builddir)/config.status
+$(outdir)/%: units/user/%.m4 $(top_builddir)/config.status
$(AM_V_at)$(MKDIR_P) $(dir $@)
$(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_USER=1 < $< > $@
@@ -947,7 +947,7 @@ EXTRA_DIST += \
$(polkitpolicy_in_in_files)
# ------------------------------------------------------------------------------
-man/custom-entities.ent: configure.ac
+$(outdir)/custom-entities.ent: configure.ac
$(AM_V_GEN)$(MKDIR_P) $(dir $@)
$(AM_V_GEN)(echo '<?xml version="1.0" encoding="utf-8" ?>' && \
printf '$(subst '|,<!ENTITY ,$(subst =, ",$(subst |',">\n,$(substitutions))))') \
@@ -973,22 +973,22 @@ XSLTPROC_PROCESS_MAN = \
XSLTPROC_PROCESS_HTML = \
$(AM_V_XSLT)$(XSLT) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
-man/%.1: man/%.xml man/custom-man.xsl man/custom-entities.ent
+$(outdir)/%.1: man/%.xml man/custom-man.xsl man/custom-entities.ent
$(XSLTPROC_PROCESS_MAN)
-man/%.3: man/%.xml man/custom-man.xsl man/custom-entities.ent
+$(outdir)/%.3: man/%.xml man/custom-man.xsl man/custom-entities.ent
$(XSLTPROC_PROCESS_MAN)
-man/%.5: man/%.xml man/custom-man.xsl man/custom-entities.ent
+$(outdir)/%.5: man/%.xml man/custom-man.xsl man/custom-entities.ent
$(XSLTPROC_PROCESS_MAN)
-man/%.7: man/%.xml man/custom-man.xsl man/custom-entities.ent
+$(outdir)/%.7: man/%.xml man/custom-man.xsl man/custom-entities.ent
$(XSLTPROC_PROCESS_MAN)
-man/%.8: man/%.xml man/custom-man.xsl man/custom-entities.ent
+$(outdir)/%.8: man/%.xml man/custom-man.xsl man/custom-entities.ent
$(XSLTPROC_PROCESS_MAN)
-man/%.html: man/%.xml man/custom-html.xsl man/custom-entities.ent
+$(outdir)/%.html: man/%.xml man/custom-html.xsl man/custom-entities.ent
$(XSLTPROC_PROCESS_HTML)
define html-alias
@@ -1007,10 +1007,10 @@ sysvinit_DATA = \
varlog_DATA = \
docs/var-log/README
-docs/sysvinit/README: docs/sysvinit/README.in
+$(outdir)/README: docs/sysvinit/README.in
$(SED_PROCESS)
-docs/var-log/README: docs/var-log/README.in
+$(outdir)/README: docs/var-log/README.in
$(SED_PROCESS)
CLEANFILES += \
diff --git a/move.sh b/move.sh
index 5fe8126170..6a93b18f54 100755
--- a/move.sh
+++ b/move.sh
@@ -9,9 +9,7 @@ in_array() {
return 1 # Not Found
}
-set -e
-
-(
+move_files() (
for d in libsystemd libudev machine resolve; do
mkdir src/$d-new
mv -T src/$d src/$d-new/src
@@ -110,7 +108,7 @@ set -e
mkdir src/libsystemd/libsystemd-journal-internal
)
-(
+breakup_makefile() (
find . \( -name Makefile -o -name '*.mk' \) -delete
touch .tmp.move.all
@@ -130,12 +128,60 @@ set -e
fi
printf '%s\n' "$line" >> "$file"
fi
- done < <(sed -r 's|^if (.*)|ifneq ($(\1),)|' <Makefile.am)
+ done < <(fixup_makefile <Makefile.am)
rm .tmp.move.all
)
-(
+fixup_includes() (
find src \( -name '*.h' -o -name '*.c' \) \
-exec grep '#include "sd-' -l -- {} + |
xargs -d $'\n' sed -ri 's|#include "(sd-[^"]*)"|#include <systemd/\1>|'
)
+
+fixup_makefile() {
+ sed -r \
+ -e '/^[^# ]*:/ { s|^(\s*)\S+/|\1$(outdir)/| }' \
+ -e 's|^if (.*)|ifneq ($(\1),)|'
+}
+
+fixup_makefiles() (
+ sed -ri \
+ -e '/^ \$\(AM_V_at\)\$\(MKDIR_P\) \$\(dir \$@\)/d' \
+ -e 's/ \$\(CFLAGS\) / /g' \
+ -e 's/ \$\(CPPFLAGS\) / /g' \
+ -e '/^[^# ]*:/ { s|\S+/|$(outdir)/|g }' \
+ src/libbasic/Makefile
+)
+
+move() (
+ >&2 echo ' => move_files'
+ move_files
+ >&2 echo ' => breakup_makefile'
+ breakup_makefile
+ >&2 echo ' => fixup_includes'
+ fixup_includes
+ >&2 echo ' => fixup_makefiles'
+ fixup_makefiles
+)
+
+main() {
+ set -e
+
+ if [[ -n "$(git status -s)" ]] || [[ -n "$(git clean -xdn)" ]]; then
+ echo 'There are changes in the current directory.' >&2
+ exit 1
+ fi
+
+ git checkout -b postmove
+
+ move
+
+ git add .
+ git commit -m './move.sh'
+ git merge -s ours lukeshu/postmove
+ git checkout lukeshu/postmove
+ git merge postmove
+ git branch -d postmove
+}
+
+main "$@"
diff --git a/reset.sh b/reset.sh
new file mode 100755
index 0000000000..66b629c217
--- /dev/null
+++ b/reset.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+set -e
+git checkout lukeshu/premove
+git branch -D postmove || true
+git checkout .
+git clean -xdf
diff --git a/src/boot/efi/Makefile b/src/boot/efi/Makefile
index 220a4d2175..9b86554977 100644
--- a/src/boot/efi/Makefile
+++ b/src/boot/efi/Makefile
@@ -48,7 +48,7 @@ ifneq ($(ENABLE_EFI),)
ifneq ($(HAVE_GNUEFI),)
bootlib_DATA = $(systemd_boot)
-$(top_builddir)/src/boot/efi/%.o: $(top_srcdir)/src/boot/efi/%.c $(addprefix $(top_srcdir)/,$(systemd_boot_headers))
+$(outdir)/%.o: $(top_srcdir)/src/boot/efi/%.c $(addprefix $(top_srcdir)/,$(systemd_boot_headers))
@$(MKDIR_P) $(top_builddir)/src/boot/efi/
$(AM_V_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@
@@ -96,7 +96,7 @@ ifneq ($(ENABLE_EFI),)
ifneq ($(HAVE_GNUEFI),)
bootlib_DATA += $(stub)
-$(top_builddir)/src/boot/efi/%.o: $(top_srcdir)/src/boot/efi/%.c $(addprefix $(top_srcdir)/,$(stub_headers))
+$(outdir)/%.o: $(top_srcdir)/src/boot/efi/%.c $(addprefix $(top_srcdir)/,$(stub_headers))
@$(MKDIR_P) $(top_builddir)/src/boot/efi/
$(AM_V_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@
diff --git a/src/journal/Makefile b/src/journal/Makefile
index 1334a155d3..de004d78e9 100644
--- a/src/journal/Makefile
+++ b/src/journal/Makefile
@@ -28,24 +28,24 @@ ifneq ($(HAVE_AUDIT),)
audit_list_includes += -include libaudit.h
endif
-src/journal/audit_type-list.txt:
+$(outdir)/audit_type-list.txt:
$(AM_V_at)$(MKDIR_P) $(dir $@)
$(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM $(audit_list_includes) - </dev/null | grep -vE 'AUDIT_.*(FIRST|LAST)_' | $(SED) -r -n 's/^#define\s+AUDIT_(\w+)\s+([0-9]{4})\s*$$/\1\t\2/p' | sort -k2 >$@
-src/journal/audit_type-to-name.h: src/journal/audit_type-list.txt
+$(outdir)/audit_type-to-name.h: src/journal/audit_type-list.txt
$(AM_V_at)$(MKDIR_P) $(dir $@)
$(AM_V_GEN)$(AWK) 'BEGIN{ print "const char *audit_type_to_string(int type) {\n\tswitch(type) {" } {printf " case AUDIT_%s: return \"%s\";\n", $$1, $$1 } END{ print " default: return NULL;\n\t}\n}\n" }' <$< >$@
-src/resolve/dns_type-list.txt: src/resolve/dns-type.h
+$(outdir)/dns_type-list.txt: src/resolve/dns-type.h
$(AM_V_at)$(MKDIR_P) $(dir $@)
$(AM_V_GEN)$(SED) -n -r 's/.* DNS_TYPE_(\w+).*/\1/p' <$< >$@
-src/resolve/dns_type-to-name.h: src/resolve/dns_type-list.txt
+$(outdir)/dns_type-to-name.h: src/resolve/dns_type-list.txt
$(AM_V_at)$(MKDIR_P) $(dir $@)
$(AM_V_GEN)$(AWK) 'BEGIN{ print "const char *dns_type_to_string(int type) {\n\tswitch(type) {" } {printf " case DNS_TYPE_%s: return ", $$1; sub(/_/, "-"); printf "\"%s\";\n", $$1 } END{ print " default: return NULL;\n\t}\n}\n" }' <$< >$@
-src/resolve/dns_type-from-name.gperf: src/resolve/dns_type-list.txt
+$(outdir)/dns_type-from-name.gperf: src/resolve/dns_type-list.txt
$(AM_V_at)$(MKDIR_P) $(dir $@)
$(AM_V_GEN)$(AWK) 'BEGIN{ print "struct dns_type_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { s=$$1; sub(/_/, "-", s); printf "%s, ", $$s; printf "DNS_TYPE_%s\n", $$1 }' <$< >$@
@@ -262,6 +262,7 @@ tests += \
test-compress-benchmark
endif
+
rootlibexec_PROGRAMS += \
systemd-journald
diff --git a/src/libcore/Makefile b/src/libcore/Makefile
index 935c0c968c..5eef67be3d 100644
--- a/src/libcore/Makefile
+++ b/src/libcore/Makefile
@@ -165,7 +165,7 @@ libcore_la_LIBADD = \
$(APPARMOR_LIBS) \
$(MOUNT_LIBS)
-src/core/load-fragment-gperf-nulstr.c: src/core/load-fragment-gperf.gperf
+$(outdir)/load-fragment-gperf-nulstr.c: src/core/load-fragment-gperf.gperf
$(AM_V_at)$(MKDIR_P) $(dir $@)
$(AM_V_GEN)$(AWK) 'BEGIN{ keywords=0 ; FS="," ; print "extern const char load_fragment_gperf_nulstr[];" ; print "const char load_fragment_gperf_nulstr[] ="} ; keyword==1 { print "\"" $$1 "\\0\"" } ; /%%/ { keyword=1} ; END { print ";" }' < $< > $@
diff --git a/src/libsystemd/libsystemd-journal-internal/Makefile b/src/libsystemd/libsystemd-journal-internal/Makefile
index 306d6db7f3..4e1f7327ae 100644
--- a/src/libsystemd/libsystemd-journal-internal/Makefile
+++ b/src/libsystemd/libsystemd-journal-internal/Makefile
@@ -94,5 +94,4 @@ endif
noinst_LTLIBRARIES += \
libsystemd-journal-internal.la
-
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/udev/Makefile b/src/udev/Makefile
index 8058082c05..22fe5075cf 100644
--- a/src/udev/Makefile
+++ b/src/udev/Makefile
@@ -83,14 +83,14 @@ rootlibexec_PROGRAMS += \
noinst_LTLIBRARIES += \
libudev-core.la
-src/udev/keyboard-keys-list.txt:
+$(outdir)/keyboard-keys-list.txt:
$(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-9K]/ { if ($$2 != "KEY_MAX") { print $$2 } }' > $@
-src/udev/keyboard-keys-from-name.gperf: src/udev/keyboard-keys-list.txt
+$(outdir)/keyboard-keys-from-name.gperf: src/udev/keyboard-keys-list.txt
$(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
+$(outdir)/keyboard-keys-from-name.h: src/udev/keyboard-keys-from-name.gperf
$(AM_V_GPERF)$(GPERF) -L ANSI-C -t -N keyboard_lookup_key -H hash_key_name -p -C < $< > $@
gperf_txt_sources += \
@@ -269,7 +269,7 @@ check_DATA += \
endif
# packed sysfs test tree
-test/sys:
+$(outdir)/sys:
$(AM_V_at)$(MKDIR_P) $(dir $@)
$(AM_V_GEN)tar -C test/ -xJf $(top_srcdir)/test/sys.tar.xz
diff --git a/test/Makefile b/test/Makefile
index 1d826c0bcd..2b00cff7f7 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -521,7 +521,7 @@ test_signal_util_LDADD = \
BUILT_SOURCES += \
src/test/test-hashmap-ordered.c
-src/test/test-hashmap-ordered.c: src/test/test-hashmap-plain.c
+$(outdir)/test-hashmap-ordered.c: src/test/test-hashmap-plain.c
$(AM_V_at)$(MKDIR_P) $(dir $@)
$(AM_V_GEN)$(AWK) 'BEGIN { print "/* GENERATED FILE */\n#define ORDERED" } \
{ if (!match($$0, "^#include")) \