gpt4 book ai didi

makefile - 如何复制文件并保留 gnu makefile 中的结构?

转载 作者:行者123 更新时间:2023-12-05 07:59:06 29 4
gpt4 key购买 nike

例如,给定当前目录中的文件列表,如何将文件复制到另一个目录。

dest_dir := /usr/bin/test

.PHONY: install
install: $(dest_dir)

#there files are in current directory
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)

#how to copy there files to another directory
$(dest_dir)/% : $(xpi_built)
@mkdir -p $(dest_dir)
@cp $< $@

如何将文件列表复制到目标目录?

最佳答案

.PHONY: copy_files

copy_files: $(xpi_built)
@mkdir -p $(dest_dir)
@cp $^ $(dest_dir)

关于makefile - 如何复制文件并保留 gnu makefile 中的结构?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22907639/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com