make dep:'依赖'

时间:2017-06-03 17:36:45

标签: ios makefile pjsip

我一直在尝试为需要SIP的iOS项目编译PJSIP库。在this教程之后,我能够运行configure-iphone脚本。下一步是为依赖项运行make dep,但遗憾的是它失败了一些错误,我不知道。我也尝试编辑makefile,所以它直接指向文件,但我仍然得到错误,所以它可以找到该文件。

/Applications/Xcode.app/Contents/Developer/usr/bin/make -f Samples.mak depend
make[2]: Nothing to be done for `depend'.

是我得到的错误。

make文件:

include ../../build.mak
include $(PJDIR)/build/common.mak

export LIBDIR := ../lib
export BINDIR := ../bin

RULES_MAK := $(PJDIR)/build/rules.mak
SAMPLES_MAK := $(PJDIR)/pjsip-apps/build/Samples.mak


###############################################################################
# Gather all flags.
#
export _CFLAGS  := $(CC_CFLAGS) $(OS_CFLAGS) $(HOST_CFLAGS) $(M_CFLAGS) \
           $(PJ_CFLAGS) $(CFLAGS) $(CC_INC)../../pjsip/include \
           $(CC_INC)../../pjlib/include \
           $(CC_INC)../../pjlib-util/include \
           $(CC_INC)../../pjnath/include \
           $(CC_INC)../../pjmedia/include
export _CXXFLAGS:= $(_CFLAGS) $(CC_CXXFLAGS) $(OS_CXXFLAGS) $(M_CXXFLAGS) \
           $(HOST_CXXFLAGS) $(CXXFLAGS)
export _LDFLAGS := $(CC_LDFLAGS) $(OS_LDFLAGS) $(M_LDFLAGS) $(HOST_LDFLAGS) \
           $(APP_LDFLAGS) $(APP_LDLIBS) $(LDFLAGS)

###############################################################################
# Defines for building PJSUA
#
export PJSUA_SRCDIR = ../src/pjsua
export PJSUA_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \
            main.o pjsua_app.o pjsua_app_cli.o pjsua_app_common.o \
            pjsua_app_config.o pjsua_app_legacy.o
export PJSUA_CFLAGS += $(PJ_CFLAGS) $(CFLAGS)
export PJSUA_CXXFLAGS += $(PJ_CXXFLAGS) $(CFLAGS)
export PJSUA_LDFLAGS += $(PJ_LDFLAGS) $(PJ_LDLIBS) $(LDFLAGS)
export PJSUA_EXE:=pjsua-$(TARGET_NAME)$(HOST_EXE)


###############################################################################
# Defines for building pjsystest
#
export PJSYSTEST_SRCDIR = ../src/pjsystest
export PJSYSTEST_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \
            systest.o main_console.o
export PJSYSTEST_CFLAGS += $(PJ_CFLAGS) $(CFLAGS)
export PJSYSTEST_CXXFLAGS += $(PJ_CXXFLAGS) $(CFLAGS)
export PJSYSTEST_LDFLAGS += $(PJ_LDFLAGS) $(PJ_LDLIBS) $(LDFLAGS)
export PJSYSTEST_EXE:=pjsystest-$(TARGET_NAME)$(HOST_EXE)


export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT

TARGETS := $(PJSUA_EXE) $(PJSYSTEST_EXE) samples

all: $(TARGETS)

swig:
    $(MAKE) -C ../src/swig

doc:

dep: depend
distclean: realclean

.PHONY: all dep depend clean realclean distclean
.PHONY: $(TARGETS)
.PHONY: $(PJSUA_EXE) $(PJSYSTEST_EXE)

pjsua: $(PJSUA_EXE)
$(PJSUA_EXE):
    $(MAKE) -f $(RULES_MAK) APP=PJSUA app=pjsua $(subst /,$(HOST_PSEP),$(BINDIR)/$@)
    @if echo "$(TARGET_NAME)" | grep -q "apple-darwin_ios$$"; then \
      for F in $(filter %$(TARGET_NAME).a,$(PJ_LIBXX_FILES)); do \
        if test -f $$F; then \
          tmp=`echo $${F##*/} | sed -e "s/\-$(TARGET_NAME)\.a/.a/"`; \
          ln -sf $$F ../src/pjsua/ios/$$tmp; \
        fi; \
      done; \
    fi;

pjsystest: $(PJSYSTEST_EXE)
$(PJSYSTEST_EXE):
    $(MAKE) -f $(RULES_MAK) APP=PJSYSTEST app=pjsystest $(subst /,$(HOST_PSEP),$(BINDIR)/$@)

samples:
    $(MAKE) -f $(SAMPLES_MAK)

.PHONY: pjsua.ko
pjsua.ko:
    $(MAKE) -f $(RULES_MAK) APP=PJSUA app=pjsua $(subst /,$(HOST_PSEP),$(LIBDIR)/$@)

clean depend realclean:
    $(MAKE) -f $(RULES_MAK) APP=PJSUA app=pjsua $@
    $(MAKE) -f $(RULES_MAK) APP=PJSYSTEST app=pjsystest $@
    #Problem happens in the next row!
    $(MAKE) -f $(SAMPLES_MAK) $@
    @if test "$@" = "depend"; then \
      echo '$(BINDIR)/$(PJSUA_EXE): $(APP_LIB_FILES)' >> .pjsua-$(TARGET_NAME).depend; \
      echo '$(BINDIR)/$(PJSYSTEST_EXE): $(APP_LIB_FILES)' >> .pjsystest-$(TARGET_NAME).depend; \
    fi
    @if echo "$(TARGET_NAME)" | grep -q "apple-darwin_ios$$"; then \
      for F in $(filter %$(TARGET_NAME).a,$(PJ_LIBXX_FILES)); do \
        tmp=`echo $${F##*/} | sed -e "s/\-$(TARGET_NAME)\.a/.a/"`; \
        rm -f ../src/pjsua/ios/$$tmp; \
      done; \
    fi;

就像我说的那样,我添加了SAMPLES_MAK变量,但遗憾的是它并没有帮助。我还发现哪一行给了我错误,它接近文件$(MAKE) -f $(SAMPLES_MAK) $@的末尾。

2 个答案:

答案 0 :(得分:0)

使用official文档进行构建。它适用于iOS的所有当前架构100%。

答案 1 :(得分:0)

通常这意味着您不小心(?)在工作目录中创建了名为@Entity @Table(name = "town") public class Town extends BasicEntity { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "town_id_seq") @SequenceGenerator(name = "town_id_seq", sequenceName = "town_id_seq", allocationSize = 1) protected Long id; private String name; // getters and setters... } 的文件或目录。因此,make会看到该文件或目录,并且由于makefile没有列出depend目标的任何先决条件,因此它认为目标是最新的。

这就是为什么通常将这些类型的帮助程序目标声明为depend,但显然makefile不会这样做。