1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/Makefile.base
2013-03-19 22:32:22 +01:00

64 lines
2.0 KiB
Makefile

ASMSRC = $(wildcard *.s)
ASMOBJ = $(ASMSRC:%.s=$(BINDIR)%.o)
SRC = $(wildcard *.c)
OBJ = $(SRC:%.c=$(BINDIR)%.o)
DEP = $(SRC:%.c=$(BINDIR)%.d)
ifeq ($(CPU),lpc2387)
INCLUDES += -I$(MAKEBASE)/cpu/arm_common/include/
INCLUDES += -I$(MAKEBASE)/cpu/lpc2387/include
endif
ifeq ($(CPU),lpc214x)
INCLUDES += -I$(MAKEBASE)/cpu/arm_common/include/
INCLUDES += -I$(MAKEBASE)/cpu/lpc214x/include
endif
ifeq ($(CPU),msp430x16x)
INCLUDES += -I$(MAKEBASE)/cpu/msp430-common/include/
INCLUDES += -I$(MAKEBASE)/cpu/msp430x16x/include/
endif
ifeq ($(CPU),cc430)
INCLUDES += -I$(MAKEBASE)/cpu/msp430-common/include/
INCLUDES += -I$(MAKEBASE)/cpu/cc430/include/
endif
ifeq ($(CPU),native)
INCLUDES += -I$(MAKEBASE)/cpu/native/include/
endif
ifeq ($(BOARD),msba2)
INCLUDES += -I$(RIOTBOARD)/msba2/include/
INCLUDES += -I$(RIOTBOARD)/msba2-common/include/
INCLUDES += -I$(RIOTBOARD)/msba2-common/drivers/include/
endif
ifeq ($(BOARD),msb-430)
INCLUDES += -I$(RIOTBOARD)/msb-430/include/
INCLUDES += -I$(RIOTBOARD)/msb-430-common/include/
INCLUDES += -I$(RIOTBOARD)/msb-430-common/drivers/include/
endif
ifeq ($(BOARD),msb-430h)
INCLUDES += -I$(RIOTBOARD)/msb-430h/include/
INCLUDES += -I$(RIOTBOARD)/msb-430-common/include/
INCLUDES += -I$(RIOTBOARD)/msb-430-common/drivers/include/
endif
ifeq ($(BOARD),native)
INCLUDES += -I$(RIOTBOARD)/native/include/
endif
$(BINDIR)$(MODULE).a: $(OBJ) $(ASMOBJ)
$(AR) -rc $(BINDIR)$(MODULE).a $(OBJ) $(ASMOBJ)
# pull in dependency info for *existing* .o files
-include $(OBJ:.o=.d)
# compile and generate dependency info
$(BINDIR)%.o: %.c
$(CC) $(CFLAGS) $(PROJECTINCLUDE) $(BOARDINCLUDE) $(INCLUDES) -c $*.c -o $(BINDIR)$*.o
$(CC) $(CFLAGS) $(PROJECTINCLUDE) $(BOARDINCLUDE) $(INCLUDES) -MM $*.c > $(BINDIR)$*.d
@printf "$(BINDIR)"|cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d
$(BINDIR)%.o: %.s
$(AS) $(ASFLAGS) $*.s -o $(BINDIR)$*.o
# remove compilation products
clean::
rm -f $(BINDIR)$(MODULE).a $(OBJ) $(DEP) $(ASMOBJ)