1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/Makefile.base
Ludwig Ortmann c6553f6492 interrupt handling rewrite
(including uart0 integration, rt-extension removal)
2013-05-14 18:31:47 +02:00

35 lines
1005 B
Makefile

ASMSRC = $(wildcard *.s)
ASSMSRC = $(wildcard *.S)
ASMOBJ = $(ASMSRC:%.s=$(BINDIR)%.o)
ASMOBJ += $(ASSMSRC:%.S=$(BINDIR)%.o)
SRC = $(wildcard *.c)
OBJ = $(SRC:%.c=$(BINDIR)%.o)
DEP = $(SRC:%.c=$(BINDIR)%.d)
include $(RIOTCPU)/Makefile.base
include $(RIOTBOARD)/Makefile.base
$(BINDIR)$(MODULE).a: $(OBJ) $(ASMOBJ) $(ASSMOBJ)
$(AR) -rc $(BINDIR)$(MODULE).a $(OBJ) $(ASMOBJ) $(ASSMOBJ)
# 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
$(BINDIR)%.o: %.S
@gcc -c -m32 $*.S -o $(BINDIR)$*.o
# remove compilation products
clean::
rm -f $(BINDIR)$(MODULE).a $(OBJ) $(DEP) $(ASMOBJ) $(ASSMOBJ)