0

I'm using the cross compiler (arm-none-linux-gnueabi) and I wanna build a libs3-2.0 source, but I get the following error when I try to compile.

libs3-2.0$ sudo make
make: *** No rule to make target `libxml/parser.h', needed by `build/obj/simplexml.do'.  Stop.

What can I do to solve this issue? Below is the (GNU) Makefile.

working directory: /home/usrname/prj/app/framework/camera/cdma_manage/<br>
///////////////////////////////////////////////////////////////////////////////////////////

LIBS3_VER_MAJOR ?= 2
LIBS3_VER_MINOR ?= 0
LIBS3_VER := $(LIBS3_VER_MAJOR).$(LIBS3_VER_MINOR)

ifdef VERBOSE
    VERBOSE = true
    VERBOSE_ECHO = @ echo
    VERBOSE_SHOW =
    QUIET_ECHO = @ echo > /dev/null
else
    VERBOSE = false
    VERBOSE_ECHO = @ echo > /dev/null
    VERBOSE_SHOW = @
    QUIET_ECHO = @ echo
endif

ifndef BUILD
    ifdef DEBUG
        BUILD := build-debug
    else
        BUILD := build
    endif
endif

ifndef DESTDIR
    DESTDIR := /usr
endif

ifndef CURL_LIBS
    CURL_LIBS := $(shell curl-config --libs)
endif

ifndef CURL_CFLAGS
    CURL_CFLAGS := $(shell curl-config --cflags)
endif

    ifndef LIBXML2_LIBS
        LIBXML2_LIBS := $(shell xml2-config --libs)
    endif

    ifndef LIBXML2_CFLAGS
        LIBXML2_CFLAGS := $(shell xml2-config --cflags)
    endif

    ifndef LIBXML2_LIBS
        LIBXML2_LIBS := -L../libxml2-2.7.2/.libs -lxml2 -lm
    endif

    ifndef LIBXML2_CFLAGS
        LIBXML2_CFLAGS := -I/home/usrname/prj/app/framework/camera/cdma_manage/libxml2-2.7.2/include
    endif

    ifndef CFLAGS
        ifdef DEBUG
            CFLAGS := -g
        else
            CFLAGS := -O3
        endif
    endif

CFLAGS += -Wall -Werror -Wshadow -Wextra -Iinc \
        $(CURL_CFLAGS) $(LIBXML2_CFLAGS) \
        -DLIBS3_VER_MAJOR=\"$(LIBS3_VER_MAJOR)\" \
        -DLIBS3_VER_MINOR=\"$(LIBS3_VER_MINOR)\" \
        -DLIBS3_VER=\"$(LIBS3_VER)\" \
        -D__STRICT_ANSI__ \
        -D_ISOC99_SOURCE \
        -D_POSIX_C_SOURCE=200112L

LDFLAGS = $(CURL_LIBS) $(LIBXML2_LIBS) -lpthread

.PHONY: all
all: exported test

.PHONY: exported
exported: libs3 s3 headers

.PHONY: install
install: exported
        $(QUIET_ECHO) $(DESTDIR)/bin/s3: Installing executable
        $(VERBOSE_SHOW) install -Dps -m u+rwx,go+rx $(BUILD)/bin/s3 \
        $(DESTDIR)/bin/s3
        $(QUIET_ECHO) \
        $(DESTDIR)/lib/libs3.so.$(LIBS3_VER): Installing shared library
        $(VERBOSE_SHOW) install -Dps -m u+rw,go+r \
        $(BUILD)/lib/libs3.so.$(LIBS3_VER_MAJOR) \
        $(DESTDIR)/lib/libs3.so.$(LIBS3_VER)
        $(QUIET_ECHO) \
        $(DESTDIR)/lib/libs3.so.$(LIBS3_VER_MAJOR): Linking shared library
        $(VERBOSE_SHOW) ln -sf libs3.so.$(LIBS3_VER) \
        $(DESTDIR)/lib/libs3.so.$(LIBS3_VER_MAJOR)
        $(QUIET_ECHO) $(DESTDIR)/lib/libs3.so: Linking shared library
        $(VERBOSE_SHOW) ln -sf libs3.so.$(LIBS3_VER_MAJOR) $(DESTDIR)/lib/libs3.so
        $(QUIET_ECHO) $(DESTDIR)/lib/libs3.a: Installing static library
        $(VERBOSE_SHOW) install -Dp -m u+rw,go+r $(BUILD)/lib/libs3.a \
        $(DESTDIR)/lib/libs3.a
        $(QUIET_ECHO) $(DESTDIR)/include/libs3.h: Installing header
        $(VERBOSE_SHOW) install -Dp -m u+rw,go+r $(BUILD)/include/libs3.h \
        $(DESTDIR)/include/libs3.h

