# -*- Mode: makefile; indent-tabs-mode: t -*-
#
# This file is part of systemd.
#
# Copyright 2010-2012 Lennart Poettering
# Copyright 2010-2012 Kay Sievers
# Copyright 2013 Zbigniew Jędrzejewski-Szmek
# Copyright 2013 David Strauss
# Copyright 2016 Luke Shumaker
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# systemd is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see .
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.link_files)) = 0; then echo 'Cannot link library with no dependencies: $@' >&2; exit 1; fi
$(AM_V_CCLD)$(sd.LINK) $(if $(lt.rpath),-rpath $(lt.rpath)) $(lt.link_files)
$(addprefix $(outdir)/,$(am.PROGRAMS)): $(outdir)/%:
@if test $(words $(lt.link_files)) = 0; then echo 'Cannot link executable with no dependencies: $@' >&2; exit 1; fi
$(AM_V_CCLD)$(sd.LINK) $(lt.link_files)
# Stupid test that everything purported to be exported really is
$(outdir)/test-lib%-sym.c: $(srcdir)/lib%.sym
$(AM_V_GEN){\
printf '#include \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 $@
_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 }' <$< >$@
$(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 <$< >$@
ifneq ($(sd.sed_files),)
$(addprefix $(outdir)/,$(sd.sed_files)): $(outdir)/%: $(srcdir)/%.in
$(sd.SED_PROCESS)
endif
#$(outdir)/%.sh: $(srcdir)/%.sh.in
# $(SED_PROCESS)
# $(AM_V_GEN)chmod +x $@
$(outdir)/%.c: $(srcdir)/%.gperf
$(AM_V_GPERF)$(GPERF) < $< > $@
$(outdir)/%.c: $(outdir)/%.gperf
$(AM_V_GPERF)$(GPERF) < $< > $@
$(outdir)/%: $(srcdir)/%.m4 $(top_builddir)/config.status
$(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@