X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=rules.mk;h=1289740f2471f30d4b225310cd8b4b88bed0be65;hb=b87fa132f9a185053847b7b91ae8a6247e2d5621;hp=6870cfab7c63a6e5f0afc7f38cd42259a2451f34;hpb=c41eed7d175c38a0e247544d505be0ef7c3f0a4b;p=bertos.git diff --git a/rules.mk b/rules.mk index 6870cfab..1289740f 100644 --- a/rules.mk +++ b/rules.mk @@ -24,6 +24,9 @@ Q := @ L := @echo endif +# Select Bourne Again SHell as default make shell +SHELL := bash + # Checker build ifeq ($(C),1) CC = $(CHECKER) @@ -40,6 +43,7 @@ TRG_HEX = $(TRG:%=$(OUTDIR)/%.hex) TRG_BIN = $(TRG:%=$(OUTDIR)/%.bin) TRG_ROM = $(TRG:%=$(OUTDIR)/%.rom) TRG_COF = $(TRG:%=$(OUTDIR)/%.cof) +TRG_EXE = $(TRG:%=$(OUTDIR)/%) RECURSIVE_TARGETS = all-recursive install-recursive clean-recursive @@ -49,7 +53,7 @@ RECURSIVE_TARGETS = all-recursive install-recursive clean-recursive ifeq ($(EMBEDDED_TARGET),1) all:: all-recursive $(TRG_S19) $(TRG_HEX) $(TRG_BIN) else -all:: all-recursive $(TRG_ELF) +all:: all-recursive $(TRG_EXE) endif # Generate project documentation @@ -125,15 +129,15 @@ $$($(1)_CPPAOBJ): $$(OBJDIR)/$(1)/%.o : %.S # Link: instructions to create elf output file from object files -$$(OUTDIR)/$(1).elf: bumprev $$($(1)_OBJ) $$($(1)_LDSCRIPT) - $L "$(1): Linking $$(OUTDIR)/$(1)" +$$(OUTDIR)/$(1).elf $$(OUTDIR)/$(1)_nostrip: bumprev $$($(1)_OBJ) $$($(1)_LDSCRIPT) + $L "$(1): Linking $$@" @$$(MKDIR_P) $$(dir $$@) -ifeq ($(EMBEDDED_TARGET), 1) $Q $$(LD) $$($(1)_OBJ) $$(LIB) $$(LDFLAGS) $$($(1)_LDFLAGS) -o $$@ -else - $Q $$(LD) $$($(1)_OBJ) $$(LIB) $$(LDFLAGS) $$($(1)_LDFLAGS) -o $$(OUTDIR)/$(1)_nostrip - $Q $$(STRIP) -o $$(OUTDIR)/$(1) $$(OUTDIR)/$(1)_nostrip -endif + +# Strip debug info +$$(OUTDIR)/$(1): $$(OUTDIR)/$(1)_nostrip + $L "$(1): Generating stripped executable $$@" + $Q $$(STRIP) -o $$@ $$^ # Compile and link (program-at-a-time) $$(OUTDIR)/$(1)_whole.elf: bumprev $$($(1)_SRC) $$($(1)_LDSCRIPT)