From: "Anton Erasmus" <[EMAIL PROTECTED]>

On 14 Sep 2005 at 6:21, John Altstadt wrote:
[...]
> %.elf: $(OBJ)
>          @echo
>          @echo $(MSG_LINKING) $@
>          $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
>          rm version.o

There is a better way to force the recompile of version.c
Add the following at the end of your makefile

# Always compile version.c to get correct compilation date and time
.PHONY: version.c


ITYM

.PHONY: version.o

Another method that works with make utilities besides GNU's (and is perhaps more self-documenting) is

version.o: FORCE

FORCE:

IOW, make version.o depend on FORCE, and make FORCE a phony target (no prerequisites and no commands). As long as you don't make a file named FORCE, version.o will always be made (compiled from version.c) Of course, if you are using GNU make, it's good to add

.PHONY: FORCE

so FORCEd commands are executed even if a file named FORCE is created...

Regards,
  -=Dave




_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to