.PHONY: all
-all: $(NAME)
+all: $(NAME).bin
prog: CFLAGS += -DEEPROM_WRITE
prog: clean all
SRC = $(shell find . -name \*.c)
OBJS = ${SRC:%.c=${OBJDIR}/%.o}
+$(NAME).bin: $(NAME)
+ @echo "Creating image : \e[32m$@\e[37m"
+ @$(CROSS_COMPILE)objcopy -R .stack -R .bss -O binary $^ $@
+ @ls -l $@
+ @echo Done.
+
$(NAME): $(OBJS)
@echo "Linking ..."
@$(CC) $(CFLAGS) $(LINKOPTS) $(OBJS) -o $@ -I$(INCLUDES)
- @echo "Creating image : \e[32m$@.bin\e[37m"
- @$(CROSS_COMPILE)objcopy -R .stack -R .bss -O binary $@ $@.bin
- @ls -l $@.bin
- @echo Done.
${OBJDIR}/%.o: %.c
@mkdir -p $(dir $@)