サンプルプロジェクトから、親ディレクトリを "../bin"として参照しようとするmakefileがあります。これは "make install"を実行しているときには動作しないようです。私が手にエラーがある:Makefile - 親ディレクトリを参照する際の問題
cp: cannot stat `/bin/build/*': No such file or directory
プロジェクトのレイアウトは次のとおりです。
/binに
/SRC /メイク
(だから私はメイクファイルを実行すると、現在のディレクトリは/ src /です)
親ディレクトリを参照しているようです".."は間違っています。 {$ CURDIR}変数を使って現在のディレクトリを参照することができますが、親ディレクトリを参照するための適切な変数や方法を知る必要があるので、/ bin /が正しく参照されています。私はmakefileを動かすことでこれを回避できるかもしれないと思うが、将来の使用のためにこれを行う本当の方法を知りたい。
メイクファイルは、私はGNUが12
おかげでLinuxのミントに3.81を作り使用しています
# The name of the extension.
extension_name := xulschoolhello
# The UUID of the extension.
extension_uuid := [email protected]
# The name of the profile dir where the extension can be installed.
profile_dir := 8mtbjosv.development
# The zip application to be used.
ZIP := zip
# The target location of the build and build files.
bin_dir := ../bin ##### problem ######
# The target XPI file.
xpi_file := $(bin_dir)/$(extension_name)2.xpi
# The type of operating system this make command is running on.
os_type := $(patsubst darwin%,darwin,$(shell echo $(OSTYPE)))
# The location of the extension profile.
ifeq ($(os_type), darwin)
profile_location := \
~/Library/Application\ Support/Firefox/Profiles/$(profile_dir)/extensions/\{$(extension_uuid)\}
else
ifeq ($(os_type), linux-gnu)
profile_location := \
~/.mozilla/firefox/$(profile_dir)/extensions/
else
profile_location := \
"$(subst \,\\,$(APPDATA))\\Mozilla\\Firefox\\Profiles\\$(profile_dir)\\extensions\\{$(extension_uuid)}"
endif
endif
# The temporary location where the extension tree will be copied and built.
build_dir := $(bin_dir)/build ##### problem ######
# This builds the extension XPI file.
.PHONY: all
all: $(xpi_file)
@echo
@echo "Build finished successfully."
@echo
# This cleans all temporary files and directories created by 'make'.
.PHONY: clean
clean:
@rm -rf $(build_dir)
@rm -f $(xpi_file)
@echo "Cleanup is done."
# The sources for the XPI file.
xpi_built := install.rdf \
chrome.manifest \
$(wildcard content/*.js) \
$(wildcard content/*.xul) \
$(wildcard content/*.xml) \
$(wildcard content/*.css) \
$(wildcard skin/*.css) \
$(wildcard skin/*.png) \
$(wildcard locale/*/*.dtd) \
$(wildcard locale/*/*.properties)
$(build_dir) $(xpi_built): $(xpi_built)
# This builds everything except for the actual XPI, and then it copies it to the
# specified profile directory, allowing a quick update that requires no install.
.PHONY: install
install: $(build_dir) $(xpi_built)
@echo "Installing in profile folder: $(profile_location)"
@cp -Rf $(build_dir)/* $(profile_location) ##### problem ######
@echo "Installing in profile folder. Done!"
@echo
$(xpi_file): $(xpi_built)
@echo "Creating XPI file."
@$(ZIP) $(xpi_file) $(xpi_built)
@echo "Creating XPI file. Done!"
(問題のアールは、#####の問題######で強調)、このようになります。 。
@echo "Installing in profile folder: $(profile_location)"
@echo ${build_dir}
@echo ${profile_location}
の
出力は次のとおりです。私はあなたが先のフォルダ、$(profile_location)
は、存在し、それが書き込み可能であることをことをチェックしてみてください
Installing in profile folder: ~/.mozilla/firefox/8mtbjosv.development/extensions/
../bin/build
/home/owner/.mozilla/firefox/8mtbjosv.development/extensions/
問題ではないようです。私はchmod'd $(profile_location)と同じエラーを取得します。行末も問題ありません。 – Bryan
これは単なる奇妙なことです... cpの代わりに '$(build_dir)'と '$(profile_location)'にエコーを行いますか?また、ここでエラーをタイプしたのですか?それとも端末からコピーしましたか?あなたが慎重に見れば、引用符には小さな矛盾があります...これは手がかりかもしれません。 –
出力は端末からまっすぐです - それは何が原因か分かりませんが奇妙に見えます。あなたが質問の最後にあなたが要求した出力を追加しました。 – Bryan