Re:The Makefile I use with JavaScript projects
by dima55 on Wednesday February 28, 2018 @12:47PM
(#16484952)
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.
[ Parent
| on HN ]
Re:The Makefile I use with JavaScript projects
by LukeShu on Wednesday February 28, 2018 @02:21PM
(#16485872)
Not quite: it does declare "foo" as the default target. Without the Makefile, it would be necessary to type `make foo` instead of just `make`.
Re:The Makefile I use with JavaScript projects
by nickez on Wednesday February 28, 2018 @01:37PM
(#16485435)
The built in rule to copy 'build.sh' to 'build' and make it executable is also interesting.. confused the hell out of me
Re:The Makefile I use with JavaScript projects
by sebcat on Wednesday February 28, 2018 @12:52PM
(#16485001)
That doesn't work for me. Tried with empty Makefile, no Makefile, with make (PMake) and gmake (GNU Make).
Re:The Makefile I use with JavaScript projects
by dima55 on Wednesday February 28, 2018 @12:57PM
(#16485043)
Don'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.
Re:The Makefile I use with JavaScript projects
by therein on Wednesday February 28, 2018 @01:11PM
(#16485179)
I had fun learning about that.
Re:The Makefile I use with JavaScript projects
by mhei on Wednesday February 28, 2018 @12:56PM
(#16485030)
Try "make foo" instead of "make"
Re:The Makefile I use with JavaScript projects
by sebcat on Wednesday February 28, 2018 @12:59PM
(#16485066)
Ah, that works!
Re:The Makefile I use with JavaScript projects
by klmr on Wednesday February 28, 2018 @01:14PM
(#16485211)
Then you did something wrong — it definitely works with GNU make (can’t speak for PMake):
Re:The Makefile I use with JavaScript projects
by oso2k on Wednesday February 28, 2018 @01:04PM
(#16485107)
Yeah
make foo.c
Should just work. No makefile needed.