Disable make builtin rules and variables from inside the make file

后端 未结 7 724
隐瞒了意图╮
隐瞒了意图╮ 2020-12-04 17:40

I want to disable builtin rules and variables as per passing the -r and -R options to GNU make, from inside the make file. Other solutions that allow me to do this implicitl

7条回答
  •  一个人的身影
    2020-12-04 18:00

    https://www.gnu.org/software/make/manual/make.html#Canceling-Rules

    # Disable built-in rules and variables
    MAKEFLAGS += --no-builtin-rules
    MAKEFLAGS += --no-builtin-variables
    
    # Makefile begins
    main: main.c
        cc main.c -o main
    

提交回复
热议问题