How can I make a target “private” in GNU make for internal use only? OR: how to best enforce target-specific variable-values?

后端 未结 5 1905
别那么骄傲
别那么骄傲 2021-02-19 13:14

I have some ancillary targets in a makefile that I want to restrict for internal or \"private\" use (only) inside the makefile. That is, I want to be able to specify these targ

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-19 13:53

    Thinking about this and tried the following:

    TEST := $(shell echo $$RANDOM)
    
    test : $(TEST)
    
    $(TEST):
    @echo tada $(TEST)
    

    then doing a make test on command line seems to work and I think it would be difficult to get the result without using the test target. Maybe this path can help?

提交回复
热议问题