From 7a0f2389e70e9a83d5434ef231ab10c5f129c9b4 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Wed, 18 Apr 2012 18:46:00 +0400 Subject: [PATCH] make: Split generation of %.bin and %.bin.o into two rules This allows to have more detailed control over files generated and might be extended in future. Signed-off-by: Cyrill Gorcunov Signed-off-by: Pavel Emelyanov --- Makefile.pie | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Makefile.pie b/Makefile.pie index 5f348d407..d3494252e 100644 --- a/Makefile.pie +++ b/Makefile.pie @@ -9,6 +9,7 @@ PSRCS += $(patsubst %.o,%.c,$(POBJS)) PBLOB-NAME := parasite PBLOB-HDR := parasite-blob.h PBLOB-BIN := parasite.bin +PBLOB-BIN-O := $(PBLOB-BIN).o ROBJS += restorer.o ROBJS += restorer-log.o @@ -17,6 +18,7 @@ RSRCS += $(patsubst %.o,%.c,$(ROBJS)) RBLOB-NAME := restorer RBLOB-HDR := restorer-blob.h RBLOB-BIN := restorer.bin +RBLOB-BIN-O := $(RBLOB-BIN).o DEPS += $(patsubst %.o,%.d,$(POBJS)) DEPS += $(patsubst %.o,%.d,$(ROBJS)) @@ -39,10 +41,13 @@ parasite-util-net.o: util-net.c $(SYS-OBJ) POBJS += parasite-util-net.o -$(PBLOB-BIN): $(PIELDS) $(POBJS) $(PASM-OBJS) +$(PBLOB-BIN-O): $(PIELDS) $(POBJS) $(PASM-OBJS) + $(E) " GEN " $@ + $(Q) $(LD) --oformat=elf64-x86-64 -T $(PIELDS) -o $(PBLOB-BIN).o $(POBJS) $(PASM-OBJS) $(SYS-OBJ) + +$(PBLOB-BIN): $(PBLOB-BIN-O) $(PIELDS) $(POBJS) $(PASM-OBJS) $(E) " GEN " $@ $(Q) $(LD) --oformat=binary -T $(PIELDS) -o $(PBLOB-BIN) $(POBJS) $(PASM-OBJS) $(SYS-OBJ) - $(Q) $(LD) --oformat=elf64-x86-64 -T $(PIELDS) -o $(PBLOB-BIN).o $(POBJS) $(PASM-OBJS) $(SYS-OBJ) $(PBLOB-HDR): $(PBLOB-BIN) $(GEN-OFFSETS) $(E) " GEN " $@ @@ -52,10 +57,13 @@ $(ROBJS): $(RSRCS) $(SYS-OBJ) $(E) " CC " $@ $(Q) $(CC) -c $(CFLAGS) $(PIEFLAGS) $(patsubst %.o,%.c,$@) -o $@ -$(RBLOB-BIN): $(PIELDS) $(ROBJS) +$(RBLOB-BIN-O): $(PIELDS) $(ROBJS) + $(E) " GEN " $@ + $(Q) $(LD) --oformat=elf64-x86-64 -T $(PIELDS) -o $(RBLOB-BIN).o $(ROBJS) $(SYS-OBJ) + +$(RBLOB-BIN): $(RBLOB-BIN-O) $(PIELDS) $(ROBJS) $(E) " GEN " $@ $(Q) $(LD) --oformat=binary -T $(PIELDS) -o $(RBLOB-BIN) $(ROBJS) $(SYS-OBJ) - $(Q) $(LD) --oformat=elf64-x86-64 -T $(PIELDS) -o $(RBLOB-BIN).o $(ROBJS) $(SYS-OBJ) $(RBLOB-HDR): $(RBLOB-BIN) $(GEN-OFFSETS) $(E) " GEN " $@