Thanks!
Here is the complete Makefile:
---------------------------------------------------------------------------------------------
# define the C compiler to use
CC = gcc
# define any directories containing header files other than /usr/include
KSRC := /lib/modules/$(shell uname -r)/source
XENO_DESTDIR:=/
XENO_CONFIG:=$(XENO_DESTDIR)/usr/xenomai/bin/xeno-config
XENO_POSIX_CFLAGS:=$(shell DESTDIR=$(XENO_DESTDIR) $(XENO_CONFIG) --skin=posix
--cflags)
XENO_POSIX_LIBS:=$(shell DESTDIR=$(XENO_DESTDIR) $(XENO_CONFIG) --skin=posix
--ldflags)
# define any compile-time flags
CFLAGS = -Wall -g $(XENO_POSIX_CFLAGS)
INCLUDES = -I$(KSRC)/include/xenomai -I$(KSRC)/include/xenomai/posix
-I$(KSRC)/arch/arm/mach-omap2
# define any libraries to link into executable:
# if I want to link in libraries (libx.so or libx.a) I use the -llibname
# option, something like (this will link in libmylib.so and libm.so:
LIBS = -l$(XENO_POSIX_LIBS)
# define the C source files
SRCS = rtdm_dht11-app.c
# define the C object files
OBJS = $(SRCS:.c=.o)
# define the executable file
MAIN = mycc
#
# The following part of the makefile is generic; it can be used to
# build any executable just by changing the definitions above and by
# deleting dependencies appended to the file from 'make depend'
#
.PHONY: depend clean
all: $(MAIN)
@echo Simple compiler named mycc has been compiled
$(MAIN): $(OBJS)
$(CC) $(CFLAGS) $(INCLUDES) -o $(MAIN) $(OBJS) $(LFLAGS) $(LIBS)
# this is a suffix replacement rule for building .o's from .c's
# it uses automatic variables $<: the name of the prerequisite of
# the rule(a .c file) and $@: the name of the target of the rule (a .o file)
# (see the gnu make manual section about automatic variables)
.c.o:
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
clean:
$(RM) *.o *~ $(MAIN)
depend: $(SRCS)
makedepend $(INCLUDES) $^
# DO NOT DELETE THIS LINE -- make depend needs it
------------------------------------------------------------------------------------------------------------
-----Original Message-----
From: Gilles Chanteperdrix [mailto:[email protected]]
Sent: 3. november 2014 17:45
To: Terje Frøysa
Cc: [email protected]
Subject: Re: [Xenomai] Xenoma 2.6.4 missing posix/xeno_config.h ?
On Mon, Nov 03, 2014 at 04:40:15PM +0000, Terje Frøysa wrote:
> That's correct.
>
> The /usr/include/time.h holds this code, hence the clockid_t should be
> defined.
>
> Can the files in the /usr/inlcude directory be overshadowed by some other
> include files?
No. But some compilation flags may disable these types, which are defined only
for some versions of the posix standard.
>
> The Makefile has grown quite complex:
>
> KSRC := /lib/modules/$(shell uname -r)/source
>
> XENO_DESTDIR:=/
> XENO_CONFIG:=$(XENO_DESTDIR)/usr/xenomai/bin/xeno-config
> XENO_POSIX_CFLAGS:=$(shell DESTDIR=$(XENO_DESTDIR) $(XENO_CONFIG)
> --skin=posix --cflags) XENO_POSIX_LIBS:=$(shell
> DESTDIR=$(XENO_DESTDIR) $(XENO_CONFIG) --skin=posix --ldflags)
>
> # define any compile-time flags
> CFLAGS = -Wall -g $(XENO_POSIX_CFLAGS)
>
> INCLUDES = -I$(KSRC)/include/xenomai -I$(KSRC)/include/xenomai/posix
> -I$(KSRC)/arch/arm/mach-omap2
You do not need to include $(KSRC)/include/xenomai and
-I$(KSRC)/include/xenomai/posix, these directories are for building kernel
modules only, not for building applications.
>
> # define library paths in addition to /usr/lib
> # if I wanted to include libraries not in /usr/lib I'd specify
> # their path using -Lpath, something like:
> #LFLAGS = -L/home/newhall/lib -L../lib
>
> # define any libraries to link into executable:
> # if I want to link in libraries (libx.so or libx.a) I use the -llibname
> # option, something like (this will link in libmylib.so and libm.so:
> LIBS = -l$(XENO_POSIX_LIBS)
Just LIBS=$(XENO_POSIX_LIBS) without the -l
Coud you show us the complete Makefile so that we see all the flags you pass to
gcc?
--
Gilles.
_______________________________________________
Xenomai mailing list
[email protected]
http://www.xenomai.org/mailman/listinfo/xenomai