IT

대상이 최신이라고 생각하는 이유는 무엇입니까?

lottoking 2020. 5. 13. 08:32
반응형

대상이 최신이라고 생각하는 이유는 무엇입니까?


이것은 내 Makefile입니다.

REBAR=./rebar
REBAR_COMPILE=$(REBAR) get-deps compile

all: compile

compile:
    $(REBAR_COMPILE)

test:
    $(REBAR_COMPILE) skip_deps=true eunit

clean:
    -rm -rf deps ebin priv doc/*

docs:
    $(REBAR_COMPILE) doc

ifeq ($(wildcard dialyzer/sqlite3.plt),)
static:
    $(REBAR_COMPILE) build_plt analyze
else
static:
    $(REBAR_COMPILE) analyze
endif

make compile여러 번 달릴 수 있고

aromanov@alexey-desktop:~/workspace/gm-controller/lib/erlang-sqlite$ make compile
./rebar get-deps compile
==> erlang-sqlite (get-deps)
==> erlang-sqlite (compile)

그러나 어떤 이유로 든 달리기는 make test항상

aromanov@alexey-desktop:~/workspace/gm-controller/lib/erlang-sqlite$ make test
make: `test' is up to date.

파일이 컴파일되지 않은 경우에도 마찬가지입니다. 문제는 왜?

동일한 명령을 직접 실행하면 다음과 같이 작동합니다.

aromanov@alexey-desktop:~/workspace/gm-controller/lib/erlang-sqlite$ ./rebar get-deps compile skip_deps=true eunit
==> erlang-sqlite (get-deps)
==> erlang-sqlite (compile)
Compiled src/sqlite3_lib.erl
Compiled src/sqlite3.erl
==> erlang-sqlite (eunit)
...

디렉토리에 이름이 지정된 파일 / 디렉토리가있을 수 있습니다 test. 이 디렉토리가 존재하고 최신 종속성이없는 경우이 대상은 재 구축되지 않습니다.

이러한 종류의 파일과 관련되지 않은 대상을 강제로 다시 빌드하려면 다음과 같이 가짜로 만들어야합니다.

.PHONY: all test clean

모든 가짜 대상을 선언 할 수 있습니다.


편집 : 이것은 일부 버전에만 적용됩니다 make-맨 페이지를 확인해야합니다.

-B플래그를에 전달할 수도 있습니다 make. 매뉴얼 페이지에 따르면 다음과 같습니다.

-B, --always-make 무조건 모든 대상을 만드십시오.

So make -B test would solve your problem if you were in a situation where you don't want to edit the Makefile or change the name of your test folder.


my mistake was making the target name "filename.c:" instead of just "filename:"

참고URL : https://stackoverflow.com/questions/3931741/why-does-make-think-the-target-is-up-to-date

반응형