Skip to content

Commit

Permalink
Clean up 'make install'
Browse files Browse the repository at this point in the history
Stop installing snekboard .elf file

Make sure 'make install' builds everything necessary so that
a preceding 'make all' is not required.

Add dependency for doc/coderay-asciidoctor.css so that Make knows when
it will be built.

Install snek-riscv and snek-arm scripts to let users run them if they
like (they're in $(SHAREDIR), so not on the usual PATH).

Signed-off-by: Keith Packard <keithp@keithp.com>
  • Loading branch information
keith-packard committed Nov 24, 2019
1 parent 407cef3 commit 59f5ead
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 18 deletions.
2 changes: 2 additions & 0 deletions doc/Makefile
Expand Up @@ -51,5 +51,7 @@ snek-cover-book.pdf: snek-cover.svg
upload: $(DOCFILES)
rsync -avz $(DOCFILES) fonts $(SNEKDOC)

coderay-asciidoctor.css: $(HTML_FILES)

clean::
rm -f $(PDF_FILES) $(HTML_FILES) $(BOOK_FILES) coderay-asciidoctor.css
2 changes: 1 addition & 1 deletion ports/crickit/Makefile
Expand Up @@ -50,7 +50,7 @@ distclean: clean
clean::
rm -f *.o *.elf *.bin *.uf2 *.map ao-product.h

install:
install: $(UF2)
install -d $(DESTDIR)$(SHAREDIR)
install -m 0644 $(UF2) $(DESTDIR)$(SHAREDIR)

Expand Down
2 changes: 1 addition & 1 deletion ports/feather/Makefile
Expand Up @@ -50,7 +50,7 @@ distclean: clean
clean::
rm -f *.o *.elf *.bin *.uf2 *.map ao-product.h

install:
install: $(UF2)
install -d $(DESTDIR)$(SHAREDIR)
install -m 0644 $(UF2) $(DESTDIR)$(SHAREDIR)

Expand Down
2 changes: 1 addition & 1 deletion ports/itsybitsym0/Makefile
Expand Up @@ -50,7 +50,7 @@ distclean: clean
clean::
rm -f *.o *.elf *.bin *.uf2 *.map ao-product.h

install:
install: $(UF2)
install -d $(DESTDIR)$(SHAREDIR)
install -m 0644 $(UF2) $(DESTDIR)$(SHAREDIR)

Expand Down
2 changes: 1 addition & 1 deletion ports/mega/Makefile
Expand Up @@ -72,7 +72,7 @@ snek-mega-install: snek-mega-install.in
load: $(HEX) snek-mega-install
./snek-mega-install -port $(PORT) -hex $(HEX)

install: snek-mega-install $(HEX) snek-mega-install.1
install: snek-mega-install $(HEX) $(USBSERIAL_HEX) snek-mega-install.1
install -d $(DESTDIR)$(BINDIR)
install snek-mega-install $(DESTDIR)$(BINDIR)
install -d $(DESTDIR)$(SHAREDIR)
Expand Down
2 changes: 1 addition & 1 deletion ports/metrom0/Makefile
Expand Up @@ -50,7 +50,7 @@ distclean: clean
clean::
rm -f *.o *.elf *.bin *.uf2 *.map ao-product.h

install:
install: $(UF2)
install -d $(DESTDIR)$(SHAREDIR)
install -m 0644 $(UF2) $(DESTDIR)$(SHAREDIR)

Expand Down
2 changes: 1 addition & 1 deletion ports/nano33iot/Makefile
Expand Up @@ -53,7 +53,7 @@ clean::
upload: $(BIN)
bossac -e -w -v -b -R $(BIN)

install:
install: $(UF2)
install -d $(DESTDIR)$(SHAREDIR)
install -m 0644 $(UF2) $(DESTDIR)$(SHAREDIR)

Expand Down
2 changes: 1 addition & 1 deletion ports/playground/Makefile
Expand Up @@ -52,7 +52,7 @@ distclean: clean
clean::
rm -f *.o *.elf *.bin *.uf2 *.map ao-product.h

install:
install: $(UF2)
install -d $(DESTDIR)$(SHAREDIR)
install -m 0644 $(UF2) $(DESTDIR)$(SHAREDIR)

Expand Down
3 changes: 1 addition & 2 deletions ports/posix/Makefile
Expand Up @@ -37,7 +37,7 @@ all: snek snek.desktop
snek: $(SNEK_OBJ)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(SNEK_OBJ) $(LIBS)

install: snek snek.1
install: snek snek.desktop snek.1
install -d $(DESTDIR)$(BINDIR)
install snek $(DESTDIR)$(BINDIR)
install -d $(DESTDIR)$(APPDIR)
Expand All @@ -48,6 +48,5 @@ install: snek snek.1
snek.desktop: snek.desktop.in
$(SNEK_SED) $^ > $@


clean::
rm -f snek snek.desktop
3 changes: 2 additions & 1 deletion ports/qemu-arm/Makefile
Expand Up @@ -34,9 +34,10 @@ $(PROG): Makefile $(OBJ)

$(OBJ): $(SNEK_INC)

install: $(PROG)
install: $(PROG) snek-arm
install -d $(DESTDIR)$(SHAREDIR)
install -m 0644 $(PROG) $(DESTDIR)$(SHAREDIR)
install -m 0755 snek-arm $(DESTDIR)$(SHAREDIR)

snek-arm: snek-arm.in
$(SNEK_SED) $^ > $@
Expand Down
13 changes: 7 additions & 6 deletions ports/qemu-riscv/Makefile
Expand Up @@ -27,19 +27,20 @@ include $(SNEK_ROOT)/snek-install.defs
SRC=$(SNEK_SRC)
OBJ=$(SRC:.c=.o)

all: $(PROG) run-riscv
all: $(PROG) snek-riscv

$(PROG): Makefile $(OBJ)
$(call quiet,CC) $(LDFLAGS) -Wl,-Tsnek-qemu-riscv.ld -Wl,-M=$(MAP) -o $@ $(OBJ) $(LIBS)

$(OBJ): $(SNEK_INC)

install: $(PROG)
install -d $(DESTDIR)$(SHAREDIR)
install -m 0644 $(PROG) $(DESTDIR)$(SHAREDIR)

run-riscv: run-riscv.in
snek-riscv: snek-riscv.in
$(SNEK_SED) $^ > $@
chmod +x $@

install: $(PROG) snek-riscv
install -d $(DESTDIR)$(SHAREDIR)
install -m 0644 $(PROG) $(DESTDIR)$(SHAREDIR)
install snek-riscv $(DESTDIR)$(SHAREDIR)

uninstall:
5 changes: 3 additions & 2 deletions ports/snekboard/Makefile
Expand Up @@ -60,11 +60,12 @@ snek-board-install: snek-board-install.in
echo:
echo PROG is $(PROG)

install: $(PROG) $(UF2) $(BOOTLOADER_BIN) snek-board-install snek-board-install.1
install: $(UF2) $(BOOTLOADER_BIN) snek-board-install snek-board-install.1
install -d $(DESTDIR)$(SHAREDIR)
install -m 0644 $(PROG) $(DESTDIR)$(SHAREDIR)
install -m 0644 $(UF2) $(DESTDIR)$(SHAREDIR)
install -m 0644 $(BOOTLOADER_BIN) $(DESTDIR)$(SHAREDIR)
install -d $(DESTDIR)$(BINDIR)
install snek-board-install $(DESTDIR)$(BINDIR)
install -d $(DESTDIR)$(MANDIR)/man1
install -m 0644 snek-board-install.1 $(DESTDIR)$(MANDIR)/man1

Expand Down

0 comments on commit 59f5ead

Please sign in to comment.