From: Jan Kiszka <[email protected]> Using a macro saves several identically repeated lines.
Signed-off-by: Jan Kiszka <[email protected]> --- Makefile.am | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Makefile.am b/Makefile.am index f278593..8babc2c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -224,21 +224,22 @@ efibootguard_DATA = $(efi_loadername) CLEANFILES += $(efi_objects) $(efi_solib) $(efi_loadername) EXTRA_DIST += $(efi_sources) +define gnuefi_compile + $(AM_V_CC) $(MKDIR_P) $(shell dirname $@)/; \ + $(GNUEFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@ +endef + $(top_builddir)/%.o: $(top_srcdir)/%.c - @$(MKDIR_P) $(shell dirname $@)/ - $(AM_V_CC)$(GNUEFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@ + $(call gnuefi_compile) $(top_builddir)/env/%.o: $(top_srcdir)/env/%.c - @$(MKDIR_P) $(shell dirname $@)/ - $(AM_V_CC)$(GNUEFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@ + $(call gnuefi_compile) $(top_builddir)/drivers/watchdog/%.o: $(top_srcdir)/drivers/watchdog/%.c - @$(MKDIR_P) $(shell dirname $@)/ - $(AM_V_CC)$(GNUEFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@ + $(call gnuefi_compile) $(top_builddir)/drivers/watchdog/%.o: $(top_srcdir)/drivers/watchdog/%.S - @$(MKDIR_P) $(shell dirname $@)/ - $(AM_V_CC)$(GNUEFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@ + $(call gnuefi_compile) $(top_builddir)/main.o: $(GEN_VERSION_H) -- 2.31.1 -- You received this message because you are subscribed to the Google Groups "EFI Boot Guard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/efibootguard-dev/1bb6f198-ec17-a346-22a4-7cbc6b380522%40siemens.com.
