Hacker News new | past | comments | ask | show | jobs | submit login

In general I agree with the idea here. That said, it's worth reviewing https://www.gnu.org/prep/standards/html_node/Standard-Target... ... are there other sources of semi-standard targets too?

Some of those are specific to the historical way C projects work, and others I disagree with, but a lot are still useful and weren't mentioned in this link:

    build family:
        all - build everything, but don't run it (this is an important thing). GNU says this should be the default, but sometimes I have `make default` only compile the main program, whereas `make all` additionally compiles some maintainer-only helper programs and such (which might take longer).
        all-$FOO - for example, all-objects verifies that everything compiles without running the expensive linking step
        gen - build just generated files. Might have subtargets for non-distributed, distributed-but-not-committed, and committed files.
        docs - GNU names specific formats, but info is largely ignored by everyone else. Generating `man` pages may depend on building the program first (but beware cross builds ... should that mean such docs are committed!); other forms of documentation are generally unrelated to the main build but may rely on other tools (which must be built or even installed separately - beware versions generating different output!).
        dist - build a source tarball; note that this often includes generated files not committed to the repo. Generally we defer binary tarballs to the package manager these days, but historically a lot of C makefiles *not* from the GNU project also built those under some name.
    clean family:
        (each of these depends on the previous)
        mostlyclean - delete all but a few slow-to-build core libraries. This is probably mostly an artifact of poor dependency tracking, but not altogether useless in some form
        clean - delete all normally-built files. This concept remains useful because we don't like junk lying around. Compared to `distclean` this does not delete configuration; like distclean it isn't supposed to delete generated files if they are distributed.
        distclean - revert everything to exactly the state of the source distribution tarball (which, again, includes some generated files). People have kind of given up on this as a stated goal in favor of from-scratch builds but that doesn't mean the concept is useless.
        maintainer-clean - delete all generated files, even ones that were in the dist tarball. Many non-GNU projects don't distribute generated files (since nowadays we assume it is reasonable to have bison etc. installed), and thus don't distinguish between distclean and maintainer-clean.
        (using `git clean` is useful for the end user but is dangerous in scripts)
    introspection family:
        help - give a basic overview of what build targets are available
        list-$FOO - for things like "list what programs and libraries will be built", "list what tests are available" etc.
Now, certainly some of these could be merged into fewer entry points, but keep in mind the verbosity.



Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: