2020-12-01 21:15:19 +01:00
|
|
|
# Copyright 2020 Google LLC
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# https://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
2024-03-01 17:13:18 +01:00
|
|
|
SRC = $(wildcard *.py) $(wildcard lib/*.py)
|
2018-12-10 15:53:00 +01:00
|
|
|
|
2024-02-29 21:39:00 +01:00
|
|
|
MPY_CROSS = ../third_party/micropython/mpy-cross/build/mpy-cross
|
|
|
|
|
|
|
|
put: $(SRC:%.py=build/put-%.stamp)
|
2018-12-10 15:53:00 +01:00
|
|
|
ampy -p /dev/ttyUSB? ls
|
|
|
|
|
2024-03-01 17:13:18 +01:00
|
|
|
build/put-%.stamp: %.py
|
2024-02-29 21:39:00 +01:00
|
|
|
mkdir -p $(@D)
|
2024-03-03 10:29:13 +01:00
|
|
|
ampy -p /dev/ttyUSB? put $< $(<F)
|
|
|
|
touch -r $< $@
|
2024-02-29 21:39:00 +01:00
|
|
|
|
|
|
|
build/%.mpy: %.py $(MPY_CROSS)
|
|
|
|
mkdir -p $(@D)
|
|
|
|
$(MPY_CROSS) -O1 -march=xtensa -o $@ $<
|
|
|
|
|
|
|
|
$(MPY_CROSS):
|
|
|
|
$(MAKE) -C $(dir $(@D))
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf build
|
|
|
|
|