Skip to content

Commit

Permalink
Document dependency on a GNU awk extension
Browse files Browse the repository at this point in the history
strtonum() is a GNU awk (gawk)-only extension. It is not portable, and other
implementations of awk may not support it.

Accordingly, document the dependency upon gawk specifically, and ensure snek
only calls gawk in it's Makefiles.

See further:
  - https://www.gnu.org/software/gawk/manual/html_node/Strtonum-Function.html
  - https://www.gnu.org/software/gawk/manual/html_node/String-Functions.html#index-strtonum_0028_0029-function-_0028gawk_0029

Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
  • Loading branch information
Echelon9 authored and keith-packard committed Feb 13, 2020
1 parent ad14670 commit 54ab0d8
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ tools and other dependencies installed.
To build Snek you need these dependencies:

* [Lola](https://keithp.com/cgit/lola.git/)
* [gawk](https://www.gnu.org/software/gawk/)
* [gcc-avr](https://ccrma.stanford.edu/~juanig/articles/wiriavrlib/AVR_GCC.html)
* [avr-libc](https://www.nongnu.org/avr-libc/)
* [gcc-arm-none-eabi](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads)
Expand Down
2 changes: 1 addition & 1 deletion ports/duemilanove/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ $(HEX): $(ELF)

$(ELF): $(SNEK_OBJ)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
@awk '/__data_load_end/{printf("ROM used: %d bytes\n", strtonum($$1)); }' $(MAP)
@gawk '/__data_load_end/{printf("ROM used: %d bytes\n", strtonum($$1)); }' $(MAP)

snek-duemilanove-install: snek-duemilanove-install.in
$(SNEK_SED) $^ > $@
Expand Down
2 changes: 1 addition & 1 deletion ports/itsybitsy3v/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ all: $(ELF) $(HEX)

$(PROG): Makefile $(SNEK_OBJ)
$(CC) $(CFLAGS) -o $@ $(SNEK_OBJ) $(LDFLAGS)
@awk '/__data_load_end/{printf("ROM used: %d bytes\n", strtonum($$1)); }' $(MAP)
@gawk '/__data_load_end/{printf("ROM used: %d bytes\n", strtonum($$1)); }' $(MAP)

$(SNEK_OBJ): $(SNEK_INC)

Expand Down
2 changes: 1 addition & 1 deletion ports/itsybitsy5v/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ all: $(ELF) $(HEX) snek-itsybitsy-install

$(PROG): Makefile $(SNEK_OBJ)
$(CC) $(CFLAGS) -o $@ $(SNEK_OBJ) $(LDFLAGS)
@awk '/__data_load_end/{printf("ROM used: %d bytes\n", strtonum($$1)); }' $(MAP)
@gawk '/__data_load_end/{printf("ROM used: %d bytes\n", strtonum($$1)); }' $(MAP)

snek-itsybitsy-install: snek-itsybitsy-install.in
$(SNEK_SED) $^ > $@
Expand Down
2 changes: 1 addition & 1 deletion ports/mega/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ $(HEX): $(ELF)

$(ELF): $(SNEK_OBJ)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
@awk '/__data_load_end/{printf("ROM used: %d bytes\n", strtonum($$1)); }' $(MAP)
@gawk '/__data_load_end/{printf("ROM used: %d bytes\n", strtonum($$1)); }' $(MAP)

snek-mega-install: snek-mega-install.in
$(SNEK_SED) $^ > $@
Expand Down
2 changes: 1 addition & 1 deletion ports/uduino/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ all: $(ELF) $(HEX) snek-uduino-install

$(PROG): Makefile $(SNEK_OBJ)
$(CC) $(CFLAGS) -o $@ $(SNEK_OBJ) $(LDFLAGS)
@awk '/__data_load_end/{printf("ROM used: %d bytes\n", strtonum($$1)); }' $(MAP)
@gawk '/__data_load_end/{printf("ROM used: %d bytes\n", strtonum($$1)); }' $(MAP)

snek-uduino-install: snek-uduino-install.in
$(SNEK_SED) $^ > $@
Expand Down

0 comments on commit 54ab0d8

Please sign in to comment.