1 ###### CONFIGURATION ######
3 ### List of applications to be build
4 APPLICATIONS
= ex03a ex03b ex03c
6 ### Note: to override the search path for the xeno-config script, use "make XENO=..."
9 ### List of modules to be build
12 ### Note: to override the kernel source path, use "make KSRC=..."
16 ###### USER SPACE BUILD (no change required normally) ######
17 ifeq ($(KERNELRELEASE
),)
18 ifneq ($(APPLICATIONS
),)
20 ### Default Xenomai installation path
23 XENOCONFIG
=$(shell PATH
=$(XENO
):$(XENO
)/bin
:$(PATH
) which xeno-config
2>/dev
/null
)
28 @echo
">>> Invoke make like this: \"make XENO=/path/to/xeno-config\" <<<"
33 CC
=$(shell $(XENOCONFIG
) --cc)
35 CFLAGS
=$(shell $(XENOCONFIG
) --xeno-cflags
) $(MY_CFLAGS
)
37 LDFLAGS
=$(shell $(XENOCONFIG
) --xeno-ldflags
) $(MY_LDFLAGS
) -lnative
39 # This includes the library path of given Xenomai into the binary to make live
40 # easier for beginners if Xenomai's libs are not in any default search path.
41 LDFLAGS
+=-Xlinker
-rpath
-Xlinker
$(shell $(XENOCONFIG
) --libdir)
48 $(RM
) $(APPLICATIONS
) *.o
55 ###### SPECIAL TARGET RULES ######
57 $(CC
) $(CFLAGS
) $?
$(LDFLAGS
) -lrtdk
-o
$@
61 ###### KERNEL MODULE BUILD (no change required normally) ######
64 ### Default to sources of currently running kernel
65 KSRC ?
= /lib
/modules
/$(shell uname
-r
)/build
67 OBJS
:= ${patsubst %, %.o
, $(MODULES
)}
68 CLEANMOD
:= ${patsubst %, .
%*, $(MODULES
)}
69 PWD
:= $(shell if
[ "$$PWD" != "" ]; then echo
$$PWD; else pwd
; fi
)
72 ifeq ($(findstring 2.6,$(KSRC
)),2.6)
75 EXTRA_CFLAGS
:= -I
$(KSRC
)/include/xenomai
-I
$(KSRC
)/include/xenomai
/posix
$(ADD_CFLAGS
)
78 $(MAKE
) -C
$(KSRC
) SUBDIRS
=$(PWD
) modules
83 ARCH ?
= $(shell uname
-i
)
84 INCLUDE
:= -I
$(KSRC
)/include/xenomai
-I
$(KSRC
)/include/xenomai
/compat
-I
$(KSRC
)/include/xenomai
/posix
85 CFLAGS
+= $(shell $(MAKE
) -s
-C
$(KSRC
) CC
=$(CC
) ARCH
=$(ARCH
) SUBDIRS
=$(PWD
) modules
) $(INCLUDE
)
91 ## Target for capturing 2.4 module CFLAGS
96 $(RM
) $(CLEANMOD
) *.o
*.ko
*.mod.c Module
*.symvers