diff options
Diffstat (limited to 'build-aux/Makefile.once.head/20-systemd.mk')
-rw-r--r-- | build-aux/Makefile.once.head/20-systemd.mk | 67 |
1 files changed, 57 insertions, 10 deletions
diff --git a/build-aux/Makefile.once.head/20-systemd.mk b/build-aux/Makefile.once.head/20-systemd.mk index bde09f8d51..63d54ba07e 100644 --- a/build-aux/Makefile.once.head/20-systemd.mk +++ b/build-aux/Makefile.once.head/20-systemd.mk @@ -20,17 +20,27 @@ # # 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 -ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} -AM_MAKEFLAGS = --no-print-directory -AUTOMAKE_OPTIONS = color-tests parallel-tests +SHELL = bash -o pipefail -GCC_COLORS ?= 'ooh, shiny!' -export GCC_COLORS +OUR_CPPFLAGS += -MT $@ -MD -MP -MF $(@D)/$(DEPDIR)/$(basename $(@F)).P$(patsubst .%,%,$(suffix $(@F))) +OUR_CPPFLAGS += -include $(topoutdir)/config.h +OUR_CPPFLAGS += $(if $(<D),-I$(<D)) -I$(@D) -SUBDIRS = . po +at.dirlocal += AM_CFLAGS AM_CPPFLAGS AM_LDFLAGS AM_LIBTOOLFLAGS +ALL_CFLAGS = $(OUR_CFLAGS) $(AM_CFLAGS/$(@D)) $(CFLAGS) +ALL_CPPFLAGS = $(OUR_CPPFLAGS) $(AM_CPPFLAGS/$(@D)) $(CPPFLAGS) +ALL_LDFLAGS = $(OUR_LDFLAGS) $(AM_LDFLAGS/$(@D)) $(LDFLAGS) +ALL_LIBTOOLFLAGS = $(OUR_LIBTOOLFLAGS) $(AM_LIBTOOLFLAGS/$(@D)) $(LIBTOOLFLAGS) + +COMPILE = $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(ALL_LIBTOOLFLAGS) --mode=compile $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(ALL_LIBTOOLFLAGS) --mode=link $(CCLD) $(ALL_CFLAGS) $(ALL_LDFLAGS) -o $@ + +SED_PROCESS = \ + $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \ + $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \ + < $< > $@ # remove targets if the command fails .DELETE_ON_ERROR: @@ -181,5 +191,42 @@ define generate-sym-test $(AM_V_at)printf 'return 0; }\n' >> $@ endef -$(eval $(value automake2autothing)) -include $(topsrcdir)/build-aux/Makefile.tail.mk +at.dirlocal += systemd.sed_files + +at.dirlocal += noinst_LTLIBRARIES lib_LTLIBRARIES +at.dirlocal += bin_PROGRAMS +at.dirlocal += pkgconfiglib_DATA +automake_name = $(subst -,_,$(subst .,_,$1)) +automake_sources = $(addprefix $(outdir)/,$(notdir $($(automake_name)_SOURCES) $(nodist_$(automake_name)_SOURCES))) +automake_lo = $(patsubst %.c,%.lo,$(filter %.c,$(automake_sources))) +automake_o = $(patsubst %.c,%.o,$(filter %.c,$(automake_sources))) +automake_libs = $($(automake_name)_LIBADD) $($(automake_name)_LDADD) + +define automake2autothing +std.out_files += $(noinst_LTLIBRARIES) $(lib_LTLIBRARIES) +std.sys_files += $(addprefix $(libdir)/,$(lib_LTLIBRARIES)) + +std.out_files += $(bin_PROGRAMS) +std.sys_files += $(addprefix $(bindir)/,$(bin_PROGRAMS)) + +std.out_files += $(notdir $(pkgconfiglib_DATA)) +std.sys_files += $(addprefix $(pkgconfiglibdir)/,$(notdir $(lib_pkgconfiglib_DATA))) + +$(foreach n,$(call automake_name,$(std.out_files)),\ + $(eval $n_SOURCES ?=)\ + $(eval nodist_$n_SOURCES ?=)\ + $(eval $n_CFLAGS ?=)\ + $(eval $n_CPPFLAGS ?=)\ + $(eval $n_LDFLAGS ?=)\ + $(eval $n_LIBADD ?=)) +$(foreach t,$(filter %.la,$(std.out_files)),\ + $(eval $(outdir)/$t: $(call at.path,$(call automake_lo,$t) $(call automake_libs,$t)) )\ + $(eval AM_CFLAGS += $($(call automake_name,$t)_CFLAGS) )\ + $(eval AM_CPPFLAGS += $($(call automake_name,$t)_CPPFLAGS) )\ + $(eval AM_LDFLAGS += $($(call automake_name,$t)_LDFLAGS) )) +$(foreach t,$(bin_PROGRAMS),\ + $(eval $(outdir)/$t: $(call at.path,$(call automake_o,$t) $(call automake_libs,$t)) )\ + $(eval AM_CFLAGS += $($(call automake_name,$t)_CFLAGS) )\ + $(eval AM_CPPFLAGS += $($(call automake_name,$t)_CPPFLAGS) )\ + $(eval AM_LDFLAGS += $($(call automake_name,$t)_LDFLAGS) )) +endef |