Skip to content

Commit

Permalink
Adding some utility functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
mithro committed Nov 21, 2015
1 parent 6a99d35 commit 0ddd377
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/fx2.mk
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ CC = sdcc -mmcs51 \
$(INT2JT)


.PHONY: all ihx iic bix load clean clean-all
.PHONY: all ihx iic bix load check-int2jt print-size clean clean-all

all: ihx
ihx: $(BUILDDIR)/$(BASENAME).ihx
Expand Down Expand Up @@ -96,6 +96,19 @@ $(BUILDDIR)/$(BASENAME).iic: $(BUILDDIR)/$(BASENAME).ihx
load: $(BUILDDIR)/$(BASENAME).bix
fx2load -v $(VID) -p $(PID) $(BUILDDIR)/$(BASENAME).bix

$(BUILDDIR)/$(BASENAME).map: $(BUILDDIR)/$(BASENAME).ihx

print-size: $(BUILDDIR)/$(BASENAME).map
@grep "bytes (" $< | sort | uniq

check-int2jt: $(BUILDDIR)/$(BASENAME).map
@export REQUESTED=$(shell grep "INT2JT=" $< | sed -e's/INT2JT=//'); \
export ACTUAL=$(shell grep "C:.*s_INT2JT" build/bulkloop.map | sed -e's/C: *0*\([^ ]*\) s_INT2JT.*/0x\1/' | tr A-Z a-z ); \
if [ "$$REQUESTED" != "$$ACTUAL" ]; then \
echo "INT2JT at $$ACTUAL but requested $$REQUESTED"; \
exit 1; \
fi

clean:
rm -f $(foreach ext, a51 asm ihx lnk lk lst map mem rel rst rest sym adb cdb bix, $(BUILDDIR)/*.${ext})

Expand Down

0 comments on commit 0ddd377

Please sign in to comment.