Makefile rule to build with same name, but different directory

前端 未结 1 1355
北荒
北荒 2021-01-07 00:10

I would like a rule something like:

build/%.ext: src/%.ext
    action

I have one directory of files in a folder that I want to optimize and

1条回答
  •  臣服心动
    2021-01-07 00:45

    Try somethink like this:

    INPUT_FILES = \
      src/a.txt   \
      src/b.txt   \
    
    OPTIMIZED_FILES=$(patsubst src/%.ext,build/%.ext,$(INPUT_FILES))
    
    $(OPTIMIZED_FILES): build/%.ext: src/%.txt
         optimize_command $@ $<
    

    0 讨论(0)
提交回复
热议问题