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

用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 exists
make[3]: *** [/home/Joker/trunk/bin/ramips/packages/base/kf580client_0.1-1_ramips_24kec.ipk] Error 1
make[3]: Leaving directory `/home/Joker/trunk/package/kf580client'
make[2]: *** [package/kf580client/compile] Error 2
make[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 2
make[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),最终导致出错。

 
 

你可能感兴趣的:(OpenWrt)