X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/00bb9c112fa6dfa84d3571659527c13af7170279..7e397056b12b16fbb9a65f37a2e1aa75174c9fe8:/Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..64bb08741 --- /dev/null +++ b/Makefile @@ -0,0 +1,44 @@ +# +# Makefile for Project: USBasp +# Author: Peter Henn +# Creation Date: 2014-05-30 +# License: GNU GPL v2 (see License.txt) + +MV=@mv +ECHO=@echo +MAKE=@make +RM=@rm -f + +# Default Device and CPU Clock +DEVICE=atmega8 +F_CPU=12000000 +mhz := $(shell echo $$(( $(F_CPU)/1000000 ))) + +all: + $(MAKE) F_CPU=12000000 DEVICE=atmega8 do_firmware + $(MAKE) F_CPU=16000000 DEVICE=atmega8 do_firmware + $(MAKE) F_CPU=12000000 DEVICE=atmega88 do_firmware + $(MAKE) F_CPU=12000000 DEVICE=atmega328p do_firmware + $(MAKE) F_CPU=16000000 DEVICE=atmega328p do_firmware + +help: + @echo "Usage:" + @echo " make build firmware for specified CPUs and Speed" + @echo " make help print this text" + @echo " make clean remove redundant data" + @echo " make deepclean clean & remove hex files" + +do_firmware: + $(MAKE) clean + $(ECHO) "======>BUILDING USBasp FIRMWARE for" + $(ECHO) "CPU: $(DEVICE) - $(mhz) MHz" + $(ECHO) "." + $(MAKE) F_CPU=$(F_CPU) TARGET=$(DEVICE) -C firmware main.hex + $(MV) firmware/main.hex bin/firmware/usbasp.$(DEVICE)-$(mhz)MHz.hex + +deepclean: clean + $(RM) *~ + $(RM) bin/firmware/usbasp.*MHz.hex + +clean: + $(MAKE) -C firmware clean