From adf85cbc1756e56c1f52f56235a3c08b3c5b8e05 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Thu, 13 Dec 2007 16:18:53 +0900 Subject: Build system simplification/standardisation This change makes kexec-tools work more like a standard configure-make- make-install-type project: * Remove $(OBJDIR) stuff. To do an out-of-tree build, just configure from a different directory. * Use the implicit Makefile rules more, and just edit the compiler flags for specific targets. * Simplify compiler/linker flags - no need for EXTRA_* * Add TARGET_CC, and improve checks for BUILD_CC too. * Set arch-specific flags in arch-specific makefiles, not conditional on $(ARCH). * Generate dependency files in the main compile, rather than as a separate step. * Don't #include sha256.c, but re-build it into the purgatory. Still a work-in-progress. Signed-off-by: Jeremy Kerr Signed-off-by: Simon Horman --- kdump/Makefile | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'kdump') diff --git a/kdump/Makefile b/kdump/Makefile index 456c2fc..0e3bf14 100644 --- a/kdump/Makefile +++ b/kdump/Makefile @@ -4,26 +4,18 @@ KDUMP_C_SRCS:= kdump/kdump.c -KDUMP_C_OBJS:= $(patsubst %.c, $(OBJDIR)/%.o, $(KDUMP_C_SRCS)) -KDUMP_C_DEPS:= $(patsubst %.c, $(OBJDIR)/%.d, $(KDUMP_C_SRCS)) +KDUMP_C_OBJS:= $(patsubst %.c, %.o, $(KDUMP_C_SRCS)) +KDUMP_C_DEPS:= $(patsubst %.c, %.d, $(KDUMP_C_SRCS)) KDUMP_SRCS:= $(KDUMP_C_SRCS) KDUMP_OBJS:= $(KDUMP_C_OBJS) KDUMP_DEPS:= $(KDUMP_C_DEPS) KDUMP:= $(SBINDIR)/kdump KDUMP_MANPAGE:= $(MANDIR)/man8/kdump.8 -include $(KDUMP_DEPS) - -$(KDUMP_C_DEPS): $(OBJDIR)/%.d: %.c - mkdir -p $(@D) - $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -M $< | sed -e 's|$(patsubst %.d,%.o,$(@F))|$(patsubst %.d,%.o,$(@))|' > $@ - -$(KDUMP_C_OBJS): $(OBJDIR)/%.o: %.c $(OBJDIR)/%.d - mkdir -p $(@D) - $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ -c $< +-include $(KDUMP_DEPS) $(KDUMP): $(KDUMP_OBJS) - mkdir -p $(@D) + @$(MKDIR) -p $(@D) $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ $(KDUMP_OBJS) $(KDUMP_MANPAGE): kdump/kdump.8 -- cgit