From 7f2cd4b18a91dc7ead4ba73ee3d068e9d143f077 Mon Sep 17 00:00:00 2001 From: Stanislav Kinsbursky Date: Tue, 17 Jan 2012 16:12:45 +0300 Subject: [PATCH 1/5] cr-dump: remove unnessesary parasite header Signed-off-by: Stanislav Kinsbursky Signed-off-by: Cyrill Gorcunov --- cr-dump.c | 1 - 1 file changed, 1 deletion(-) diff --git a/cr-dump.c b/cr-dump.c index c1c3471aa..97e5642bd 100644 --- a/cr-dump.c +++ b/cr-dump.c @@ -30,7 +30,6 @@ #include "image.h" #include "proc_parse.h" #include "parasite-syscall.h" -#include "parasite-blob.h" #ifndef CONFIG_X86_64 # error No x86-32 support yet From d9c107d7a371abfe1e59752c1a78e5c83ba1cc89 Mon Sep 17 00:00:00 2001 From: Stanislav Kinsbursky Date: Tue, 17 Jan 2012 16:08:08 +0300 Subject: [PATCH 2/5] make: cleanup targets mess Targets should be defined after variables Signed-off-by: Stanislav Kinsbursky Acked-by: Pavel Emelyanov Signed-off-by: Cyrill Gorcunov --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a777e8b74..6df21d147 100644 --- a/Makefile +++ b/Makefile @@ -60,8 +60,6 @@ PROGRAM := crtools export CC ECHO MAKE CFLAGS LIBS ARCH DEFINES -all: $(PROGRAM) - OBJS += crtools.o OBJS += proc_parse.o OBJS += parasite-syscall.o @@ -90,6 +88,8 @@ HEAD-LDS := $(patsubst %.o,%.lds.S,$(OBJS-BLOB)) HEAD-IDS := $(patsubst %.h,%_h__,$(subst -,_,$(HEAD-BLOB))) +all: $(PROGRAM) + $(OBJS-BLOB): $(SRCS-BLOB) $(E) " CC " $@ $(Q) $(CC) -c $(CFLAGS) -fpic $< -o $@ From b8f57e0b352e4a15c1603b3252f49c19c853cc4e Mon Sep 17 00:00:00 2001 From: Stanislav Kinsbursky Date: Tue, 17 Jan 2012 16:08:15 +0300 Subject: [PATCH 3/5] make: cleanup deps files mess Only two files (parasite-syscall.c and cr-dump.c) depends on parasite code. Signed-off-by: Stanislav Kinsbursky Acked-by: Pavel Emelyanov Signed-off-by: Cyrill Gorcunov --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 6df21d147..f64c1eb0a 100644 --- a/Makefile +++ b/Makefile @@ -60,9 +60,12 @@ PROGRAM := crtools export CC ECHO MAKE CFLAGS LIBS ARCH DEFINES +OBJS_PARA := parasite-syscall.o +DEPS_PARA := $(patsubst %.o,%.d,$(OBJS_PARA)) + +OBJS := $(OBJS_PARA) OBJS += crtools.o OBJS += proc_parse.o -OBJS += parasite-syscall.o OBJS += cr-dump.o OBJS += cr-restore.o OBJS += cr-show.o @@ -117,7 +120,7 @@ $(PROGRAM): $(OBJS) $(E) " LINK " $@ $(Q) $(CC) $(CFLAGS) $(OBJS) $(LIBS) -o $@ -$(DEPS): $(HEAD-BLOB-GEN) $(HEADERS) +$(DEPS_PARA): $(HEAD-BLOB-GEN) %.d: %.c $(Q) $(CC) -M -MT $(patsubst %.d,%.o,$@) $(CFLAGS) $< -o $@ From d1df3f60f9c414d5d380487d6c243c164f2903c0 Mon Sep 17 00:00:00 2001 From: Stanislav Kinsbursky Date: Tue, 17 Jan 2012 16:08:22 +0300 Subject: [PATCH 4/5] make: cleanup deps files usage Objects does not depend on dep files. Dep files provide rules to build object files. Thus we need to include dep files. This also leads make to rebuild dep files (if required) before an other targets. Signed-off-by: Stanislav Kinsbursky Acked-by: Pavel Emelyanov Signed-off-by: Cyrill Gorcunov --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f64c1eb0a..da77864f9 100644 --- a/Makefile +++ b/Makefile @@ -111,7 +111,6 @@ $(HEAD-BLOB-GEN): $(HEAD-BIN) $(DEPS-BLOB) $(HEAD-BIN) > parasite-blob.h $(Q) sync -$(OBJS): $(DEPS) $(HEAD-BLOB-GEN) %.o: %.c $(E) " CC " $@ $(Q) $(CC) -c $(CFLAGS) $< -o $@ @@ -163,3 +162,5 @@ cscope: $(Q) $(FIND) . -name '*.[hcS]' -print > cscope.files $(Q) $(CSCOPE) -bkqu .PHONY: cscope + +-include $(DEPS) From cebc7de2271ff0bb146a17e719c4f07001318422 Mon Sep 17 00:00:00 2001 From: Stanislav Kinsbursky Date: Tue, 17 Jan 2012 16:08:29 +0300 Subject: [PATCH 5/5] make: fix parasite deps Remove explicit parasite targets dependence on deps files and use them as makefile parts. Signed-off-by: Stanislav Kinsbursky Acked-by: Pavel Emelyanov Signed-off-by: Cyrill Gorcunov --- Makefile | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index da77864f9..6049d0e82 100644 --- a/Makefile +++ b/Makefile @@ -77,12 +77,10 @@ OBJS += libnetlink.o OBJS += sockets.o OBJS += files.o -DEPS := $(patsubst %.o,%.d,$(OBJS)) HEADERS := $(shell find ./include/* -name '*.h' -print) OBJS-BLOB += parasite.o -DEPS-BLOB += $(patsubst %.o,%.d,$(OBJS-BLOB)) SRCS-BLOB += $(patsubst %.o,%.c,$(OBJS-BLOB)) HEAD-BLOB-GEN := $(patsubst %.o,%-blob.h,$(OBJS-BLOB)) @@ -91,6 +89,8 @@ HEAD-LDS := $(patsubst %.o,%.lds.S,$(OBJS-BLOB)) HEAD-IDS := $(patsubst %.h,%_h__,$(subst -,_,$(HEAD-BLOB))) +DEPS := $(patsubst %.o,%.d,$(OBJS)) $(patsubst %.o,%.d,$(OBJS-BLOB)) + all: $(PROGRAM) $(OBJS-BLOB): $(SRCS-BLOB) @@ -101,7 +101,7 @@ $(HEAD-BIN): $(OBJS-BLOB) $(HEAD-LDS) $(E) " GEN " $@ $(Q) $(LD) -T $(patsubst %.bin,%.lds.S,$@) $< -o $@ -$(HEAD-BLOB-GEN): $(HEAD-BIN) $(DEPS-BLOB) +$(HEAD-BLOB-GEN): $(HEAD-BIN) $(E) " GEN " $@ $(Q) $(SH) gen-offsets.sh \ parasite_h__ \ @@ -123,9 +123,6 @@ $(DEPS_PARA): $(HEAD-BLOB-GEN) %.d: %.c $(Q) $(CC) -M -MT $(patsubst %.d,%.o,$@) $(CFLAGS) $< -o $@ -$(DEPS-BLOB): $(SRCS-BLOB) - $(Q) $(CC) -M -MT $(patsubst %.d,%.o,$@) $(CFLAGS) $< -o $@ - test: $(Q) $(MAKE) -C test all .PHONY: test