mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-17 20:05:24 +00:00
btrfs-progs: build: add per-tool cflags variable
The standalone tools are built from pattern rules, add support for per-tool cflaags, like btrfs_something_clfags. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
b762b78a60
commit
aa07e4be00
@ -221,15 +221,18 @@ endif
|
||||
%.o.d: %.c
|
||||
$(Q)$(CC) -MM -MG -MF $@ -MT $(@:.o.d=.o) -MT $(@:.o.d=.static.o) -MT $@ $(CFLAGS) $<
|
||||
|
||||
#
|
||||
# Pick from per-file variables, btrfs_*_cflags
|
||||
#
|
||||
.c.o:
|
||||
@$(check_echo) " [SP] $<"
|
||||
$(Q)$(check) $(CFLAGS) $(CHECKER_FLAGS) $<
|
||||
@echo " [CC] $@"
|
||||
$(Q)$(CC) $(CFLAGS) -c $<
|
||||
$(Q)$(CC) $(CFLAGS) -c $< $($(subst -,_,$(@:%.o=%)-cflags))
|
||||
|
||||
%.static.o: %.c
|
||||
@echo " [CC] $@"
|
||||
$(Q)$(CC) $(STATIC_CFLAGS) -c $< -o $@
|
||||
$(Q)$(CC) $(STATIC_CFLAGS) -c $< -o $@ $($(subst -,_,$(@:%.static.o=%)-cflags))
|
||||
|
||||
all: $(progs) $(BUILDDIRS)
|
||||
$(SUBDIRS): $(BUILDDIRS)
|
||||
|
Loading…
Reference in New Issue
Block a user