mbcrawfo / GenericMakefile

A generic makefile for use with small/medium C and C++ projects.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mac OS build/link times are not displayed correctly.

moshohayeb opened this issue · comments

clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
Compile time: usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]

Linking: bin/release/xxx
Link time: usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]

Making symlink: xxx -> bin/release/xxx
Total build time: usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]

Unfortunately I don't have a Mac available to test with. If a fix is possible that will work with both the Mac and Linux versions of date, anyone is welcome to submit a pull request with the fix. If the fix is going to require some changes that are Mac-specific, I'd encourage a Mac user to make a Mac-specific fork.

I was able to do some testing with a friend's Mac. It doesn't look like the OSX version of date supports getting the number of seconds since epoch, or converting seconds to another time format. I was able to find a solution using awk to get the elapsed seconds, but not a way to format it to HH:MM:SS. You can find a patch here: http://pastebin.com/vDSX8zXB

Works fine, thanks :)

Why not just use the time command?