Makefile (597B)
1 .POSIX: 2 3 BIN = prog 4 CC = sdcc 5 CPPFLAGS = 6 CFLAGS = --use-non-free -mpic14 -p16f877a ${CPPFLAGS} 7 PIC = PIC16F877A 8 9 SRC = main.c \ 10 tmr0.c \ 11 lcd.c \ 12 i2c.c \ 13 bme280.c \ 14 util.c 15 16 OBJ = ${SRC:.c=.o} 17 18 all: options ${BIN} 19 20 options: 21 @echo ${BIN} build options: 22 @echo "CC = ${CC}" 23 @echo "CFLAGS = ${CFLAGS}" 24 25 ${BIN}: ${OBJ} 26 ${CC} ${OBJ} ${CFLAGS} -o $@ 27 28 .c.o: 29 ${CC} -c ${CFLAGS} $< 30 31 flash: all 32 pk2cmd -P ${PIC} -X -M -F ${BIN}.hex 33 34 erase: all 35 pk2cmd -P ${PIC} -E -F ${BIN}.hex 36 37 clean: 38 rm -f *.hex *.asm *.cod *.hex *.lst *.o *.core 39 40 .PHONY: all options clean erase flash