tj / mon

mon(1) - Simple single-process process monitoring program written in C
1.08k stars 94 forks source link

Makefile: improve compatibility with BSD make. #31

Closed tcort closed 10 years ago

tcort commented 10 years ago

The Makefile contained a couple instances of GNU make specific syntax. This caused a build error when using BSD make. This was reported in Issue 29 https://github.com/visionmedia/mon/issues/29

BSD make wasn't setting $^ in the mon target, so the object files weren't being listed in the compile command. This is fixed by replacing $^ with $(OBJ).

BSD make was outputting the object files to the current directory instead of the src and deps directories as expected due to the way the generic .c to .o rules were written. This patch rewrites that rule so that BSD make outputs the object files to the proper sub-directory.

Tested on NetBSD and Linux with GNU make 3.82 and BSD make 20110606.

tj commented 10 years ago

thanks!