c - fatal error : opening dependency file

标签 c git makefile public-key-encryption contiki

我正在尝试在 contiki 操作系统上使用 ECC 库。
但是我得到了一个依赖错误。我认为问题出在我的 Makefile 上,但我不确定哪里出了问题。

我是从源码下载的https://github.com/nist-emntg/ecc-light-certificate ,但是在我从源代码克隆 git 之后,我在使用 git submodule update 时遇到了问题,所以我手动下载 contiki 文件并将其粘贴到 contiki 文件夹中。
这可能是问题所在吗?

错误信息

> make TARGET=cooja clean 
rm -f *~ *core core *.srec \
    *.lst *.map \
    *.cprg *.bin *.data contiki*.a *.firmware core-labels.S *.ihex *.ini \
    *.ce *.co
rm -rf 
rm -rf obj_cooja

> make sender-node.cooja TARGET=cooja 
  CC        sender-node.c
sender-node.c: In function 'process_thread_sender_node_process':
sender-node.c:104:11: warning: unused variable 'pubKey' [-Wunused-variable]
mkdir obj_cooja
  CC        ../../../platform/cooja/./contiki-cooja-main.c
../../../platform/cooja/./contiki-cooja-main.c: In function 'contiki_init':
../../../platform/cooja/./contiki-cooja-main.c:230:14: warning: variable 'shortaddr' set but not used [-Wunused-but-set-variable]
../../../platform/cooja/./contiki-cooja-main.c:288:5: warning: passing argument 1 of 'rimeaddr_copy' from incompatible pointer type [enabled by default]
../../../core/./net/rime/rimeaddr.h:79:6: note: expected 'union rimeaddr_t *' but argument is of type 'uint8_t *'
mv contiki-cooja-main.o obj_cooja/mtype371.o
  CC        ../../../../ecc/ecc.c
../../../../ecc/ecc.c:700:1: fatal error: opening dependency file obj_cooja/../../../../ecc/ecc.d: No such file or directory
compilation terminated.
make: *** [obj_cooja/../../../../ecc/ecc.o] Error 1
Process returned error code 2

这是我的生成文件

all: sender-node receiver-node root-node
extra: example tools tests
CONTIKI=../../..

WITH_UIP6=1
UIP_CONF_IPV6=1

include $(CONTIKI)/../Makefile.curve
CURVE_DIR=$(CONTIKI)/../ecc/curve-params
CFLAGS+= -DUIP_CONF_IPV6_RPL\
         -DSHA2_USE_INTTYPES_H \
         -DWITH_SHA256 \
         -D$(DOMAIN_PARAMS) \
         -DTHIRTYTWO_BIT_PROCESSOR \
         -DDOMAIN_PARAMS=$(DOMAIN_PARAMS)

CFLAGS+=-DPROJECT_CONF_H=\"project-conf.h\"

PROJECT_SOURCEFILES += $(CONTIKI)/../ecc/ecc.c $(CONTIKI)/../ecc/ecdsa.c $(CONTIKI)/../ecc/nn.c $(CONTIKI)/../sha2/sha2.c $(CONTIKI)/../certificate/certificate.c
PROJECTDIRS += sha2 ecc $(CURVE_DIR) certificate

include $(CONTIKI)/../ecc/curve-params/Makefile.curve_params

# mc1322x is little endian only
ifeq ($(TARGET),econotag)
CFLAGS+= -DWORDS_LITTLEENDIAN
endif

ifdef WITH_COMPOWER
APPS+=powertrace
CFLAGS+= -DCONTIKIMAC_CONF_COMPOWER=1 -DWITH_COMPOWER=1 -DQUEUEBUF_CONF_NUM=4
endif

ifdef SERVER_REPLY
CFLAGS+=-DSERVER_REPLY=$(SERVER_REPLY)
endif
ifdef PERIOD
CFLAGS+=-DPERIOD=$(PERIOD)
endif

include $(CONTIKI)/Makefile.include
example:
    make -C example

tools:
    make -C tools

tests:
    make -C tests

最佳答案

but I had problem using git submodule update after I git clone from the source, so I manually download and paste the contiki file into the contiki folder.

然后你不能只下载任何 contiki 文件,因为子模块的想法是引用另一个 repo 的精确 SHA1。

再次尝试克隆主仓库,这次使用 --recursive(并确保使用最新的 Git 2.11.1)

cd /path/to/ly/local/clone/of/ecc-light-certificate 
cd ..
move ecc-light-certificate ecc-light-certificate.old
git clone --recursive https://github.com/nist-emntg/ecc-light-certificate

错误是:

no such remote ref 7a493c44edb6952bf82fc808b9dd91c30d49c871 
Fetched in submodule path 'contiki', but it did not contain 7a493c44edb6952bf82fc808b9dd91c30d49c871.  
Direct fetching of that commit failed

第一个:https://github.com/tcheneau/contiki@7a493c44edb6952bf82fc808b9dd91c30d49c871确实存在。

但是,查看其 commit page 7a493c4 ,你可以看到它不属于任何分支或标签:它是一个提交,仍然保存在 GitHub 远程仓库中,但默认情况下获取(因为,同样,没有分支或标签包含它)

您需要在 nist-emntg/ecc-light-certificate/issues 上打开一个问题项目以提醒他们子模块 contiki 的不存在的提交引用。

如果您查找该提交消息,您会发现 commit 1396dfd来自原生fix-native-build branch :

C:\Users\vonc\prog\git\ecc-light-certificate\contiki>git log --all --grep="prevent the native target"
commit 1396dfd817424eb7d3218cc6c51186f80b032e9f
Author: Tony Cheneau <tony.cheneau@nist.gov>
Date:   Fri Oct 25 17:53:27 2013 -0400

    Fix a typo (?) that would prevent the native target from building the examples.

这是典型的精心挑选的提交。

解决你现在的情况,直接checkout正确的commit:

C:\Users\vonc\prog\git\ecc-light-certificate\contiki>git checkout 1396dfd817424eb7d3218cc6c51186f80b032e9f
Checking out files: 100% (3223/3223), done.
Note: checking out '1396dfd817424eb7d3218cc6c51186f80b032e9f'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 1396dfd81... Fix a typo (?) that would prevent the native target from building the examples.

C:\Users\vonc\prog\git\ecc-light-certificate\contiki>git st
HEAD detached at 1396dfd81
nothing to commit, working tree clean

关于c - fatal error : opening dependency file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42048281/

相关文章:

c - 为什么这种检测机器存储方式的方法不正确? (使用C语言)

将字符转换为十六进制

git - OS X : Git with client certificates rejected

git pull 总是导致 merge

git - 如何在 IntelliJ IDEA 中存储 SSH 主机 key

c - 查找字符串的最后一个字母

c - 以下问题的答案是什么,哪些选项不会读取给定格式的日期?

makefile - 在 Makefile 本身中包含 make 的参数

c++ - 请解释这个 Makefile - 似乎缺少可执行规则

makefile - Makefile 中是否有 __DIR__ 的等效项?