Skip to content

Commit

Permalink
ports/duemilanove: Create snek-$(BOARD)-install.in as needed
Browse files Browse the repository at this point in the history
The linux installer wants partially edited versions of this file so that
it can customize them while installing.

Signed-off-by: Keith Packard <keithp@keithp.com>
  • Loading branch information
keith-packard committed Nov 21, 2024
1 parent ff496af commit beddcaf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions ports/duemilanove/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,19 @@ SNEK_ATMEGA_SED=$(SNEK_SED) \
-e 's;@PORT@;$(PORT);g' \
-e 's;@MCU@;$(MCU);g'

SNEK_ATMEGA_BOARD_SED = sed \
-e 's;@SNEKLIB@;$(SNEKLIB);' \
-e 's/@SNEK_VERSION@/$(SNEK_VERSION)/' \
-e 's/@SNEK_VERSION_DASH@/$(SNEK_VERSION_DASH)/' \
-e 's;@SNEK_ROOT@;$(SNEK_ROOT);' \
-e 's/@SNEK_DATE@/$(SNEK_DATE)/' \
-e 's;@BOARD@;$(BOARD);g' \
-e 's;@UBOARD@;$(UBOARD);g' \
-e 's;@CBOARD@;$(CBOARD);g' \
-e 's;@BAUD@;$(BAUD);g' \
-e 's;@PORT@;$(PORT);g' \
-e 's;@MCU@;$(MCU);g'

SNEK_CFLAGS = $(SNEK_MOST_WARNINGS) $(SNEK_BASE_CFLAGS)

BASE=snek-$(BOARD)-$(SNEK_VERSION)
Expand All @@ -79,12 +92,15 @@ $(ELF): $(SNEK_OBJ)
@gawk '/__data_load_end/{printf("$(BASE) ROM: %d bytes\n", strtonum($$1)); }' $(MAP)

ifeq ($(INSTALLER),1)
all:: snek-$(BOARD)-install snek-$(BOARD)-install.1
all:: snek-$(BOARD)-install snek-$(BOARD)-install.in snek-$(BOARD)-install.1

snek-$(BOARD)-install: snek-duemilanove-install.in
snek-$(BOARD)-install: snek-atmega328-install.in
$(SNEK_ATMEGA_SED) $^ > $@
chmod +x $@

snek-$(BOARD)-install.in: snek-atmega328-install.in
if [ $@ != $^ ]; then $(SNEK_ATMEGA_BOARD_SED) $^ > $@; fi

load: $(HEX) snek-$(BOARD)-install
./snek-$(BOARD)-install -hex $(HEX)

Expand Down
File renamed without changes.

0 comments on commit beddcaf

Please sign in to comment.