Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

native/make: Don't use INCLUDES for building any native at all. #804

Merged
merged 1 commit into from
Mar 3, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions boards/native/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,11 @@ all: $(BINDIR)$(MODULE).a

include $(RIOTBASE)/Makefile.base

$(BINDIR)%.o: %.c
$(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -c $*.c -o $(BINDIR)$*.o
$(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -MM $*.c > $(BINDIR)$*.d
@printf "$(BINDIR)" | cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d


clean::
@for i in $(DIRS) ; do "$(MAKE)" -C $$i clean ; done ;
9 changes: 7 additions & 2 deletions boards/native/Makefile.include
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
export INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include
export NATIVEINCLUDES = -I$(RIOTBOARD)/$(BOARD)/include/
export NATIVEINCLUDES += -I$(RIOTBASE)/core/include/
export NATIVEINCLUDES += -I$(RIOTBASE)/drivers/include/

export CPU = native
export ELF = $(BINDIR)$(PROJECT).elf

Expand All @@ -23,7 +26,9 @@ export ASFLAGS =
export DEBUGGER_FLAGS = $(ELF)
export VALGRIND_FLAGS ?= --track-origins=yes
all-valgrind: export CFLAGS += -DHAVE_VALGRIND_H -g
all-valgrind: export INCLUDES += $(shell pkg-config valgrind --cflags)
all-valgrind: export NATIVEINCLUDES += $(shell pkg-config valgrind --cflags)

export INCLUDES += $(NATIVEINCLUDES)

# backward compatability with glibc <= 2.17 for native
ifeq ($(CPU),native)
Expand Down
5 changes: 5 additions & 0 deletions boards/native/drivers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ all: $(BINDIR)$(MODULE).a
@for i in $(DIRS) ; do "$(MAKE)" -C $$i ; done ;

include $(RIOTBASE)/Makefile.base

$(BINDIR)%.o: %.c
$(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -c $*.c -o $(BINDIR)$*.o
$(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -MM $*.c > $(BINDIR)$*.d
@printf "$(BINDIR)" | cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d
6 changes: 2 additions & 4 deletions cpu/native/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
MODULE = cpu

EXCLUDES := -I$(RIOTBASE)/sys/posix/%

DIRS =
ifneq (,$(filter rtc,$(USEMODULE)))
DIRS += rtc
Expand All @@ -16,8 +14,8 @@ all: $(BINDIR)$(MODULE).a
include $(RIOTBASE)/Makefile.base

$(BINDIR)%.o: %.c
$(AD)$(CC) $(CFLAGS) $(filter-out $(EXCLUDES),$(INCLUDES)) $(BOARDINCLUDE) $(PROJECTINCLUDE) $(CPUINCLUDE) -c $*.c -o $(BINDIR)$*.o
@$(CC) $(CFLAGS) $(INCLUDES) $(BOARDINCLUDE) $(PROJECTINCLUDE) $(CPUINCLUDE) -MM $*.c > $(BINDIR)$*.d
$(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -c $*.c -o $(BINDIR)$*.o
$(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -MM $*.c > $(BINDIR)$*.d
@printf "$(BINDIR)" | cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d


Expand Down
2 changes: 1 addition & 1 deletion cpu/native/Makefile.include
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export INCLUDES += -I$(RIOTCPU)/native/include
export NATIVEINCLUDES += -I$(RIOTCPU)/native/include -I$(RIOTBASE)/sys/include
6 changes: 2 additions & 4 deletions cpu/native/net/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
EXCLUDES := -I$(RIOTBASE)/sys/posix/%

MODULE = nativenet

include $(MAKEBASE)/Makefile.base

$(BINDIR)%.o: %.c
$(AD)$(CC) $(CFLAGS) $(filter-out $(EXCLUDES),$(INCLUDES)) $(BOARDINCLUDE) $(PROJECTINCLUDE) $(CPUINCLUDE) -c $*.c -o $(BINDIR)$*.o
@$(CC) $(CFLAGS) $(INCLUDES) $(BOARDINCLUDE) $(PROJECTINCLUDE) $(CPUINCLUDE) -MM $*.c > $(BINDIR)$*.d
$(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -c $*.c -o $(BINDIR)$*.o
$(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -MM $*.c > $(BINDIR)$*.d
@printf "$(BINDIR)" | cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d
5 changes: 5 additions & 0 deletions cpu/native/rtc/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
MODULE =rtc

include $(MAKEBASE)/Makefile.base

$(BINDIR)%.o: %.c
$(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -c $*.c -o $(BINDIR)$*.o
$(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -MM $*.c > $(BINDIR)$*.d
@printf "$(BINDIR)" | cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d