Live data from Hacker News

The Makefile I use with JavaScript projects

olioapps.com

141–150 of 525 posts

Re: The Makefile I use with JavaScript projects

#141
post #26

Anyone here uses makefiles for anything other than compilation and build? One can use it to add some level of concurrency to shell scripts.

At one point I had a makefile to build large latex documents. The use case was still essentially compilation, but it got me thinking outside the box with make which was neat.

Re: The Makefile I use with JavaScript projects

#142

Earlier quoted context omitted.

Until a stray space finds its way into your command list indentation...

Every popular text editor handles this already. People manage make, python and other whitespace-specified languages just fine.

They don't though. Vanilla Vim/Vi doesn't for instance.

Regardless of whether the editor can or not, I just don't see how insisting on tab and not space is remotely defensible.

Re: The Makefile I use with JavaScript projects

#143
post #135
post #126

Earlier quoted context omitted.

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.

That doesn't work for me. Tried with empty Makefile, no Makefile, with make (PMake) and gmake (GNU Make).

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 
  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

#147
post #64

Earlier quoted context omitted.

Make is such a horrifically awful thing to work with that I just end up using a regular scripting language for building. Why learn another language with all its eccentricities and footguns when I already know several others?

This is why I like redo; it handles all of the dependency stuff for you, but your build scripts are written in pure sh

What's your solution for mutliple-output processes like yacc/bison (which creates both an .h and a .c file?)

Re: The Makefile I use with JavaScript projects

#148
post #126
post #111

Earlier quoted context omitted.

> It actually doesn't know anything at all about how to build C, C++, or any other kind of code. I guess it depends on how you define "know", but there are implicit rules. $ cat foo.c #include int main() { printf("Hello\n"); return 0; } $ cat Makefile foo: foo.c $ make cc -O2 -pipe foo.c -o foo $ ./foo Hello

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.

Yeah

   make foo.c

Should just work. No makefile needed.

Re: The Makefile I use with JavaScript projects

#149
post #64

Earlier quoted context omitted.

Make is such a horrifically awful thing to work with that I just end up using a regular scripting language for building. Why learn another language with all its eccentricities and footguns when I already know several others?

This is why I like redo; it handles all of the dependency stuff for you, but your build scripts are written in pure sh

I have been meaning to spend some time with redo!

https://cr.yp.to/redo.html

Re: The Makefile I use with JavaScript projects

#150
post #19

CMake is so nice compared to vanilla makefiles. I wonder if it can be used this way with Javascript.

Make may seem crude these days but has manageable complexity, I've never run across a build issue I could not debug. Its model is so simple, I can have it fully in my mind and be confident this is how it works. Moreover, this model simplicity allows me to build reliable systems on top of it. CMake is a nightmare of implied complexity. I've run into multiple situations (usually but not always involving cross-compilati…

I do embedded work. I agree CMake is horrible when cross-compiling and runs into trouble. The errors make no sense. It took me days to get OSG cross-compiling. It was a horrible experience.

I'd much rather a Makefile where I can override the compiler and flags for my configuration. I can easily figure out what I need to do based on compiler and linker errors for missing headers and libraries.

Post reply on HN