Skip to content

Commit 25dd71c

Browse files
committed
Shows start of HEAP memory on compilation.
This allows checking if the compilers are using more memory.
1 parent ac3a656 commit 25dd71c

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ CROSS=
2525
CXX=g++
2626
CC=gcc
2727

28+
# Runs SED without locale
29+
SED=LC_ALL=C sed
30+
2831
# Optimization flags, added to C and C++ compiler flags
2932
OPTFLAGS=-O2
3033

rules.mak

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ build/disk/%.bas: tests/%.bas | build/disk
7070

7171
# Transform a text file to ATASCII (replace $0A with $9B)
7272
build/disk/%: % version.mk | build/disk
73-
$(Q)LC_ALL=C sed 's/%VERSION%/$(VERSION)/' < $< | LC_ALL=C tr '\n' '\233' > $@
73+
$(Q)$(SED) 's/%VERSION%/$(VERSION)/' < $< | LC_ALL=C tr '\n' '\233' > $@
7474

7575
build/disk/%.txt: %.md version.mk | build/disk
76-
$(Q)LC_ALL=C sed 's/%VERSION%/$(VERSION)/' < $< | LC_ALL=C awk 'BEGIN{for(n=0;n<127;n++)chg[sprintf("%c",n)]=128+n} {l=length($$0);for(i=1;i<=l;i++){c=substr($$0,i,1);if(c=="`"){x=1-x;if(x)c="\002";else c="\026";}else if(x)c=chg[c];printf "%c",c;}printf "\233";}' > $@
76+
$(Q)$(SED) 's/%VERSION%/$(VERSION)/' < $< | LC_ALL=C awk 'BEGIN{for(n=0;n<127;n++)chg[sprintf("%c",n)]=128+n} {l=length($$0);for(i=1;i<=l;i++){c=substr($$0,i,1);if(c=="`"){x=1-x;if(x)c="\002";else c="\026";}else if(x)c=chg[c];printf "%c",c;}printf "\233";}' > $@
7777

7878
# Copy ".XEX" as ".COM"
7979
build/disk/%.com: build/bin/%.xex | build/disk
@@ -153,20 +153,29 @@ build/gen/int/basic.asm: $(SYNTAX_INT) $(SYNTP) | build/gen/int
153153

154154
# Sets the version inside command line compiler source
155155
build/gen/cmdline-vers.bas: src/cmdline.bas version.mk
156-
$(Q)LC_ALL=C sed 's/%VERSION%/$(VERSION)/' < $< > $@
156+
$(Q)$(SED) 's/%VERSION%/$(VERSION)/' < $< > $@
157157

158158
# Main program file
159159
build/bin/fb.xex: $(IDE_OBJS_FP) $(A800_FP_OBJS) $(IDE_BAS_OBJS_FP) | build/bin $(LD65_HOST)
160160
$(ECHO) "Linking floating point IDE"
161161
$(Q)$(LD65_HOST) $(LD65_FLAGS) -Ln $(@:.xex=.lbl) -vm -m $(@:.xex=.map) -o $@ $^
162+
@printf "\e[1;33mFP IDE HEAP START: "
163+
@$(SED) -n -e 's/^[^ ]* 00\([0-9A-F]*\) .*HEAP_RUN.*/\1/p' $(@:.xex=.lbl)
164+
@printf "\e[0m"
162165

163166
build/bin/fbc.xex: $(CMD_OBJS_FP) $(A800_FP_OBJS) $(CMD_BAS_OBJS_FP) | build/bin $(LD65_HOST)
164167
$(ECHO) "Linking command line compiler"
165168
$(Q)$(LD65_HOST) $(LD65_FLAGS) -Ln $(@:.xex=.lbl) -vm -m $(@:.xex=.map) -o $@ $^
169+
@printf "\e[1;33mCOMMAND LINE COMPILER HEAP START: "
170+
@$(SED) -n -e 's/^[^ ]* 00\([0-9A-F]*\) .*HEAP_RUN.*/\1/p' $(@:.xex=.lbl)
171+
@printf "\e[0m"
166172

167173
build/bin/fbi.xex: $(IDE_OBJS_INT) $(A800_OBJS) $(IDE_BAS_OBJS_INT) | build/bin $(LD65_HOST)
168174
$(ECHO) "Linking integer IDE"
169175
$(Q)$(LD65_HOST) $(LD65_FLAGS) -Ln $(@:.xex=.lbl) -vm -m $(@:.xex=.map) -o $@ $^
176+
@printf "\e[1;33mINTEGER IDE HEAP START: "
177+
@$(SED) -n -e 's/^[^ ]* 00\([0-9A-F]*\) .*HEAP_RUN.*/\1/p' $(@:.xex=.lbl)
178+
@printf "\e[0m"
170179

171180
# Compiled program files
172181
build/bin/%.xex: build/obj/fp/%.o $(LIB_FP) | build/bin $(LD65_HOST)

0 commit comments

Comments
 (0)