开发者

How can I make a general makefile that selects all files with a specific extension

开发者 https://www.devze.com 2023-01-23 12:04 出处:网络
How does a makefile look like that makes a target for every extension? My current makefile: S开发者_StackOverflow中文版OURCES=*.gnuplot

How does a makefile look like that makes a target for every extension?

My current makefile:

S开发者_StackOverflow中文版OURCES=*.gnuplot   
TARGETS=$(SOURCES:.gnuplot=.pdf)

all: $(TARGETS)

%.pdf: %.gnuplot
        cp $< $@

The problem is that there is only 1 target: *.pdf and not test.pdf as I wanted.

How can I let this make file make a pdf file for every gnuplot file?


SOURCES = $(wildcard *.gnuplot)
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号