Harald Hoyer 308914
From db44331dc4513886e83e387604887033868c5214 Mon Sep 17 00:00:00 2001
Harald Hoyer 308914
From: Daniel Molkentin <dmolkentin@suse.com>
Harald Hoyer 308914
Date: Fri, 13 Mar 2020 11:39:46 +0100
Harald Hoyer 308914
Subject: [PATCH] Makefile: really make externally defined CFLAGS work
Harald Hoyer 308914
Harald Hoyer 308914
The fix in aed52a6cfb43ebea372328fd5837c1f341c3f0df does not
Harald Hoyer 308914
work (second line will be ignored on override), so expand the implicitly
Harald Hoyer 308914
defined rule and add them there.
Harald Hoyer 308914
---
Harald Hoyer 308914
 Makefile | 4 +++-
Harald Hoyer 308914
 1 file changed, 3 insertions(+), 1 deletion(-)
Harald Hoyer 308914
Harald Hoyer 308914
diff --git a/Makefile b/Makefile
Harald Hoyer 308914
index 0cc8b390..7eb31847 100644
Harald Hoyer 308914
--- a/Makefile
Harald Hoyer 308914
+++ b/Makefile
Harald Hoyer 308914
@@ -19,7 +19,6 @@ sysconfdir ?= ${prefix}/etc
Harald Hoyer 308914
 bindir ?= ${prefix}/bin
Harald Hoyer 308914
 mandir ?= ${prefix}/share/man
Harald Hoyer 308914
 CFLAGS ?= -O2 -g -Wall -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
Harald Hoyer 308914
-CFLAGS += $(KMOD_CFLAGS)
Harald Hoyer 308914
 bashcompletiondir ?= ${datadir}/bash-completion/completions
Harald Hoyer 308914
 pkgconfigdatadir ?= $(datadir)/pkgconfig
Harald Hoyer 308914
 
Harald Hoyer 308914
@@ -50,6 +49,9 @@ manpages = $(man1pages) $(man5pages) $(man7pages) $(man8pages)
Harald Hoyer 308914
 
Harald Hoyer 308914
 all: dracut-version.sh dracut.pc dracut-install skipcpio/skipcpio
Harald Hoyer 308914
 
Harald Hoyer 308914
+%.o : %.c
Harald Hoyer 308914
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) $(KMOD_CFLAGS) $< -o $@
Harald Hoyer 308914
+
Harald Hoyer 308914
 DRACUT_INSTALL_OBJECTS = \
Harald Hoyer 308914
         install/dracut-install.o \
Harald Hoyer 308914
         install/hashmap.o\
Harald Hoyer 308914