[oe] Writing a test program for libserial

Elvis Dowson elvis.dowson at mac.com
Sun Jun 21 08:25:36 UTC 2009


Hi,
	I've got the basic recipe working now, but would like to tidy it up,  
just to learn how to make good bitbake recipes.

Now, if I look at the folder /tool/overo-oe/tmp/work/armv7a-angstrom- 
linux-gnueabi/libserial-test-1.6.0-r0,

I can see that the output files are located in three places:

a. directly in work/armv7a-angstrom-linux-gnueabi/libserial-test-1.6.0- 
r0/
	libserial-test-read-port
	libserial-test-write-port

b. armv7a-angstrom-linux-gnueabi/libserial-test-1.6.0-r0/image/usr/bin

c. armv7a-angstrom-linux-gnueabi/libserial-test-1.6.0-r0/install/ 
libserial-test/usr/bin


If I compare with the other recipes, I don't see the output files in  
the root folder of the work/recipe i.e. work/armv7a-angstrom-linux- 
gnueabi/libserial-test-1.6.0-r0/ doesn't contain the output files.

This is cause by my do_compile () code, i think

do_compile () {
    ${CXX} ${CXXFLAGS} ${LDFLAGS} ${WORKDIR}/src/read_port.cpp -o  
libserial-test-read-port
    ${CXX} ${CXXFLAGS} ${LDFLAGS} ${WORKDIR}/src/write_port.cpp -o  
libserial-test-write-port
}

What would the correct approach be for this case? I'm attaching the  
current version of my recipe below.

Best regards,

Elvis


File: libserial-test_1.6.0.bb

DESCRIPTION = "Serial port read & write test programs for libserial"
SECTION = "bin"
LICENSE = "GPL"
DEPENDS = "libserial"

LDFLAGS_append += "-lserial"

SRC_URI = " \
	file://src/read_port.cpp \
	file://src/write_port.cpp \
	"
	
S = "${WORKDIR}"

inherit autotools_stage
AUTOTOOLS_STAGE_PKGCONFIG = 1

do_stage() {
	autotools_stage_all
}

do_compile () {
    ${CXX} ${CXXFLAGS} ${LDFLAGS} ${WORKDIR}/src/read_port.cpp -o  
libserial-test-read-port
    ${CXX} ${CXXFLAGS} ${LDFLAGS} ${WORKDIR}/src/write_port.cpp -o  
libserial-test-write-port
}

do_install () {
    install -m 0755 -d ${D}${bindir}
    install -m 0644 ${S}/libserial-test-read-port ${D}${bindir}
    install -m 0644 ${S}/libserial-test-write-port ${D}${bindir}
}





More information about the Openembedded-devel mailing list