pretty print makefiles

前端 未结 2 707
小鲜肉
小鲜肉 2021-01-31 19:32

The linux kernel (and various other projects including git) have very nice makefiles that hide the giant cc calls into nice little acronyms.

For example:



        
相关标签:
2条回答
  • 2021-01-31 20:06

    You can prepend @ to calls in the makefile targets.

    E.g.:

    %.o: %.c
        @$(CC) $(CFLAGS) -c -o $@ $<
        @echo "CC $<"
    
    0 讨论(0)
  • 2021-01-31 20:19

    For a much more complicated makefile, you could use a Python script to capture the output in realtime and process it however you like, and then print them in realtime: example.

    0 讨论(0)
提交回复
热议问题