Makefile to combine js files and make a compressed version

后端 未结 1 527
逝去的感伤
逝去的感伤 2020-12-06 06:00

I am trying to write a basic makefile that combines multiple js files into a single one and then does the same but compresses them.

So far I have this one that can m

相关标签:
1条回答
  • 2020-12-06 06:56

    You were almost there :-) This should work:

    spark-dev.js: ${modules}
        cat > $@ $^
    

    Background: The function of cat is to (try to) open all the files listed on its command line, and dump the contents to stdout. The > $@ syntax is understood by the shell to mean "create the file $@, and connect this command's stdout to it", so now we end up with the contents of $^ combined together into $@.

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