5 ms·
Fun fact: your Makefile above is redundant. You can delete it entirely, and the implicit rules you're using here continue to work just fine.
by dima55 9y ago
Fun fact: your Makefile above is redundant. You can delete it entirely, and the implicit rules you're using here continue to work just fine.
- sebcat 9y agoThat doesn't work for me. Tried with empty Makefile, no Makefile, with make (PMake) and gmake (GNU Make).
- mhei 9y agoTry "make foo" instead of "make"
- sebcat 9y agoAh, that works!
- dima55 9y agoDon't know why that would be. I'm using GNU Make 4.1, but this has worked for years and years as far as I knew. Not a particularly useful feature, so I it doesn't really matter, but you messed up my fun fact. dima@fatty:/tmp$ mkdir dir dima@fatty:/tmp$ cd dir dima@fatty:/tmp/dir$ touch foo.c dima@fatty:/tmp/dir$ make -n foo cc foo.c -o foo dima@fatty:/tmp/dir$ make --version GNU Make 4.1 Built for x86_64-pc-linux-gnu Copyright (C) 1988-2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
- therein 9y agoI had fun learning about that.
- klmr 9y agoThen you did something wrong — it definitely works with GNU make (can’t speak for PMake): https://asciinema.org/a/zVu7sYyh7lQZTNAgAsbKUmocr https://asciinema.org/a/zVu7sYyh7lQZTNAgAsbKUmocr
- oso2k 9y agoYeah make foo.c Should just work. No makefile needed.
- nickez 9y agoThe built in rule to copy 'build.sh' to 'build' and make it executable is also interesting.. confused the hell out of me
- LukeShu 9y agoNot quite: it does declare "foo" as the default target. Without the Makefile, it would be necessary to type `make foo` instead of just `make`.