Fixed makefile from spilling object files in the wrong place

This commit is contained in:
Sebastian 2016-11-21 23:07:20 +01:00
parent b74590b99f
commit 2e91369e2c
1 changed files with 6 additions and 1 deletions

View File

@ -14,7 +14,8 @@ OBJCOPY = avr-objcopy
OBJDUMP = avr-objdump
SIZE = avr-size
OBJ = $(SRC:%.c=$(OBJDIR)/$(AVRMCU)/%.o)
SRC_TMP = $(subst ../,,$(SRC))
OBJ = $(SRC_TMP:%.c=$(OBJDIR)/$(AVRMCU)/%.o)
CFLAGS = -I ../sss7core/ -Os -Wall -Wstrict-prototypes
CFLAGS += -ffunction-sections -fdata-sections
@ -36,6 +37,10 @@ $(OBJDIR)/$(AVRMCU)/%.o : %.c $(HEADERS) Makefile
@mkdir -p $$(dirname $@)
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/$(AVRMCU)/sss7core/%.o : ../sss7core/%.c $(HEADERS) Makefile
@mkdir -p $$(dirname $@)
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/$(AVRMCU)/$(TARGET).elf : $(OBJ)
$(CC) $(LDFLAGS) $+ -o $@