cproc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/cproc
Log | Files | Refs | Submodules | README | LICENSE

commit 84b43eba5659e9eecb66f9769e49b02200d319aa
parent 0be5457bca301cb46971d1b343904ba3c760fca1
Author: Michael Forney <mforney@mforney.org>
Date:   Tue,  7 May 2019 16:51:53 -0700

Add -s to LDFLAGS instead of running strip manually during bootstrap

Otherwise, stage3 is always considered out of date.

Diffstat:
MMakefile | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile @@ -59,17 +59,19 @@ $(objdir)/tree.o : tree.c util.h $(stagedeps) ; $(CC) $(CFLAGS) $(objdir)/type.o : type.c util.h cc.h $(stagedeps) ; $(CC) $(CFLAGS) -c -o $@ type.c $(objdir)/util.o : util.c util.h $(stagedeps) ; $(CC) $(CFLAGS) -c -o $@ util.c +# Make sure stage2 and stage3 binaries are stripped by adding -s to +# LDFLAGS. Otherwise they will contain paths to object files, which +# differ between stages. + .PHONY: stage2 stage2: all @mkdir -p $@ - $(MAKE) objdir=$@ stagedeps='cc cc-qbe' CC=$(objdir)/cc - strip $@/cc $@/cc-qbe + $(MAKE) objdir=$@ stagedeps='cc cc-qbe' CC=$(objdir)/cc LDFLAGS='$(LDFLAGS) -s' .PHONY: stage3 stage3: stage2 @mkdir -p $@ - $(MAKE) objdir=$@ stagedeps='stage2/cc stage2/cc-qbe' CC=$(objdir)/stage2/cc - strip $@/cc $@/cc-qbe + $(MAKE) objdir=$@ stagedeps='stage2/cc stage2/cc-qbe' CC=$(objdir)/stage2/cc LDFLAGS='$(LDFLAGS) -s' .PHONY: bootstrap bootstrap: stage2 stage3