2013-09-19 16:53:35 +02:00
|
|
|
SRC = $(wildcard *.c)
|
2013-02-06 12:19:39 +01:00
|
|
|
BINDIR = $(RIOTBOARD)/$(BOARD)/bin/
|
|
|
|
OBJ = $(SRC:%.c=$(BINDIR)%.o)## defines
|
|
|
|
DEP = $(SRC:%.c=$(BINDIR)%.d)
|
|
|
|
|
|
|
|
INCLUDES += -I$(RIOTBOARD)/msba2-common/include/
|
|
|
|
INCLUDES += -I$(RIOTBASE)/cpu/arm_common/include/
|
|
|
|
INCLUDES += -I$(RIOTBASE)/cpu/lpc2387/include/
|
|
|
|
INCLUDES += -I$(RIOTBASE)/drivers/include/
|
2013-08-07 12:32:01 +02:00
|
|
|
INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include
|
2013-02-06 12:19:39 +01:00
|
|
|
|
2013-03-07 19:25:48 +01:00
|
|
|
.PHONY: $(BINDIR)msba2_common_base.a
|
|
|
|
|
2013-02-06 12:19:39 +01:00
|
|
|
all: $(BINDIR)msba2_common_base.a
|
2013-08-07 12:32:01 +02:00
|
|
|
"$(MAKE)" -C drivers
|
2013-02-06 12:19:39 +01:00
|
|
|
|
|
|
|
$(BINDIR)msba2_common_base.a: $(OBJ)
|
2013-02-21 17:23:55 +01:00
|
|
|
$(AR) rcs $(BINDIR)$(ARCH) $(OBJ)
|
2013-02-06 12:19:39 +01:00
|
|
|
|
|
|
|
# pull in dependency info for *existing* .o files
|
|
|
|
-include $(OBJ:.o=.d)
|
|
|
|
|
|
|
|
# compile and generate dependency info
|
|
|
|
$(BINDIR)%.o: %.c
|
|
|
|
$(CC) $(CFLAGS) $(INCLUDES) $(BOARDINCLUDE) $(PROJECTINCLUDE) $(CPUINCLUDE) -c $*.c -o $(BINDIR)$*.o
|
|
|
|
$(CC) $(CFLAGS) $(INCLUDES) $(BOARDINCLUDE) $(PROJECTINCLUDE) $(CPUINCLUDE) -MM $*.c > $(BINDIR)$*.d
|
|
|
|
@printf "$(BINDIR)"|cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d
|
|
|
|
|
|
|
|
# remove compilation products
|
|
|
|
clean:
|
2013-08-07 12:32:01 +02:00
|
|
|
"$(MAKE)" -C drivers clean
|
2013-02-06 12:19:39 +01:00
|
|
|
rm -f $(OBJ) $(DEP)
|
|
|
|
|