Add support for 18 MHz Clock
[pub/USBasp.git] / Makefile
1 #
2 # Makefile for Project: USBasp
3 # Author: Peter Henn
4 # Creation Date: 2014-05-30
5 # License: GNU GPL v2 (see License.txt)
6
7 MV=@mv
8 ECHO=@echo
9 MAKE=@make
10 RM=@rm -f
11
12 # Default Device and CPU Clock
13 DEVICE=atmega8
14 F_CPU=12000000
15 mhz := $(shell echo $$(( $(F_CPU)/1000000 )))
16
17 all:
18 $(MAKE) F_CPU=12000000 DEVICE=atmega8 do_firmware
19 $(MAKE) F_CPU=16000000 DEVICE=atmega8 do_firmware
20 $(MAKE) F_CPU=12000000 DEVICE=atmega88 do_firmware
21 $(MAKE) F_CPU=12000000 DEVICE=atmega328p do_firmware
22 $(MAKE) F_CPU=16000000 DEVICE=atmega328p do_firmware
23 $(MAKE) F_CPU=18000000 DEVICE=atmega328p do_firmware
24
25 help:
26 @echo "Usage:"
27 @echo " make build firmware for specified CPUs and Speed"
28 @echo " make help print this text"
29 @echo " make clean remove redundant data"
30 @echo " make deepclean clean & remove hex files"
31
32 do_firmware:
33 $(MAKE) clean
34 $(ECHO) "======>BUILDING USBasp FIRMWARE for"
35 $(ECHO) "CPU: $(DEVICE) - $(mhz) MHz"
36 $(ECHO) "."
37 $(MAKE) F_CPU=$(F_CPU) TARGET=$(DEVICE) -C firmware main.hex
38 $(MV) firmware/main.hex bin/firmware/usbasp.$(DEVICE)-$(mhz)MHz.hex
39
40 deepclean: clean
41 $(RM) *~
42 $(RM) bin/firmware/usbasp.*MHz.hex
43
44 clean:
45 $(MAKE) -C firmware clean