Always make directories before building files in OBJDIR

This lets us put things like fatfs/ff.o in COBJS
This commit is contained in:
Jim Paris 2010-10-03 14:32:59 -04:00 committed by Mariano Alvira
parent 1b4de5d8e7
commit d5118ba63d

View file

@ -10,7 +10,7 @@ OBJDIR_COBJS = $(addprefix $(OBJDIR)/, $(COBJS))
# Create directory and board.h include # Create directory and board.h include
$(OBJDIR)/board.h: $(OBJDIR)/board.h:
$(call pretty,GEN,$@) $(call pretty,GEN,$@)
$(Q)mkdir -p $(OBJDIR) @mkdir -p $(dir $@)
$(Q)echo '/* This file was automatically generated */' > $(OBJDIR)/board.h $(Q)echo '/* This file was automatically generated */' > $(OBJDIR)/board.h
$(Q)echo '#include "$(BOARD).h"' >> $(OBJDIR)/board.h $(Q)echo '#include "$(BOARD).h"' >> $(OBJDIR)/board.h
@ -32,11 +32,13 @@ TARGET_OBJ += $(OBJDIR)/board.a
# And is built from files in the parent directory # And is built from files in the parent directory
$(OBJDIR)/%.o: %.c $(OBJDIR)/board.h $(FORCE_C_DEPENDS) $(OBJDIR)/%.o: %.c $(OBJDIR)/board.h $(FORCE_C_DEPENDS)
$(call pretty,CC,$@) $(call pretty,CC,$@)
@mkdir -p $(dir $@)
$Q$(CC) $(CFLAGS) $(CFLAGS_THUMB) -MMD -c -o $@ $< $Q$(CC) $(CFLAGS) $(CFLAGS_THUMB) -MMD -c -o $@ $<
@$(FINALIZE_DEPENDENCY) @$(FINALIZE_DEPENDENCY)
$(OBJDIR)/%.o: %.S $(OBJDIR)/board.h $(OBJDIR)/%.o: %.S $(OBJDIR)/board.h
$(call pretty,AS,$@) $(call pretty,AS,$@)
@mkdir -p $(dir $@)
$(CC) $(AFLAGS) -MMD -c -o $@ $< $(CC) $(AFLAGS) -MMD -c -o $@ $<
@$(FINALIZE_DEPENDENCY) @$(FINALIZE_DEPENDENCY)