2013-03-09 23:47:21 +01:00
|
|
|
ASMSRC = $(wildcard *.s)
|
2013-05-14 18:31:47 +02:00
|
|
|
ASSMSRC = $(wildcard *.S)
|
2013-03-09 23:47:21 +01:00
|
|
|
ASMOBJ = $(ASMSRC:%.s=$(BINDIR)%.o)
|
2013-05-14 18:31:47 +02:00
|
|
|
ASMOBJ += $(ASSMSRC:%.S=$(BINDIR)%.o)
|
|
|
|
|
2013-03-09 23:47:21 +01:00
|
|
|
SRC = $(wildcard *.c)
|
|
|
|
OBJ = $(SRC:%.c=$(BINDIR)%.o)
|
|
|
|
DEP = $(SRC:%.c=$(BINDIR)%.d)
|
2013-02-06 13:20:21 +01:00
|
|
|
|
2013-08-08 15:44:44 +02:00
|
|
|
.PHONY: clean
|
|
|
|
|
2013-03-23 18:38:12 +01:00
|
|
|
include $(RIOTCPU)/Makefile.base
|
|
|
|
include $(RIOTBOARD)/Makefile.base
|
2013-02-06 13:20:21 +01:00
|
|
|
|
2013-05-30 17:52:54 +02:00
|
|
|
$(BINDIR)$(MODULE).a: $(OBJ) $(ASMOBJ)
|
2013-06-11 15:50:42 +02:00
|
|
|
@$(AR) -rc $(BINDIR)$(MODULE).a $(OBJ) $(ASMOBJ)
|
2013-02-06 13:20:21 +01:00
|
|
|
|
|
|
|
# pull in dependency info for *existing* .o files
|
|
|
|
-include $(OBJ:.o=.d)
|
|
|
|
|
|
|
|
# compile and generate dependency info
|
|
|
|
$(BINDIR)%.o: %.c
|
2013-06-13 21:31:08 +02:00
|
|
|
@$(CC) $(CFLAGS) $(INCLUDES) -c $*.c -o $(BINDIR)$*.o
|
|
|
|
@$(CC) $(CFLAGS) $(INCLUDES) -MM $*.c > $(BINDIR)$*.d
|
2013-02-06 13:20:21 +01:00
|
|
|
@printf "$(BINDIR)"|cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d
|
|
|
|
|
|
|
|
$(BINDIR)%.o: %.s
|
2013-03-23 18:38:12 +01:00
|
|
|
@$(AS) $(ASFLAGS) $*.s -o $(BINDIR)$*.o
|
2013-02-06 13:20:21 +01:00
|
|
|
|
2013-05-14 18:31:47 +02:00
|
|
|
$(BINDIR)%.o: %.S
|
2013-05-15 11:18:18 +02:00
|
|
|
@gcc -c $(CFLAGS) $*.S -o $(BINDIR)$*.o
|
2013-05-14 18:31:47 +02:00
|
|
|
|
2013-02-06 13:20:21 +01:00
|
|
|
# remove compilation products
|
|
|
|
clean::
|
2013-06-11 15:50:42 +02:00
|
|
|
@rm -f $(BINDIR)$(MODULE).a $(OBJ) $(DEP) $(ASMOBJ)
|
2013-02-06 13:20:21 +01:00
|
|
|
|