osd-contiki/board/Makefile.board
Jim Paris b00708cf78 Put main dir on include path
Now the user can supply their own foo.h that obj_foo/board.h will include
2010-09-25 15:26:44 -04:00

40 lines
1.1 KiB
Makefile

# -*- makefile -*-
ALL_BOARDS = redbee-dev redbee-r1 redbee-usb redbee-econotag quahogcon freescale-ncb
OBJDIR = obj_$(BOARD)
CFLAGS += -I. -I$(OBJDIR) -I$(MC1322X)/board -DBOARD=$(BOARD)
# Create directory and board.h include
$(OBJDIR)/board.h:
$(call pretty,GEN,$@)
$(Q)mkdir -p $(OBJDIR)
$(Q)echo '/* This file was automatically generated */' > $(OBJDIR)/board.h
$(Q)echo '#include "$(BOARD).h"' >> $(OBJDIR)/board.h
# $(OBJDIR)/board.a contains all the objects defined in COBJS
ifdef COBJS
$(OBJDIR)/board.a: $(OBJDIR)/board.h $(OBJDIR)/board.a($(addprefix $(OBJDIR)/, $(COBJS)))
else
$(OBJDIR)/board.a: $(OBJDIR)/board.h
$(call pretty,AR (empty),$@)
$Q$(AR) $(ARFLAGS) $@
endif
# And is built from files in the parent directory
$(OBJDIR)/%.o: %.c $(OBJDIR)/board.h
$(call pretty,CC,$@)
$Q$(CC) $(CFLAGS) $(CFLAGS_THUMB) -MMD -c -o $@ $<
@$(FINALIZE_DEPENDENCY)
$(OBJDIR)/%.o: %.S $(OBJDIR)/board.h
$(call pretty,AS,$@)
$(CC) $(AFLAGS) -MMD -c -o $@ $<
@$(FINALIZE_DEPENDENCY)
ifneq ($(MAKECMDGOALS),clean)
-include $(wildcard $(OBJDIR)/*.d)
endif
clean::
rm -rf obj_*