.PHONY: bootloader
bootloader:  ## Build the bootloader in docker
	docker build -o . --target export --build-arg TARGET=bootloader.elf .

.PHONY: helloworld
helloworld:  ## Build the helloworld app in docker
	docker build -o . --target export --build-arg TARGET=helloworld.bin .

.PHONY: timer
timer:  ## Build the timer app in docker
	docker build -o . --target export --build-arg TARGET=timer.bin .

.PHONY: uart
uart:  ## Build the uart app in docker
	docker build -o . --target export --build-arg TARGET=uart.bin .

.PHONY: dev-image
dev-image:
	docker build -t mbv-dev --target dev .

.PHONY: dev
dev: dev-image  ## Run a dev container
	docker run -it --rm -v $(CURDIR):/workspace -w /workspace mbv-dev

.PHONY: clean
clean:  ## Remove generated files
	rm -rf *.elf *.bin $(all_objects) $(deps)
	rm -rf test/ *.dSYM $(test_deps) *.o

.PHONY: help
help:           ## Show this help
	@echo Noteworthy targets:
	@egrep '^[a-zA-Z_-]+:.*?## .*$$' $(firstword $(MAKEFILE_LIST)) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
.DEFAULT_GOAL := help

#-include $(deps)
#-include $(test_deps)