make file for Java/Linux

后端 未结 3 2030
日久生厌
日久生厌 2020-12-22 11:56

I have the following makefile after running it once I make some changes to the makefile and now when I run it I get a \"make: Nothing to be done for `default\'.\" How can I

相关标签:
3条回答
  • 2020-12-22 12:30

    The problem is that this:

    .java.class:
        $(JC) $(JFLAGS) $*.java
    

    doesn't do what you think it does. Perhaps you meant something like this?

    %.class: %.java
        $(JC) $(JFLAGS) $^
    
    0 讨论(0)
  • 2020-12-22 12:39

    Make sure there is no file or directory called classes. Make could then assume nothing more to do.

    0 讨论(0)
  • 2020-12-22 12:42

    I did not read your Makefile carefully and I do not consider myself a make expert but

    1. there does not seem to be any dependency on the Makefile itself
    2. all you changed is the Makefile

    leads me to think that the correct behavior is exactly what you described. Perhaps you can add a dependency to the Makefile.

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