openwrt:install: cannot create directory ‘XXX’:File exists 的出错处理

来源:互联网 发布:美国最好大数据公司 编辑:程序博客网 时间:2024/05/18 09:08

用openwrt把一个程序编译成固件时,出现下面的错误输出:

install -m0755 /home/Joker/trunk/build_dir/target-mipsel_24kec+dsp_musl-1.1.11/kf580client/daemon.sh /home/Joker/trunk/build_dir/target-mipsel_24kec+dsp_musl-1.1.11/kf580client/ipkg-ramips_24kec/kf580client/bin/install -m0755 /home/Joker/trunk/build_dir/target-mipsel_24kec+dsp_musl-1.1.11/kf580client/o2_machine /home/Joker/trunk/build_dir/target-mipsel_24kec+dsp_musl-1.1.11/kf580client/ipkg-ramips_24kec/kf580client/bin/install -d -m0755 /home/Joker/trunk/build_dir/target-mipsel_24kec+dsp_musl-1.1.11/kf580client/br_machine /home/Joker/trunk/build_dir/target-mipsel_24kec+dsp_musl-1.1.11/kf580client/ipkg-ramips_24kec/kf580client/bin/install: cannot create directory '/home/Joker/trunk/build_dir/target-mipsel_24kec+dsp_musl-1.1.11/kf580client/br_machine': File existsmake[3]: *** [/home/Joker/trunk/bin/ramips/packages/base/kf580client_0.1-1_ramips_24kec.ipk] Error 1make[3]: Leaving directory `/home/Joker/trunk/package/kf580client'make[2]: *** [package/kf580client/compile] Error 2make[2]: Leaving directory `/home/Joker/trunk'make[1]: *** [/home/Joker/trunk/staging_dir/target-mipsel_24kec+dsp_musl-1.1.11/stamp/.package_compile] Error 2make[1]: Leaving directory `/home/Joker/trunk'make: *** [world] Error 2

后来在仔细检查要编译的程序的Makefile时,发现在define Packet/$(PKG_NAME)/install时发现关键字用错了:

 define Package/$(PKG_NAME)/install $(INSTALL_DIR) $(1)/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/daemon.sh $(1)/bin/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/o2_machine $(1)/bin/ $(INSTALL_DIR) $(PKG_BUILD_DIR)/br_machine $(1)/bin/


第5行,正确的是$(INSTALL_BIN),但我错写成了$(INSTALL_DIR),最终导致出错。

                                             
1 0