1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00
RIOT/native/Makefile
Oliver Hahm c31648e2e4 moved native board drivers into separate directory
split up drivers to avoid building unnecessary files
2013-06-12 16:23:34 +02:00

32 lines
899 B
Makefile

SRC = $(wildcard *.c)
BINDIR = bin/
OBJ = $(SRC:%.c=$(BINDIR)%.o)## defines
DEP = $(SRC:%.c=$(BINDIR)%.d)
export ARCH = native_base.a
INCLUDES += -I$(RIOTBASE)/cpu/native/include/
INCLUDES += -I$(RIOTBOARD)/native/include/
all: $(BINDIR)$(ARCH)
$(MAKE) -C drivers
$(BINDIR)$(ARCH): $(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
-mkdir -p $(BINDIR)
$(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:
${MAKE} -C drivers clean
rm -f $(BINDIR)$(ARCH) $(OBJ) $(DEP)
-rmdir -p $(BINDIR)