kexec-tools/Makefile.kcp

36 lines
830 B
Makefile
Raw Normal View History

2006-07-20 03:36:18 +00:00
#
# kcp (copying date-stamped core files to filesystems)
#
KCP_C_SRCS:= kcp/kcp.c
KCP_C_OBJS:= $(patsubst %.c, $(OBJDIR)/%.o, $(KCP_C_SRCS))
KCP_C_DEPS:= $(patsubst %.c, $(OBJDIR)/%.d, $(KCP_C_SRCS))
KCP_SRCS:= $(KCP_C_SRCS)
KCP_OBJS:= $(KCP_C_OBJS)
KCP_DEPS:= $(KCP_C_DEPS)
KCP:= $(SBINDIR)/kcp
include $(KCP_DEPS)
$(KCP_C_DEPS): $(OBJDIR)/%.d: %.c
mkdir -p $(@D)
$(CC) $(CFLAGS) -M $< | sed -e 's|$(patsubst %.d,%.o,$(@F))|$(patsubst %.d,%.o,$(@))|' > $@
$(KCP_C_OBJS): $(OBJDIR)/%.o: %.c $(OBJDIR)/%.d
mkdir -p $(@D)
$(CC) $(CFLAGS) -o $@ -c $<
$(KCP): $(KCP_OBJS)
mkdir -p $(@D)
$(CC) $(CFLAGS) -o $@ $(KCP_OBJS)
echo::
@echo "KCP_C_SRCS $(KCP_C_SRCS)"
@echo "KCP_C_DEPS $(KCP_C_DEPS)"
@echo "KCP_C_OBJS $(KCP_C_OBJS)"
@echo "KCP_SRCS $(KCP_SRCS)"
@echo "KCP_DEPS $(KCP_DEPS)"
@echo "KCP_OBJS $(KCP_OBJS)"