Firefox addon Makefile赢得';不创建和复制文件
我有下面的Makefile代码。如果在命令行中运行“make”,它将创建xpi文件。但是,当我运行“makeinstall”命令时,它会显示“在概要文件文件夹中安装.Done!”,但是找不到.xpi,而且在我需要复制它的路径中也没有 我昨天完成了这项工作,但今天我丢失了所有数据,需要从scrath开始,似乎我遗漏了一些东西。不知道是什么Firefox addon Makefile赢得';不创建和复制文件,firefox-addon,makefile,mozilla,Firefox Addon,Makefile,Mozilla,我有下面的Makefile代码。如果在命令行中运行“make”,它将创建xpi文件。但是,当我运行“makeinstall”命令时,它会显示“在概要文件文件夹中安装.Done!”,但是找不到.xpi,而且在我需要复制它的路径中也没有 我昨天完成了这项工作,但今天我丢失了所有数据,需要从scrath开始,似乎我遗漏了一些东西。不知道是什么 # The name of the extension. extension_name := helloworld@xulschool.com # T
# The name of the extension.
extension_name := helloworld@xulschool.com
# The UUID of the extension.
extension_uuid := helloworld@xulschool.com
# The name of the profile dir where the extension can be installed.
profile_dir := wiuxd07g.default
# The zip application to be used.
ZIP := zip
# The target location of the build and build files.
bin_dir := ../bin
# The target XPI file.
xpi_file := $(bin_dir)/$(extension_name).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/\{$(extension_uuid)\}
else
profile_location := \
"$(subst \,\\,$(APPDATA))\\Mozilla\\Firefox\\Profiles\\$(profile_dir)\\extensions\\"
endif
endif
# The temporary location where the extension tree will be copied and built.
build_dir := $(bin_dir)/build
# 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)
# 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 ../bin/* $(profile_location)
@echo "Installing in profile folder. Done!"
@echo
$(xpi_file): $(build_dir) $(xpi_built)
@echo "Creating XPI file."
@$(ZIP) $(xpi_file) $(xpi_built)
@echo "Creating XPI file. Done!"
$(build_dir)/%: %
@cp -f $< $@
$(build_dir):
@if [ ! -x $(build_dir) ]; \
then \
mkdir $(build_dir); \
fi
#扩展名的名称。
扩展名:=helloworld@xulschool.com
#扩展的UUID。
扩展_uuid:=helloworld@xulschool.com
#可安装扩展的配置文件目录的名称。
profile_dir:=wiuxd07g.default
#要使用的zip应用程序。
ZIP:=ZIP
#生成和生成文件的目标位置。
bin_dir:=../bin
#目标XPI文件。
xpi\u文件:=$(bin\u dir)/$(扩展名)。xpi
#运行此make命令的操作系统类型。
os_类型:=$(patsubst darwin%,darwin,$(shell echo$(OSTYPE)))
#扩展配置文件的位置。
ifeq($(os_类型),达尔文)
配置文件位置:=\
~/Library/Application\Support/Firefox/Profiles/$(profile\u dir)/extensions/\{$(extension\u uuid)\}
其他的
ifeq($(os_类型),linux gnu)
配置文件位置:=\
~/.mozilla/firefox/$(profile\u dir)/extensions/\{$(extension\u uuid)\}
其他的
配置文件位置:=\
“$(subst\,\,$(APPDATA))\\Mozilla\\Firefox\\Profiles\\$(profile\u dir)\\extensions\”
恩迪夫
恩迪夫
#将在其中复制和生成扩展树的临时位置。
build\u dir:=$(bin\u dir)/build
#这将生成扩展名XPI文件。
冒牌货:全部
全部:$(xpi\U文件)
@回音
@echo“生成已成功完成”
@回音
#这将清除由“make”创建的所有临时文件和目录。
.假冒:干净
清洁:
@rm-rf$(构建目录)
@rm-f$(xpi\U文件)
@echo“清理完成。”
#XPI文件的源代码。
xpi_builded:=install.rdf\
chrome.manifest\
$(通配符内容/*.js)\
$(通配符内容/*.xul)\
$(通配符内容/*.xml)\
$(通配符内容/*.css)\
$(通配符皮肤/*.css)\
$(通配符皮肤/*.png)\
$(通配符区域设置/*/*.dtd)\
$(通配符区域设置/*/*.properties)
#这将构建除实际XPI之外的所有内容,然后将其复制到
#指定的配置文件目录,允许不需要安装的快速更新。
.假冒:安装
安装:$(构建目录)$(xpi构建)
@echo“在配置文件文件夹中安装:$(配置文件位置)”
@cp-Rf../bin/*$(剖面图位置)
@echo“在配置文件文件夹中安装。完成!”
@回音
$(xpi\U文件):$(生成目录)$(xpi\U生成)
@echo“创建XPI文件”
@$(ZIP)$(xpi_文件)$(xpi_构建)
@echo“创建XPI文件。完成!”
$(构建目录)/%:%
@cp-f$<$@
$(构建目录):
@如果[!-x$(构建方向)]\
然后\
mkdir$(构建目录)\
fi
[你的愿望就是我的命令!]
$(bin\u dir)
而不是。/bin
@
不起作用时,不要隐藏它正在执行的操作cp
命令是否是您认为应该执行的命令。如果是,请检查源目录(。/bin
)是否包含所需的文件。您的cp
是否具有-v
(详细)模式?如果是,就用它cp
命令起作用。文件夹中的任何内容都会复制到另一个路径。但是没有xpi文件可以复制,所以它什么都不做。在这条线路的某个地方,它不会创建xpi文件
@
符号(您可以将它们保留在echo
命令中),这样您就可以看到出了什么问题-为什么xpi文件没有按预期构建make-d
从make获取(丰富的)调试输出。您可能需要使用以下内容:
make -d install 2>&1 | tee make.log
所以你捕捉到make在做什么。如果该选项不是-d
,请咨询您的人造
或同等产品(a) 在安装规则中使用
$(bin\u dir)
而不是。/bin
;(b) 当@
不起作用时,不要隐藏它正在执行的操作;(c) 研究正在执行的cp
命令是否是您认为应该执行的命令。如果是,请检查源目录(。/bin
)是否包含所需的文件。您的cp
是否具有-v
(详细)模式?如果是这样,就使用它。这样cp命令就可以工作了。文件夹中的任何内容都会复制到另一个路径。但是没有xpi文件可以复制,所以它什么都不做。由于某种原因,它没有创建xpi文件;从已执行的命令中删除更多的@
符号(您可以将它们保留在echo
命令中),这样您就可以看到出了什么问题-为什么xpi文件没有按预期构建。或者使用make-d
从make
获取(丰富的)调试输出。您可能需要使用类似以下内容:make-d install 2>&1 | tee make.log
以便捕获make
正在执行的操作。如果该选项不是-d
,请咨询您的人工
或同等产品。请写一个答案,以便我可以接受。谢谢我解决了它:)在我的makefile中,我倾向于定义一个变量,比如V:=@
,然后在我的规则中使用$V
,而不是直接使用@
来定义可能感兴趣的规则。然后,当我想看到更详细的内容时,我运行make V=
。还有其他方法。在GNU make的下一个版本中,将有一个新的标志来帮助跟踪构建。