6 ms·
>Wouldn’t it better if we could just type make, and get a list of available commands, together with their desciption? No, Jesus Christ, please don't. Preserve
by yxlx 11y ago
>Wouldn’t it better if we could just type make, and get a list of available commands, together with their desciption?
No, Jesus Christ, please don't. Preserve default action as being to build.
Good user interface and good user experience relies on meeting expectations. This behavior breaks those expectations. What if your expectations are different, you ask? In environments where there is an established tradition I think it is rude to break with the norm unless there is a compelling reason to do so. The commandline is popular among developers, other IT professionals and power users because of how efficient it is. It is efficient because there is not all the noise, handholding and other bullsh*t. Please let us keep it that way.
Use a specific target to list other targets. I've seen some people use "make targets".
- andrewpe 11y agoI agree, don't break the normal expectations, but they could've done much much worst.
- gtramont 11y agoThis is basically how I've been doing for quite some time now. `make ?` Check it out here: https://github.com/gtramontina/sourcing/blob/master/Makefile#L68-L72 https://github.com/gtramontina/sourcing/blob/master/Makefile...
- jjnoakes 11y agoIf your users set failglob in their shells, they will have to type the less convenient "make '?'" or "make \?". And regardless of whether they do or don't, if they are in a directory with a single character file name, they will have to escape it too...
- gtramont 11y agoI usually escape regardless... But you made a good point about the single character directory. The target name can be anything that makes sense, anyway... `make help` as suggested previously.
- solipsism 11y agoBah. What's the harm here? It's not like you'll type make and then not be able to figure out what to do next. The problem you're trying to avoid when preserving default behavior is confusing the user, and that's not applicable here. Instead of blindly following laws like "Always meet user expectations" we should think about things in a case-by-case basis. Your law is at best a rule of thumb.
- viraptor 11y agoOne reason to leave it: It saves some writing / debugging for people doing system packaging. In debian the package build file (debian/rules) is reduced to two lines these days - as long as you don't mess with the standards. "configure && make && make install" is standard - if you go outside of that, someone will have to do extra work.
- wfunction 11y agoOne thing I don't quite know yet: how does 'make install' interact with package managers? Does it bypass them?
- viraptor 11y agoDepends on what you mean by "interact". When you run it yourself, package managers don't matter. You're not interacting with them in any way (assuming it's a standard autotools/cmake/qmake/...-generated Makefile). If you mean during packaging, then usually the code is configured with the actual destination path (configure --prefix=/usr), but then installed into a directory which will be packaged by overriding destination (make install DESTDIR=/tmp/some/path)
- cyphar 11y agoIf you're talking about your local machine, it almost always does (and they rarely include `make uninstall` which is really annoying). As for creating packages, the way OBS (and I assume other packaging systems) work is that you `make install` into a temporary directory then figure out where things were installed and package those files.
- ajdlinux 11y ago"make help", as the Linux kernel does.
- terminalcommand 11y agoYou could always alias make to the default you like. But if the newbie can't "make" it work, he/she gets frustrated. I really wish dd had this type of caution. It would save me a lot of misery, preventing the loss of numerous drives.
- marklgr 11y agoNot sure it's a good habit for newbies to run arbitrary commands to see what they do. Asking for help somewhere (eg. `--help` flag) looks like a much better practice
- Someone 11y ago"You could always alias make to the default you like" That breaks down when you work with multiple projects. For example, try writing a script that downloads and builds a couple of projects. You would have to parse each makefile and hope you can discover the right target to build.
- lisivka 11y ago"all" is the default target to build in GNU autotools projects. make all && sudo make install "all" is also recommended default target in GNU make documentation: Phony targets can have prerequisites. When one directory contains multiple programs, it is most convenient to describe all of the programs in one makefile ./Makefile. Since the target remade by default will be the first one in the makefile, it is common to make this a phony target named ‘all’ and give it, as prerequisites, all the individual programs.
- mfukar 11y agoThen don't set the default target and keep using it as `make help`.
- gbog 11y agoOr better, change the completion to should the description there when typing "make <tab>"