2013-02-01 16:55:19 +01:00
|
|
|
SRC = $(wildcard *.c)
|
|
|
|
BINDIR = bin/
|
|
|
|
OBJ = $(SRC:%.c=$(BINDIR)%.o)## defines
|
|
|
|
|
|
|
|
DEP = $(SRC:%.c=$(BINDIR)%.d)
|
|
|
|
|
2013-02-06 12:19:39 +01:00
|
|
|
INCLUDES += -I$(RIOTBOARD)/msba2-common/include/
|
2013-02-01 16:55:19 +01:00
|
|
|
INCLUDES += -I$(RIOTBASE)/cpu/arm_common/include/
|
|
|
|
INCLUDES += -I$(RIOTBASE)/cpu/lpc2387/include/
|
|
|
|
|
|
|
|
all: $(BINDIR)msba2_base.a
|
2013-02-06 12:19:39 +01:00
|
|
|
$(MAKE) -C ../msba2-common
|
2013-02-01 16:55:19 +01:00
|
|
|
|
|
|
|
$(BINDIR)msba2_base.a: $(OBJ)
|
|
|
|
$(AR) rcs $(BINDIR)msba2_base.a $(OBJ)
|
|
|
|
|
|
|
|
# pull in dependency info for *existing* .o files
|
|
|
|
-include $(OBJ:.o=.d)
|
|
|
|
|
|
|
|
# compile and generate dependency info
|
|
|
|
$(BINDIR)%.o: %.c
|
2013-02-06 13:56:06 +01:00
|
|
|
mkdir $(BINDIR)
|
2013-02-01 16:55:19 +01:00
|
|
|
$(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-02-06 12:19:39 +01:00
|
|
|
$(MAKE) -C ../msba2-common clean
|
|
|
|
rm -f $(BINDIR)msba2_base.a $(OBJ) $(DEP)
|
2013-02-08 17:31:33 +01:00
|
|
|
@if [ -d $(BINDIR) ] ; \
|
|
|
|
then rmdir $(BINDIR) ; \
|
|
|
|
fi
|
|
|
|
|
2013-02-01 16:55:19 +01:00
|
|
|
|