GNU make manual 번역
3394 단어 Make
Each target specified must match the target pattern; a warning is
issued for each target that does not. If you have a list of files,
only some of which will match the pattern, you can use the `filter'
function to remove nonmatching file names (*note Functions for String
Substitution and Analysis: Text Functions.):
files = foo.elc bar.o lose.o
$(filter %.o,$(files)): %.o: %.c
$(CC) -c $(CFLAGS) $< -o $@
$(filter %.elc,$(files)): %.elc: %.el
emacs -f batch-byte-compile $<
In this example the result of `$(filter %.o,$(files))' is `bar.o
lose.o', and the first static pattern rule causes each of these object
files to be updated by compiling the corresponding C source file. The
result of `$(filter %.elc,$(files))' is `foo.elc', so that file is made
from `foo.el'.
Another example shows how to use `$*' in static pattern rules:
bigoutput littleoutput : %output : text.g
generate text.g -$* > $@
When the `generate' command is run, `$*' will expand to the stem,
either `big' or `little'.
모든 지정한 목적은 반드시 목적 패턴과 일치해야 한다.일치하지 않는 목적은 경고를 생성합니다.만약 파일 열이 있다면, 일부분만 일치하는 패턴을 만들 것입니다. 필터 함수를 사용하여 일치하지 않는 파일 이름을 옮길 수 있습니다(*note Functions for String Substitution and Analysis: Text Functions.):
files = foo.elc bar.o lose.o
$(filter %.o,$(files)): %.o: %.c $(CC) -c $(CFLAGS) $< -o $@
$(filter %.elc,$(files)): %.elc: %.el emacs -f batch-byte-compile $<
이 예에서 $(filter%.o, $(files)) 보류된 결과는 bar입니다.o와 lose.o, 첫 번째 정적 모드 규칙은 해당하는 C 원본 파일을 컴파일하여 대상 파일을 생성합니다. $(filter%.elc, $(files)) 보류된 결과는foo입니다.elc, 그래서 이foo.el 파일이 생성됩니다.
다른 예에서는 정적 모드 규칙에 $*를 적용하는 방법을 보여 줍니다.
bigoutput littleoutput : %output : text.g generate text.g -$* > $@
generate 명령이 실행될 때 $*는 지간, 또는 빅 또는 리틀로 전개됩니다.
후문이 계속되다
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
GNU make manual 번역(3)계속 번역 1.1 이 안내서를 읽는 방법 만약 당신이 초보자이거나 일반적인 소개를 찾고 있다면, 먼저 매 장의 앞의 몇 마디를 읽고 뒤의 몇 마디를 뛰어넘을 수 있다.각 장에서 앞 면적의 각 소절은 소개적 또는 일반...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.