*** stock_iot-lab_M3/openwsn/cross-layers/Makefile Thu Apr 24 11:01:37 2014 --- riot-openwsn-wip/openwsn/cross-layers/Makefile Mon May 12 13:09:35 2014 *************** *** 0 **** --- 1,32 ---- + SUBMOD:=$(shell basename $(CURDIR)).a + #BINDIR = $(RIOTBASE)/bin/ + SRC = $(wildcard *.c) + OBJ = $(SRC:%.c=$(BINDIR)%.o) + DEP = $(SRC:%.c=$(BINDIR)%.d) + + INCLUDES += -I$(RIOTBASE) -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/core/include -I$(RIOTBASE)/drivers/include -I$(RIOTBASE)/drivers/cc110x_ng/include -I$(RIOTBASE)/cpu/arm_common/include -I$(RIOTBASE)/sys/net/include/ + INCLUDES += -I$(CURDIR)/02a-MAClow + INCLUDES += -I$(CURDIR)/02b-MAChigh + INCLUDES += -I$(CURDIR)/03a-IPHC + INCLUDES += -I$(CURDIR)/03b-IPv6 + INCLUDES += -I$(CURDIR)/04-TRAN + INCLUDES += -I$(CURDIR)/cross-layers + + .PHONY: $(BINDIR)$(SUBMOD) + + $(BINDIR)$(SUBMOD): $(OBJ) + $(AD)$(AR) rcs $(BINDIR)$(MODULE) $(OBJ) + + # pull in dependency info for *existing* .o files + -include $(OBJ:.o=.d) + + # compile and generate dependency info + $(BINDIR)%.o: %.c + $(AD)$(CC) $(CFLAGS) $(INCLUDES) -c $*.c -o $(BINDIR)$*.o + $(AD)$(CC) $(CFLAGS) $(INCLUDES) -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)