From e69cea25db7a5178a9f452c0fdf6e3219a67bf8c Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Mon, 23 Jan 2012 11:26:00 +0400 Subject: [PATCH] make: Drop restorer-log.c inclusion in restorer.c Compile it as a separate file and use ld to merge two files. Signed-off-by: Cyrill Gorcunov Acked-by: Andrey Vagin --- Makefile | 19 ++++++++++++++----- restorer.c | 3 --- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index af96112bf..32be494d3 100644 --- a/Makefile +++ b/Makefile @@ -83,7 +83,16 @@ HEAD-BLOB-GEN := $(patsubst %.o,%-blob.h,$(OBJS-BLOB)) HEAD-BIN := $(patsubst %.o,%.bin,$(OBJS-BLOB)) HEAD-LDS := $(patsubst %.o,%.lds.S,$(OBJS-BLOB)) -ROBJS-BLOB = restorer.o +ROBJS-BLOB := restorer.o +# +# Everything embedded into restorer as a separate +# object file should go here. +ROBJS := $(ROBJS-BLOB) +ROBJS += restorer-log.o + +RDEPS-BLOB += $(patsubst %.o,%.d,$(ROBJS)) +RSRCS-BLOB += $(patsubst %.o,%.c,$(ROBJS)) + RSRCS-BLOB += $(patsubst %.o,%.c,$(ROBJS-BLOB)) RHEAD-BLOB-GEN := $(patsubst %.o,%-blob.h,$(ROBJS-BLOB)) @@ -114,13 +123,13 @@ $(HEAD-BLOB-GEN): $(HEAD-BIN) $(HEAD-BIN) > parasite-blob.h $(Q) sync -$(ROBJS-BLOB): $(RSRCS-BLOB) +$(ROBJS): $(RSRCS-BLOB) $(E) " CC " $@ - $(Q) $(CC) -c $(CFLAGS) -fpic $< -o $@ + $(Q) $(CC) -c $(CFLAGS) -fpic $(patsubst %.o,%.c,$@) -o $@ -$(RHEAD-BIN): $(ROBJS-BLOB) $(RHEAD-LDS) +$(RHEAD-BIN): $(ROBJS) $(RHEAD-LDS) $(E) " GEN " $@ - $(Q) $(LD) -T $(patsubst %.bin,%.lds.S,$@) $< -o $@ + $(Q) $(LD) -T $(patsubst %.bin,%.lds.S,$@) -o $@ $(ROBJS) $(RHEAD-BLOB-GEN): $(RHEAD-BIN) $(RDEPS-BLOB) $(E) " GEN " $@ diff --git a/restorer.c b/restorer.c index 01526bb85..9e32d82c1 100644 --- a/restorer.c +++ b/restorer.c @@ -580,6 +580,3 @@ core_restore_end: local_sleep(5); sys_exit(0); } - -/* FIXME Need link this .o with ld */ -#include "restorer-log.c"