CC:=xc8 CFLAGS:=-I. --chip=16F1778 -Q -Wall SRC:=logger.c spi.c sd.c ff.c diskio.c uart.c util.c dac.c DEP:=spi.h sd.h ff.h diskio.h integer.h uart.h logger.h util.h dac.h PRS:=$(subst .c,.p1,$(SRC)) OBJ:=logger.hex all: $(OBJ) $(OBJ): $(PRS) $(CC) $(CFLAGS) $^ $(PRS): %.p1: %.c $(DEP) $(CC) $(CFLAGS) -o$@ --pass1 $< clean: $(RM) all.cof $(addprefix startup.,as lst obj rlf)\ $(foreach s,$(SRC),$(addprefix $(subst .c,.,$(s)), as cmf cof d hex hxl lst obj p1 pre rlf sdb sym))