Module: xenomai-2.6 Branch: master Commit: 689e0433ab907958f162181d9b8c3b49012dd67a URL: http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=689e0433ab907958f162181d9b8c3b49012dd67a
Author: Gilles Chanteperdrix <[email protected]> Date: Mon Dec 26 18:21:46 2011 +0100 examples: fix compilation issues --- examples/common/Makefile | 7 ++++--- examples/common/hw_direct_io.c | 4 ++-- examples/native/Makefile | 9 +++++---- examples/native/trivial-periodic.c | 2 ++ examples/posix/Makefile | 4 ++-- examples/rtdm/driver-api/Makefile | 7 ++++--- examples/rtdm/profiles/can/Makefile | 7 ++++--- examples/rtdm/profiles/ipc/Makefile | 7 ++++--- examples/rtdm/profiles/serial/Makefile | 7 ++++--- 9 files changed, 31 insertions(+), 23 deletions(-) diff --git a/examples/common/Makefile b/examples/common/Makefile index 9bbb95b..514122e 100644 --- a/examples/common/Makefile +++ b/examples/common/Makefile @@ -32,9 +32,9 @@ endif CC=$(shell $(XENOCONFIG) --cc) -CFLAGS=$(shell $(XENOCONFIG) --xeno-cflags) $(MY_CFLAGS) +CFLAGS=$(shell $(XENOCONFIG) --skin=posix --cflags) $(MY_CFLAGS) -LDFLAGS=$(shell $(XENOCONFIG) --xeno-ldflags) $(MY_LDFLAGS) -O +LDFLAGS=$(shell $(XENOCONFIG) --skin=posix --ldflags) $(MY_LDFLAGS) -O # This includes the library path of given Xenomai into the binary to make live # easier for beginners if Xenomai's libs are not in any default search path. @@ -60,8 +60,9 @@ OBJS := ${patsubst %, %.o, $(MODULES)} CLEANMOD := ${patsubst %, .%*, $(MODULES)} PWD := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi) +PATCHLEVEL:=$(shell sed 's/^PATCHLEVEL = *\(.*\)/\1/;t;d' $(KSRC)/Makefile) ### Kernel 2.6 -ifeq ($(findstring 2.6,$(KSRC)),2.6) +ifeq ($(strip $(PATCHLEVEL)),6) obj-m := $(OBJS) EXTRA_CFLAGS := -I$(KSRC)/include/xenomai -I$(KSRC)/include/xenomai/posix $(ADD_CFLAGS) diff --git a/examples/common/hw_direct_io.c b/examples/common/hw_direct_io.c index 5176c0a..6e82cfa 100644 --- a/examples/common/hw_direct_io.c +++ b/examples/common/hw_direct_io.c @@ -19,8 +19,8 @@ #include <fcntl.h> #include <stdlib.h> #include <unistd.h> -#include <posix/time.h> -#include <posix/pthread.h> +#include <time.h> +#include <pthread.h> #include <sys/mman.h> #include <unistd.h> diff --git a/examples/native/Makefile b/examples/native/Makefile index b279751..40ed737 100644 --- a/examples/native/Makefile +++ b/examples/native/Makefile @@ -32,9 +32,9 @@ endif CC=$(shell $(XENOCONFIG) --cc) -CFLAGS=$(shell $(XENOCONFIG) --xeno-cflags) $(MY_CFLAGS) +CFLAGS=$(shell $(XENOCONFIG) --skin=native --cflags) $(MY_CFLAGS) -LDFLAGS=$(shell $(XENOCONFIG) --xeno-ldflags) $(MY_LDFLAGS) -lnative +LDFLAGS=$(shell $(XENOCONFIG) --skin=native --ldflags) $(MY_LDFLAGS) # This includes the library path of given Xenomai into the binary to make live # easier for beginners if Xenomai's libs are not in any default search path. @@ -52,7 +52,7 @@ endif ###### SPECIAL TARGET RULES ###### rtprint: rtprint.c - $(CC) $(CFLAGS) $? $(LDFLAGS) -lrtdk -o $@ + $(CC) $(CFLAGS) $? $(LDFLAGS) -o $@ @@ -66,8 +66,9 @@ OBJS := ${patsubst %, %.o, $(MODULES)} CLEANMOD := ${patsubst %, .%*, $(MODULES)} PWD := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi) +PATCHLEVEL:=$(shell sed 's/^PATCHLEVEL = *\(.*\)/\1/;t;d' $(KSRC)/Makefile) ### Kernel 2.6 -ifeq ($(findstring 2.6,$(KSRC)),2.6) +ifeq ($(strip $(PATCHLEVEL)),6) obj-m := $(OBJS) EXTRA_CFLAGS := -I$(KSRC)/include/xenomai -I$(KSRC)/include/xenomai/posix $(ADD_CFLAGS) diff --git a/examples/native/trivial-periodic.c b/examples/native/trivial-periodic.c index c0422db..d7d8945 100644 --- a/examples/native/trivial-periodic.c +++ b/examples/native/trivial-periodic.c @@ -69,4 +69,6 @@ int main(int argc, char* argv[]) pause(); rt_task_delete(&demo_task); + + return 0; } diff --git a/examples/posix/Makefile b/examples/posix/Makefile index b4bf463..f5c445f 100644 --- a/examples/posix/Makefile +++ b/examples/posix/Makefile @@ -35,9 +35,9 @@ endif CC=$(shell $(XENOCONFIG) --cc) -CFLAGS=-DCONSUMER $(shell $(XENOCONFIG) --posix-cflags) $(APP_CFLAGS) +CFLAGS=-DCONSUMER $(shell $(XENOCONFIG) --skin=posix --cflags) $(APP_CFLAGS) -LDFLAGS=$(shell $(XENOCONFIG) --posix-ldflags) $(APP_LDFLAGS) +LDFLAGS=$(shell $(XENOCONFIG) --skin=posix --ldflags) $(APP_LDFLAGS) # This includes the library path of given Xenomai into the binary to make live # easier for beginners if Xenomai's libs are not in any default search path. diff --git a/examples/rtdm/driver-api/Makefile b/examples/rtdm/driver-api/Makefile index c32a5e5..e943a35 100644 --- a/examples/rtdm/driver-api/Makefile +++ b/examples/rtdm/driver-api/Makefile @@ -32,9 +32,9 @@ endif CC=$(shell $(XENOCONFIG) --cc) -CFLAGS=$(shell $(XENOCONFIG) --xeno-cflags) $(MY_CFLAGS) +CFLAGS=$(shell $(XENOCONFIG) --skin=native --cflags) $(MY_CFLAGS) -LDFLAGS=$(shell $(XENOCONFIG) --xeno-ldflags) $(MY_LDFLAGS) -lnative -lrtdm +LDFLAGS=$(shell $(XENOCONFIG) --skin=native --ldflags) $(MY_LDFLAGS) -lrtdm # This includes the library path of given Xenomai into the binary to make live # easier for beginners if Xenomai's libs are not in any default search path. @@ -60,8 +60,9 @@ OBJS := ${patsubst %, %.o, $(MODULES)} CLEANMOD := ${patsubst %, .%*, $(MODULES)} PWD := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi) +PATCHLEVEL:=$(shell sed 's/^PATCHLEVEL = *\(.*\)/\1/;t;d' $(KSRC)/Makefile) ### Kernel 2.6 -ifeq ($(findstring 2.6,$(KSRC)),2.6) +ifeq ($(strip $(PATCHLEVEL)),6) obj-m := $(OBJS) EXTRA_CFLAGS := -I$(KSRC)/include/xenomai -I$(KSRC)/include/xenomai/posix $(ADD_CFLAGS) diff --git a/examples/rtdm/profiles/can/Makefile b/examples/rtdm/profiles/can/Makefile index 8c97e7f..aaed1d8 100644 --- a/examples/rtdm/profiles/can/Makefile +++ b/examples/rtdm/profiles/can/Makefile @@ -32,9 +32,9 @@ endif CC=$(shell $(XENOCONFIG) --cc) -CFLAGS=$(shell $(XENOCONFIG) --posix-cflags) $(MY_CFLAGS) +CFLAGS=$(shell $(XENOCONFIG) --skin=posix --cflags) $(MY_CFLAGS) -LDFLAGS=$(shell $(XENOCONFIG) --posix-ldflags) $(MY_LDFLAGS) -lrtdm +LDFLAGS=$(shell $(XENOCONFIG) --skin=posix --ldflags) $(MY_LDFLAGS) -lrtdm # This includes the library path of given Xenomai into the binary to make live # easier for beginners if Xenomai's libs are not in any default search path. @@ -60,8 +60,9 @@ OBJS := ${patsubst %, %.o, $(MODULES)} CLEANMOD := ${patsubst %, .%*, $(MODULES)} PWD := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi) +PATCHLEVEL:=$(shell sed 's/^PATCHLEVEL = *\(.*\)/\1/;t;d' $(KSRC)/Makefile) ### Kernel 2.6 -ifeq ($(findstring 2.6,$(KSRC)),2.6) +ifeq ($(strip $(PATCHLEVEL)),6) obj-m := $(OBJS) EXTRA_CFLAGS := -I$(KSRC)/include/xenomai -I$(KSRC)/include/xenomai/posix $(ADD_CFLAGS) diff --git a/examples/rtdm/profiles/ipc/Makefile b/examples/rtdm/profiles/ipc/Makefile index dbd3d1c..78e5c32 100644 --- a/examples/rtdm/profiles/ipc/Makefile +++ b/examples/rtdm/profiles/ipc/Makefile @@ -35,9 +35,9 @@ endif CC=$(shell $(XENOCONFIG) --cc) -CFLAGS=$(shell $(XENOCONFIG) --posix-cflags) $(MY_CFLAGS) +CFLAGS=$(shell $(XENOCONFIG) --skin=posix --cflags) $(MY_CFLAGS) -LDFLAGS=$(shell $(XENOCONFIG) --posix-ldflags) $(MY_LDFLAGS) -lrtdm -lrtdk +LDFLAGS=$(shell $(XENOCONFIG) --skin=posix --ldflags) $(MY_LDFLAGS) -lrtdm # Add the Xenomai libdir to the runtime library search path for the # binary, to make life easier for beginners if Xenomai's libs are not @@ -64,8 +64,9 @@ OBJS := ${patsubst %, %.o, $(MODULES)} CLEANMOD := ${patsubst %, .%*, $(MODULES)} PWD := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi) +PATCHLEVEL:=$(shell sed 's/^PATCHLEVEL = *\(.*\)/\1/;t;d' $(KSRC)/Makefile) ### Kernel 2.6 -ifeq ($(findstring 2.6,$(KSRC)),2.6) +ifeq ($(strip $(PATCHLEVEL)),6) obj-m := $(OBJS) EXTRA_CFLAGS := -I$(KSRC)/include/xenomai -I$(KSRC)/include/xenomai/posix $(ADD_CFLAGS) diff --git a/examples/rtdm/profiles/serial/Makefile b/examples/rtdm/profiles/serial/Makefile index d1631d2..620db16 100644 --- a/examples/rtdm/profiles/serial/Makefile +++ b/examples/rtdm/profiles/serial/Makefile @@ -32,9 +32,9 @@ endif CC=$(shell $(XENOCONFIG) --cc) -CFLAGS=$(shell $(XENOCONFIG) --xeno-cflags) $(MY_CFLAGS) +CFLAGS=$(shell $(XENOCONFIG) --skin=native --cflags) $(MY_CFLAGS) -LDFLAGS=$(shell $(XENOCONFIG) --xeno-ldflags) $(MY_LDFLAGS) -lnative -lrtdm +LDFLAGS=$(shell $(XENOCONFIG) --skin=native --ldflags) $(MY_LDFLAGS) -lrtdm # This includes the library path of given Xenomai into the binary to make live # easier for beginners if Xenomai's libs are not in any default search path. @@ -60,8 +60,9 @@ OBJS := ${patsubst %, %.o, $(MODULES)} CLEANMOD := ${patsubst %, .%*, $(MODULES)} PWD := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi) +PATCHLEVEL:=$(shell sed 's/^PATCHLEVEL = *\(.*\)/\1/;t;d' $(KSRC)/Makefile) ### Kernel 2.6 -ifeq ($(findstring 2.6,$(KSRC)),2.6) +ifeq ($(strip $(PATCHLEVEL)),6) obj-m := $(OBJS) EXTRA_CFLAGS := -I$(KSRC)/include/xenomai -I$(KSRC)/include/xenomai/posix $(ADD_CFLAGS) _______________________________________________ Xenomai-git mailing list [email protected] https://mail.gna.org/listinfo/xenomai-git
