diff options
author | Michael Forney <mforney@mforney.org> | 2019-05-07 16:51:53 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2019-05-07 16:55:13 -0700 |
commit | 84b43eba5659e9eecb66f9769e49b02200d319aa (patch) | |
tree | b56057f72611f000e10bc2ae4f1b82a3d6d8be35 /Makefile | |
parent | 0be5457bca301cb46971d1b343904ba3c760fca1 (diff) |
Add -s to LDFLAGS instead of running strip manually during bootstrap
Otherwise, stage3 is always considered out of date.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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 |