mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
moved native board drivers into separate directory
split up drivers to avoid building unnecessary files
This commit is contained in:
parent
0ac14625f3
commit
c31648e2e4
@ -2,14 +2,16 @@ SRC = $(wildcard *.c)
|
|||||||
BINDIR = bin/
|
BINDIR = bin/
|
||||||
OBJ = $(SRC:%.c=$(BINDIR)%.o)## defines
|
OBJ = $(SRC:%.c=$(BINDIR)%.o)## defines
|
||||||
DEP = $(SRC:%.c=$(BINDIR)%.d)
|
DEP = $(SRC:%.c=$(BINDIR)%.d)
|
||||||
|
export ARCH = native_base.a
|
||||||
|
|
||||||
INCLUDES += -I$(RIOTBASE)/cpu/native/include/
|
INCLUDES += -I$(RIOTBASE)/cpu/native/include/
|
||||||
INCLUDES += -I$(RIOTBOARD)/native/include/
|
INCLUDES += -I$(RIOTBOARD)/native/include/
|
||||||
|
|
||||||
all: $(BINDIR)native_base.a
|
all: $(BINDIR)$(ARCH)
|
||||||
|
$(MAKE) -C drivers
|
||||||
|
|
||||||
$(BINDIR)native_base.a: $(OBJ)
|
$(BINDIR)$(ARCH): $(OBJ)
|
||||||
$(AR) rcs $(BINDIR)native_base.a $(OBJ)
|
$(AR) rcs $(BINDIR)$(ARCH) $(OBJ)
|
||||||
|
|
||||||
# pull in dependency info for *existing* .o files
|
# pull in dependency info for *existing* .o files
|
||||||
-include $(OBJ:.o=.d)
|
-include $(OBJ:.o=.d)
|
||||||
@ -23,6 +25,7 @@ $(BINDIR)%.o: %.c
|
|||||||
|
|
||||||
# remove compilation products
|
# remove compilation products
|
||||||
clean:
|
clean:
|
||||||
rm -f $(BINDIR)native_base.a $(OBJ) $(DEP)
|
${MAKE} -C drivers clean
|
||||||
|
rm -f $(BINDIR)$(ARCH) $(OBJ) $(DEP)
|
||||||
-rmdir -p $(BINDIR)
|
-rmdir -p $(BINDIR)
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ export CPU = native
|
|||||||
export PREFIX =
|
export PREFIX =
|
||||||
#export CC = @$(PREFIX)gcc
|
#export CC = @$(PREFIX)gcc
|
||||||
export AR = @$(PREFIX)ar
|
export AR = @$(PREFIX)ar
|
||||||
export CFLAGS = -std=gnu99 -Wall -m32
|
export CFLAGS += -std=gnu99 -Wall -m32
|
||||||
export ASFLAGS =
|
export ASFLAGS =
|
||||||
export AS = $(PREFIX)as
|
export AS = $(PREFIX)as
|
||||||
export LINK = $(PREFIX)gcc
|
export LINK = $(PREFIX)gcc
|
||||||
@ -14,7 +14,7 @@ export OBJCOPY = $(PREFIX)objcopy
|
|||||||
FLASHER = lpc2k_pgm
|
FLASHER = lpc2k_pgm
|
||||||
TERM = pyterm.py
|
TERM = pyterm.py
|
||||||
|
|
||||||
LINKFLAGS = -m32
|
LINKFLAGS = -m32 -gc
|
||||||
|
|
||||||
ifeq ($(strip $(PORT)),)
|
ifeq ($(strip $(PORT)),)
|
||||||
export PORT = /dev/ttyUSB0
|
export PORT = /dev/ttyUSB0
|
||||||
|
30
native/drivers/Makefile
Normal file
30
native/drivers/Makefile
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
SRC = $(wildcard *.c)
|
||||||
|
BINDIR = $(RIOTBOARD)/$(BOARD)/bin/
|
||||||
|
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/
|
||||||
|
|
||||||
|
$(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
|
||||||
|
$(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:
|
||||||
|
rm -f $(OBJ) $(DEP)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user