summaryrefslogtreecommitdiff
path: root/build-aux/Makefile.each.tail/50-sd.mk
diff options
context:
space:
mode:
Diffstat (limited to 'build-aux/Makefile.each.tail/50-sd.mk')
-rw-r--r--build-aux/Makefile.each.tail/50-sd.mk109
1 files changed, 72 insertions, 37 deletions
diff --git a/build-aux/Makefile.each.tail/50-sd.mk b/build-aux/Makefile.each.tail/50-sd.mk
index 5b38450813..9de3a86e90 100644
--- a/build-aux/Makefile.each.tail/50-sd.mk
+++ b/build-aux/Makefile.each.tail/50-sd.mk
@@ -20,56 +20,91 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
-include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
-include $(topsrcdir)/build-aux/Makefile.head.mk
-%-from-name.gperf: %-list.txt
+mod.sd.depends += files am lt
+
+-include $(wildcard $(outdir)/$(DEPDIR)/*.P*)
+
+files.out.int += *.o *.lo *.so .deps/ .libs/
+files.out.int += *-list.txt
+files.out.int += *-from-name.gperf
+files.out.int += *-from-name.h
+files.out.int += *-to-name.h
+files.out.int += *-gperf.c
+
+$(outdir)/%.o : $(srcdir)/%.c $(topoutdir)/config.h | $(outdir)/$(DEPDIR); $(AM_V_CC)$(sd.COMPILE) -c -o $@ $<
+$(outdir)/%.o : $(outdir)/%.c $(topoutdir)/config.h | $(outdir)/$(DEPDIR); $(AM_V_CC)$(sd.COMPILE) -c -o $@ $<
+$(outdir)/%.lo: $(srcdir)/%.c $(topoutdir)/config.h | $(outdir)/$(DEPDIR); $(AM_V_CC)$(sd.LTCOMPILE) -c -o $@ $<
+$(outdir)/%.lo: $(outdir)/%.c $(topoutdir)/config.h | $(outdir)/$(DEPDIR); $(AM_V_CC)$(sd.LTCOMPILE) -c -o $@ $<
+
+$(outdir)/$(DEPDIR):
+ $(AM_V_at)$(MKDIR_P) $@
+
+$(outdir)/%.la:
+ @if test $(words $(lt.lib.files.all)) = 0; then echo 'Cannot link library with no dependencies: $@' >&2; exit 1; fi
+ $(AM_V_CCLD)$(sd.LINK) $(if $(lt.lib.rpath),-rpath $(lt.lib.rpath)) $(lt.lib.files.ld)
+ $(AM_V_at)$(lt.lib.post)
+$(addprefix $(outdir)/,$(am.out_PROGRAMS)): $(outdir)/%:
+ @if test $(words $(lt.exe.files.all)) = 0; then echo 'Cannot link executable with no dependencies: $@' >&2; exit 1; fi
+ $(AM_V_CCLD)$(sd.LINK) $(lt.exe.files.ld)
+
+# Stupid test that everything purported to be exported really is
+$(outdir)/test-lib%-sym.c: $(srcdir)/lib%.sym
+ $(AM_V_GEN){\
+ printf '#include <stdio.h>\n' && \
+ printf '#include "%s"\n' $(notdir $(filter %.h, $^)) && \
+ printf 'void* functions[] = {\n' && \
+ sed -r -n 's/^ +([a-zA-Z0-9_]+);/\1,/p' $< && \
+ printf '};\nint main(void) {\n' && \
+ printf 'unsigned i; for (i=0;i<sizeof(functions)/sizeof(void*);i++) printf("%%p\\n", functions[i]);\n' && \
+ printf 'return 0; }\n' && \
+ :; } > $@
+
+_sd.files_in = $(foreach f,$(files.sys),$(if $(filter $1,$(patsubst %/,%,$(dir $f))),$(DESTDIR)$f))
+
+$(outdir)/%-from-name.gperf: $(outdir)/%-list.txt
$(AM_V_GEN)$(AWK) 'BEGIN{ print "struct $(notdir $*)_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@
-%-from-name.h: %-from-name.gperf
+$(outdir)/%-from-name.h: $(outdir)/%-from-name.gperf
$(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_$(notdir $*) -H hash_$(notdir $*)_name -p -C <$< >$@
-$(outdir)/%: sysctl.d/%.in
- $(SED_PROCESS)
+ifeq ($(sd.sed_files),)
+EXTRA_DIST ?=
+sd.sed_files += $(notdir $(patsubst %.in,%,$(filter %.in,$(EXTRA_DIST))))
+endif
+ifneq ($(sd.sed_files),)
+$(addprefix $(outdir)/,$(sd.sed_files)): $(outdir)/%: $(srcdir)/%.in
+ $(sd.SED_PROCESS)
+endif
-%.sh: %.sh.in
- $(SED_PROCESS)
- $(AM_V_GEN)chmod +x $@
+#$(outdir)/%.sh: $(srcdir)/%.sh.in
+# $(SED_PROCESS)
+# $(AM_V_GEN)chmod +x $@
-$(outdir)/%.c: src/%.gperf
+$(outdir)/%.c: $(srcdir)/%.gperf
+ $(AM_V_GPERF)$(GPERF) < $< > $@
+$(outdir)/%.c: $(outdir)/%.gperf
$(AM_V_GPERF)$(GPERF) < $< > $@
-$(outdir)/%: src/%.m4 $(top_builddir)/config.status
+$(outdir)/%: $(srcdir)/%.m4 $(top_builddir)/config.status
+ $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
+$(outdir)/%: $(outdir)/%.m4 $(top_builddir)/config.status
$(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
-$(outdir)/%.1: man/%.xml man/custom-man.xsl man/custom-entities.ent
- $(XSLTPROC_PROCESS_MAN)
-
-$(outdir)/%.3: man/%.xml man/custom-man.xsl man/custom-entities.ent
- $(XSLTPROC_PROCESS_MAN)
+$(outdir)/%.1: $(srcdir)/%.xml $(topsrcdir)/man/custom-man.xsl $(topoutdir)/man/custom-entities.ent
+ $(sd.XSLTPROC_PROCESS_MAN)
-$(outdir)/%.5: man/%.xml man/custom-man.xsl man/custom-entities.ent
- $(XSLTPROC_PROCESS_MAN)
+$(outdir)/%.3: $(srcdir)/%.xml $(topsrcdir)/man/custom-man.xsl $(topoutdir)/man/custom-entities.ent
+ $(sd.XSLTPROC_PROCESS_MAN)
-$(outdir)/%.7: man/%.xml man/custom-man.xsl man/custom-entities.ent
- $(XSLTPROC_PROCESS_MAN)
+$(outdir)/%.5: $(srcdir)/%.xml $(topsrcdir)/man/custom-man.xsl $(topoutdir)/man/custom-entities.ent
+ $(sd.XSLTPROC_PROCESS_MAN)
-$(outdir)/%.8: man/%.xml man/custom-man.xsl man/custom-entities.ent
- $(XSLTPROC_PROCESS_MAN)
+$(outdir)/%.7: $(srcdir)/%.xml $(topsrcdir)/man/custom-man.xsl $(topoutdir)/man/custom-entities.ent
+ $(sd.XSLTPROC_PROCESS_MAN)
-$(outdir)/%.html: man/%.xml man/custom-html.xsl man/custom-entities.ent
- $(XSLTPROC_PROCESS_HTML)
+$(outdir)/%.8: $(srcdir)/%.xml $(topsrcdir)/man/custom-man.xsl $(topoutdir)/man/custom-entities.ent
+ $(sd.XSLTPROC_PROCESS_MAN)
-# Stupid test that everything purported to be exported really is
-define generate-sym-test
- $(AM_V_at)printf '#include <stdio.h>\n' > $@
- $(AM_V_at)printf '#include "%s"\n' $(notdir $(filter %.h, $^)) >> $@
- $(AM_V_at)printf 'void* functions[] = {\n' >> $@
- $(AM_V_GEN)sed -r -n 's/^ +([a-zA-Z0-9_]+);/\1,/p' $< >> $@
- $(AM_V_at)printf '};\nint main(void) {\n' >> $@
- $(AM_V_at)printf 'unsigned i; for (i=0;i<sizeof(functions)/sizeof(void*);i++) printf("%%p\\n", functions[i]);\n' >> $@
- $(AM_V_at)printf 'return 0; }\n' >> $@
-endef
-
-
-include $(topsrcdir)/build-aux/Makefile.tail.mk
+$(outdir)/%.html: $(srcdir)/%.xml $(topsrcdir)/man/custom-html.xsl $(topoutdir)/man/custom-entities.ent
+ $(sd.XSLTPROC_PROCESS_HTML)