[ale] [OT] Learning C

Michael Potter michael at potter.name
Tue Dec 15 16:40:28 EST 2015


I have given up on make for any new project.
scons is the way to go for C based projects.

Here is why:
1) the rule file is just python.  So you have a rich well documented syntax
to follow.
2) scons knows about .h and .c file relationships by scanning code.  You
don't have to code the relationships yourself.
3) it supports "out of source" builds.
4) it uses checksums rather than timestamps to determine that a file
changed.
5) it knows when rules change and will recompile because a rule changed.
6) you can write customer builders in python.

The downside is that it is harder to learn than make.

On Mon, Dec 14, 2015 at 2:30 PM, DjPfulio <DjPfulio at jdpfu.com> wrote:

> Yep, the first thing I did was bring over an old, simple, makefile for an
> old C project.
>
> The second thing I did was a youtube search for introduction to makefiles.
> Watched three of them and was disappointed. They didn't cover the simplest
> stuff.
>
> It is generally impossible to count on the built-in rules of a make
> program because it doesn't have include directories or libraries, and most
> production code will include both of those for any specific project.
>
> On 14 December 2015 12:53:03 GMT-05:00, "Scott M. Jones" <
> eff at dragoncon.org> wrote:
>>
>> I was surprised to find he is using the built-in rules of make rather
>> than running cc directly on the command line.  In production code I made
>> a personal rule to never depend on built in rules of make and to put all
>> rules explicitly in the makefile, but for educational purposes it's
>> probably OK.  Still, if he's teaching the command line way I'm surprised
>> he isn't using cc directly from the command line.  I've also seen
>> systems with cc/gcc installed but no make installed.
>>
>> -Scott
>>
>> On 12/14/15 10:54 AM, DJ-Pfulio wrote:
>>
>>>
>>>  If anyone has already started their journey to learning C with Leam, great!
>>>
>>>  I worked through the first 8 exercises this morning using the online book -
>>>  http://c.learncodethehardway.org/book/
>>>
>>>  There are many subtle things not covered, but worth knowing.
>>>
>>>  He writes about makefiles, valgrind and printf() in a "do this, but don't worry
>>>  if you don't understand it" way. Perhaps the author will come back later for
>>>  deeper explanation? I dunno.
>>>
>>
>> ------------------------------
>>
>> Ale mailing list
>> Ale at ale.org
>> http://mail.ale.org/mailman/listinfo/ale
>> See JOBS, ANNOUNCE and SCHOOLS lists at
>> http://mail.ale.org/mailman/listinfo
>>
>>
> --
> Sent from my Android device with K-9 Mail. Please excuse my brevity.
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>
>


-- 
Michael Potter
  Tapp Solutions, LLC
   www.tappsolutions.com
+1 770 815 6142  ** Atlanta ** michael at potter.name  **
www.linkedin.com/in/michaelpotter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20151215/a2e532dc/attachment.html>


More information about the Ale mailing list