Skip to content

Commit

Permalink
Include snek.defs from snek-install.defs
Browse files Browse the repository at this point in the history
Signed-off-by: Keith Packard <keithp@keithp.com>
  • Loading branch information
keith-packard committed Mar 5, 2019
1 parent 34009d8 commit d39a1ec
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 19 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

SNEK_NO_BUILD_TARGETS = 1
SNEK_ROOT = .
include snek.defs

include snek-install.defs

Expand Down
3 changes: 2 additions & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
SNEK_NO_BUILD_TARGETS = 1
SNEK_ROOT=..

include $(SNEK_ROOT)/snek-install.defs
Expand Down Expand Up @@ -29,5 +30,5 @@ install: $(DOCFILES)
upload:
scp -rp $(DOCFILES) fonts $(SNEKDOC)

clean:
clean::
rm -f $(PDF_FILES) $(HTML_FILES)
4 changes: 1 addition & 3 deletions posix/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

SNEK_ROOT=..

include $(SNEK_ROOT)/snek-install.defs

SNEK_LOCAL_SRC = \
snek-main.c \
snek-posix.c \
Expand All @@ -24,7 +22,7 @@ SNEK_LOCAL_SRC = \
SNEK_LOCAL_INC = snek-posix.h
SNEK_LOCAL_BUILTINS = snek-posix.builtin

include $(SNEK_ROOT)/snek.defs
include $(SNEK_ROOT)/snek-install.defs

OPT=-O0

Expand Down
24 changes: 12 additions & 12 deletions snek-duino/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# General Public License for more details.
#

include ../snek-install.defs

SNEK_ROOT = ..
SNEK_LOCAL_SRC = \
snek-duino.c \
Expand All @@ -23,10 +21,10 @@ SNEK_LOCAL_SRC = \
SNEK_LOCAL_INC = snek-duino.h
SNEK_LOCAL_BUILTINS = snek-duino.builtin

all: snek-duino.hex snek-duino-install

include ../snek.defs
include ../snek-install.defs

HEX=snek-duino.hex
CC=avr-gcc
CFLAGS=-Os -DF_CPU=16000000UL -mmcu=atmega328p -I. -g -fno-jump-tables $(SNEK_CFLAGS)
LDFLAGS=-Wl,-uvfprintf -lprintf_flt -lm \
Expand Down Expand Up @@ -62,13 +60,7 @@ ISP = usbtiny
# BODLEVEL1 0 brown out 2.5-2.9V
# BODLEVEL0 1 brown out 2.5-2.9V

set-fuse:
avrdude -F -V -c $(ISP) -p ATMEGA328P -U lfuse:w:0xff:m
avrdude -F -V -c $(ISP) -p ATMEGA328P -U hfuse:w:0xd7:m
avrdude -F -V -c $(ISP) -p ATMEGA328P -U efuse:w:0xfd:m

load: snek-duino.hex
avrdude -F -V -c $(ISP) -p ATMEGA328P -U flash:w:snek-duino.hex
all: $(HEX) snek-duino-install

snek-duino.hex: snek-duino
avr-objcopy -O ihex -R .eeprom snek-duino $@
Expand All @@ -80,6 +72,14 @@ snek-duino: $(SNEK_OBJ)
snek-duino-install: snek-duino-install.in
sed -e 's;@SHAREDIR@;$(SHAREDIR);g' $^ > $@

set-fuse:
avrdude -F -V -c $(ISP) -p ATMEGA328P -U lfuse:w:0xff:m
avrdude -F -V -c $(ISP) -p ATMEGA328P -U hfuse:w:0xd7:m
avrdude -F -V -c $(ISP) -p ATMEGA328P -U efuse:w:0xfd:m

load: snek-duino.hex
avrdude -F -V -c $(ISP) -p ATMEGA328P -U flash:w:snek-duino.hex

install: snek-duino-install snek-duino.hex snek-duino-install.1
install -d $(DESTDIR)$(BINDIR)
install snek-duino-install $(DESTDIR)$(BINDIR)
Expand All @@ -89,4 +89,4 @@ install: snek-duino-install snek-duino.hex snek-duino-install.1
install snek-duino-install.1 $(DESTDIR)$(MANDIR)/man1

clean::
rm -f snek-duino snek-duino.hex snek-duino.map snek-duino-install
rm -f snek-duino $(HEX) snek-duino.map snek-duino-install
2 changes: 2 additions & 0 deletions snek-install.defs
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ MANDIR = $(PREFIX)/share/man
SNEKLIB = $(PREFIX)/share/snek
SNEKDIST = keithp.com:/var/www/snek/dist
SNEKDOC = keithp.com:/var/www/snek

include $(SNEK_ROOT)/snek.defs
7 changes: 5 additions & 2 deletions snekde/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
# General Public License for more details.
#

include ../snek-install.defs
SNEK_NO_BUILD_TARGETS = 1
SNEK_ROOT=..

include $(SNEK_ROOT)/snek-install.defs

all: snekde snekde.desktop

Expand All @@ -36,5 +39,5 @@ snekde: snekde.py
cp $^ $@
chmod +x $@

clean:
clean::
rm -f snekde snekde.desktop

0 comments on commit d39a1ec

Please sign in to comment.