In Unix, can I run 'make' in a directory without cd'ing to that directory first?

后端 未结 5 1150
后悔当初
后悔当初 2021-01-29 18:42

In Unix, can I run make in a directory without cd\'ing to that directory first?

5条回答
  •  無奈伤痛
    2021-01-29 19:19

    makefile:

    all:
        gcc -Wall -Wpedantic -std=gnu99 -g src/test.c -o build/test
    
    run:
        ./build/test
    

    or

    run:
        ./../build/test
    

    etc.

提交回复
热议问题