2013-06-12 16:23:34 +02:00
|
|
|
SRC = $(wildcard *.c)
|
|
|
|
OBJ = $(BINDIR)native-led.o
|
|
|
|
ifneq (,$(findstring ltc4150,$(USEMODULE)))
|
|
|
|
OBJ += $(BINDIR)native-ltc4150.o
|
|
|
|
endif
|
|
|
|
ifneq (,$(findstring uart0,$(USEMODULE)))
|
|
|
|
OBJ += $(BINDIR)native-uart0.o
|
|
|
|
endif
|
|
|
|
DEP = $(SRC:%.c=$(BINDIR)%.d)
|
|
|
|
|
|
|
|
INCLUDES += -I$(RIOTBOARD)/native/include/
|
|
|
|
|
2013-12-22 23:26:54 +01:00
|
|
|
EXCLUDES := -I$(RIOTBASE)/sys/posix/%
|
|
|
|
|
2013-06-12 16:23:34 +02:00
|
|
|
$(BINDIR)native_drivers.a: $(OBJ)
|
|
|
|
@$(AR) rcs $(BINDIR)${ARCH} $(OBJ)
|
|
|
|
|
|
|
|
# pull in dependency info for *existing* .o files
|
|
|
|
-include $(OBJ:.o=.d)
|
|
|
|
|
|
|
|
# compile and generate dependency info
|
|
|
|
$(BINDIR)%.o: %.c
|
2013-12-22 23:26:54 +01:00
|
|
|
$(CC) $(CFLAGS) $(filter-out $(EXCLUDES),$(INCLUDES)) $(BOARDINCLUDE) $(PROJECTINCLUDE) $(CPUINCLUDE) -c $*.c -o $(BINDIR)$*.o
|
2013-06-12 16:23:34 +02:00
|
|
|
@$(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:
|
|
|
|
rm -f $(OBJ) $(DEP)
|
|
|
|
|