# # Makefile for GCBasic # 24.04.2015 - Paolo Iocco # # Usage: # make build file=10f200-blink cpu=PIC10F200 # make flash_pic file=10f200-blink cpu=PIC10F200 # make build file=tiny88-blink cpu=tiny88 # make flash_avr file=tiny88-blink cpu=tiny88 # # # pk2cmd -pPIC16C84 -f%e.hex -m -r -t # avrdude -c USBasp -P usb -p AT%2 -U flash:w:%1:i # #global variables CC = gcbasic OBJDIR=./Release ifeq ($(OS),Windows_NT) DIRGCB = E:/GCB@Syn/GreatCowBasic else DIRGCB = /usr/share/GCBasic endif # Default values for file and processor file = main cpu = PIC16C84 # Start of rules default: @echo Please specify a "rule", "file" and a "cpu" dir: @echo @echo Makefile for GreatCowBasic. V0.9 @echo 24.04.2015 - Paolo Iocco @echo @echo Tools located at $(DIRGCB) test -d $(OBJDIR) || mkdir $(OBJDIR) @echo build: dir @echo compiling: $(file).gcb for processor: $(cpu) @echo $(DIRGCB)/$(CC) -O:$(OBJDIR)/$(file).asm -A:GCASM -K:A -V -NP $(file).gcb @echo flash_pic: $(OBJDIR)/$(file).hex @echo flashing $(file).hex for processor: $(cpu) @echo pk2cmd -p$(cpu) -f$(OBJDIR)/$(file).hex -m -r -t @echo flash_avr: $(OBJDIR)/$(file).hex @echo flashing $(OBJDIR)/$(file).hex for processor: $(cpu) @echo avrdude -c USBasp -P usb -p AT$(cpu) -U flash:w:$(OBJDIR)/$(file).hex:i @echo