]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Makefile: really make externally defined CFLAGS work
authorDaniel Molkentin <dmolkentin@suse.com>
Fri, 13 Mar 2020 10:39:46 +0000 (11:39 +0100)
committerHarald Hoyer <harald@hoyer.xyz>
Thu, 19 Mar 2020 15:46:54 +0000 (16:46 +0100)
The fix in aed52a6cfb43ebea372328fd5837c1f341c3f0df does not
work (second line will be ignored on override), so expand the implicitly
defined rule and add them there.

Makefile

index 0cc8b390264c1540914d9756e83a8446c3c32695..7eb318471dbd446c660f5d72df1270ea60e923d3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,6 @@ sysconfdir ?= ${prefix}/etc
 bindir ?= ${prefix}/bin
 mandir ?= ${prefix}/share/man
 CFLAGS ?= -O2 -g -Wall -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
-CFLAGS += $(KMOD_CFLAGS)
 bashcompletiondir ?= ${datadir}/bash-completion/completions
 pkgconfigdatadir ?= $(datadir)/pkgconfig
 
@@ -50,6 +49,9 @@ manpages = $(man1pages) $(man5pages) $(man7pages) $(man8pages)
 
 all: dracut-version.sh dracut.pc dracut-install skipcpio/skipcpio
 
+%.o : %.c
+       $(CC) -c $(CFLAGS) $(CPPFLAGS) $(KMOD_CFLAGS) $< -o $@
+
 DRACUT_INSTALL_OBJECTS = \
         install/dracut-install.o \
         install/hashmap.o\