I'm having a little bit off a problem getting my Makefile to work as I want to.
What happens is that I get a total rebuild every time I build.
This is a short version off my Makefile.
#TARGET := avr32 TARGET := x86 ifeq ($(TARGET), avr32) CROSS_COMPILE := avr32-linux- else CROSS_COMPILE := endif CC := $(CROSS_COMPILE)gcc OBJECTS = main.o config.o all: $(OBJECTS) $(CC) $(CFLAGS) -o $(NAME) build/*.o rebuild: clean all index main.o: src/main.c $(CC) $(CFLAGS) -c $< -o build/$@ config.o: src/config/config.c $(CC) $(CFLAGS) -c $< -o build/$@ .PHONY: clean clean: $(RM) build/*.o $(NAME)
It feels like my problem lays with all those "build/" in there but I don't know how to replace them.