diff options
author | David Sterba <dsterba@suse.com> | 2016-09-23 16:06:57 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-10-03 15:07:21 +0200 |
commit | 605ed50b8cbc604ab15480c7460c7db16f471fd3 (patch) | |
tree | 6f9de80576ccb33b202991f025ce97cca1eef499 /Makefile.in | |
parent | 8d8de7c2e59e31def84e04d49e2ec09aeb1f07cd (diff) |
btrfs-progs: build: add basic support for subdirectory build
Add explicit target file names and set the top source directory.
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'Makefile.in')
-rw-r--r-- | Makefile.in | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Makefile.in b/Makefile.in index 214b0428..7202cdb5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -51,6 +51,8 @@ DEBUG_CFLAGS_DEFAULT = -O0 -U_FORTIFY_SOURCE -ggdb3 DEBUG_CFLAGS_INTERNAL = DEBUG_CFLAGS := +TOPDIR := $(shell pwd) + # Common build flags CFLAGS = @CFLAGS@ \ -include config.h \ @@ -58,6 +60,7 @@ CFLAGS = @CFLAGS@ \ -D_XOPEN_SOURCE=700 \ -fno-strict-aliasing \ -fPIC \ + -I$(TOPDIR) \ $(EXTRAWARN_CFLAGS) \ $(DEBUG_CFLAGS_INTERNAL) \ $(EXTRA_CFLAGS) @@ -231,7 +234,7 @@ else endif %.o.d: %.c - $(Q)$(CC) -MM -MG -MF $@ -MT $(@:.o.d=.o) -MT $(@:.o.d=.static.o) -MT $@ $(CFLAGS) $< + $(Q)$(CC) -MD -MM -MG -MF $@ -MT $(@:.o.d=.o) -MT $(@:.o.d=.static.o) -MT $@ $(CFLAGS) $< # # Pick from per-file variables, btrfs_*_cflags @@ -240,7 +243,7 @@ endif @$(check_echo) " [SP] $<" $(Q)$(check) $(CFLAGS) $(CHECKER_FLAGS) $< @echo " [CC] $@" - $(Q)$(CC) $(CFLAGS) -c $< $($(subst -,_,$(@:%.o=%)-cflags)) + $(Q)$(CC) $(CFLAGS) -c $< -o $@ $($(subst -,_,$(@:%.o=%)-cflags)) %.static.o: %.c @echo " [CC] $@" |