# Make file for Si5351A-based VFO # # assumes the USART libraries have been built for the configured chip # # targets: # hex -- the Intel hex file to be made from the source C file # upload -- upload the hex file to the PIC attached to the PICkit2 # run -- allow the target to run by releasing /MCLR # deviceid -- display the device ID, name and revision # clean -- tidy the directory of all non-source files # # configure by changing down to # <<<< CHIP=16F887 PROGRAM=vfo-si5351a ODIR=build LIBS= # <<<< LOWERCASE_CHIP=$(shell echo $(CHIP) | tr '[:upper:]' '[:lower:]') .DEFAULT_GOAL := upload HEX=$(ODIR)/$(PROGRAM).hex $(ODIR): mkdir $(ODIR) # not needed yet: lcd_hd44780_pic16.c lcd_hd44780_pic16.h $(HEX): $(PROGRAM).c $(ODIR) i2c.h si5351a.h xc8 $(PROGRAM).c -M --outdir=$(ODIR) --chip=$(CHIP) -DPIC$(CHIP) --msgdisable=1273,228 $(LIBS) .PHONY: clean hex upload deviceid run sim hex: $(HEX) upload: $(HEX) pk2cmd -F$(HEX) -M -PPIC$(CHIP) deviceid: pk2cmd -I -PPIC$(CHIP) run: pk2cmd -R -PPIC$(CHIP) sim: $(HEX) gpsim -L=.:./$(ODIR) -p p$(LOWERCASE_CHIP) $(HEX) clean: rm -rf $(ODIR)