2010-02-26 12:16:06 +00:00
|
|
|
# -*- makefile -*-
|
|
|
|
|
2010-09-20 20:28:22 +00:00
|
|
|
ALL_BOARDS = redbee-dev redbee-r1 redbee-usb redbee-econotag quahogcon freescale-ncb
|
2010-02-23 00:18:48 +00:00
|
|
|
|
2010-09-20 20:28:22 +00:00
|
|
|
OBJDIR = obj_$(BOARD)
|
2010-02-26 19:04:10 +00:00
|
|
|
CFLAGS += -I$(OBJDIR) -I$(MC1322X)/board -DBOARD=$(BOARD)
|
2010-02-21 23:47:12 +00:00
|
|
|
|
2010-09-20 20:28:22 +00:00
|
|
|
# Create directory and board.h include
|
|
|
|
$(OBJDIR)/board.h:
|
|
|
|
mkdir -p $(OBJDIR)
|
|
|
|
echo '/* This file was automatically generated */' > $(OBJDIR)/board.h
|
|
|
|
echo '#include "$(BOARD).h"' >> $(OBJDIR)/board.h
|
|
|
|
|
|
|
|
# $(OBJDIR)/board.a contains all the objects defined in COBJS
|
|
|
|
$(OBJDIR)/board.a: $(OBJDIR)/board.h $(OBJDIR)/board.a($(addprefix $(OBJDIR)/, $(COBJS)))
|
|
|
|
|
|
|
|
# And is built from files in the parent directory
|
|
|
|
$(OBJDIR)/%.o: %.c $(OBJDIR)/board.h
|
|
|
|
$(CC) $(CFLAGS) $(CFLAGS_THUMB) -MMD -c -o $@ $<
|
|
|
|
@$(FINALIZE_DEPENDENCY)
|
2010-02-23 20:53:00 +00:00
|
|
|
|
2010-09-20 20:28:22 +00:00
|
|
|
$(OBJDIR)/%.o: %.S $(OBJDIR)/board.h
|
|
|
|
$(CC) $(AFLAGS) -MMD -c -o $@ $<
|
|
|
|
@$(FINALIZE_DEPENDENCY)
|
|
|
|
|
|
|
|
ifneq ($(MAKECMDGOALS),clean)
|
|
|
|
-include $(wildcard $(OBJDIR)/*.d)
|
|
|
|
endif
|
2010-03-01 19:30:19 +00:00
|
|
|
|
2010-09-20 20:28:22 +00:00
|
|
|
clean::
|
|
|
|
rm -rf obj_*
|