1 # Makefile - Rules for building PIC32 deployment payloads 2 # 3 # Copyright (C) 2015, 2017, 2018 Paul Boddie <paul@boddie.org.uk> 4 # Copyright (C) Xiangfu Liu <xiangfu@sharism.cc> 5 # 6 # This program is free software: you can redistribute it and/or modify 7 # it under the terms of the GNU General Public License as published by 8 # the Free Software Foundation, either version 3 of the License, or 9 # (at your option) any later version. 10 # 11 # This program is distributed in the hope that it will be useful, 12 # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 # GNU General Public License for more details. 15 # 16 # You should have received a copy of the GNU General Public License 17 # along with this program. If not, see <http://www.gnu.org/licenses/>. 18 19 .PHONY: all clean distclean 20 21 all: $(HEX) $(SREC) 22 23 clean: 24 rm -f $(OBJ) $(TARGET) $(HEX) $(SREC) $(DUMP) *.map 25 26 distclean: clean 27 echo "Nothing else to clean." 28 29 $(HEX): $(TARGET) 30 $(OBJCOPY) -O ihex $(TARGET) $(HEX) 31 32 $(SREC): $(TARGET) 33 $(OBJCOPY) -O srec $(TARGET) $(SREC) 34 35 $(TARGET): $(OBJ) 36 $(LD) $(LDFLAGS) -T $(SCRIPT) $(OBJ) -o $@ 37 $(OBJDUMP) -D $(TARGET) > $(DUMP) 38 $(OBJDUMP) -h $(TARGET) > $(MAP) 39 $(NM) -n $(TARGET) > System.map 40 41 .c.o: 42 $(CC) -c $(CFLAGS) $< -o $@ 43 44 .S.o: 45 $(CC) -c $(CFLAGS) $< -o $@