.PHONY: uninstall
uninstall:
        $(QUIET_ECHO) Installed files: Uninstalling
        $(VERBOSE_SHOW) \
        rm -f $(DESTDIR)/bin/s3 \
        $(DESTDIR)/include/libs3.h \
        $(DESTDIR)/lib/libs3.a \
        $(DESTDIR)/lib/libs3.so \
        $(DESTDIR)/lib/libs3.so.$(LIBS3_VER_MAJOR) \
        $(DESTDIR)/lib/libs3.so.$(LIBS3_VER)

$(BUILD)/obj/%.o: src/%.c
        $(QUIET_ECHO) $@: Compiling object
        @ mkdir -p $(dir $(BUILD)/dep/$<)
        @ /opt/armv7/codesourcery/bin/arm-none-linux-gnueabi-gcc $(CFLAGS) -M -MG -MQ $@ -DCOMPILINGDEPENDENCIES \
        -o $(BUILD)/dep/$(<:%.c=%.d) -c $<
        @ mkdir -p $(dir $@)
        $(VERBOSE_SHOW) /opt/armv7/codesourcery/bin/arm-none-linux-gnueabi-gcc $(CFLAGS) -o $@ -c $<

$(BUILD)/obj/%.do: src/%.c
        $(QUIET_ECHO) $@: Compiling dynamic object
        @ mkdir -p $(dir $(BUILD)/dep/$<)
        @ /opt/armv7/codesourcery/bin/arm-none-linux-gnueabi-gcc $(CFLAGS) -M -MG -MQ $@ -DCOMPILINGDEPENDENCIES \
        -o $(BUILD)/dep/$(<:%.c=%.dd) -c $<
        @ mkdir -p $(dir $@)
        $(VERBOSE_SHOW) /opt/armv7/codesourcery/bin/arm-none-linux-gnueabi-gcc $(CFLAGS) -fpic -fPIC -o $@ -c $< 

LIBS3_SHARED = $(BUILD)/lib/libs3.so.$(LIBS3_VER_MAJOR)
LIBS3_STATIC = $(BUILD)/lib/libs3.a

.PHONY: libs3
libs3: $(LIBS3_SHARED) $(LIBS3_STATIC)

LIBS3_SOURCES := acl.c bucket.c error_parser.c general.c \
        object.c request.c request_context.c \
        response_headers_handler.c service_access_logging.c \
        service.c simplexml.c util.c

$(LIBS3_SHARED): $(LIBS3_SOURCES:%.c=$(BUILD)/obj/%.do)
        $(QUIET_ECHO) $@: Building shared library
        @ mkdir -p $(dir $@)
        $(VERBOSE_SHOW) /opt/armv7/codesourcery/bin/arm-none-linux-gnueabi-gcc -shared -Wl,-soname,libs3.so.$(LIBS3_VER_MAJOR) \
        -o $@ $^ $(LDFLAGS)

$(LIBS3_STATIC): $(LIBS3_SOURCES:%.c=$(BUILD)/obj/%.o)
        $(QUIET_ECHO) $@: Building static library
        @ mkdir -p $(dir $@)
        $(VERBOSE_SHOW) $(AR) cr $@ $^

... abbriviated.
//////////////////////////////////////////////////////////////////////////////////////////////
4

2 回答 2

0

问题似乎是 make 没有找到 libxml/parser.h,但它需要构建其他东西。您是否检查过此文件是否在包含路径中?

于 2013-07-26T05:56:05.940 回答
0
ifndef LIBXML2_CFLAGS
        LIBXML2_CFLAGS := -I/home/usrname/prj/app/framework/camera/cdma_manage/libxml2-2.7.2/include
endif

应该在之前添加

ifndef LIBXML2_CFLAGS
        LIBXML2_CFLAGS := $(shell xml2-config --cflags)
endif
于 2014-06-04T02:52:40.007 回答