You are not logged in.

#1 2004-10-12 22:17:26

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

making Makefiles

hey all,
I have some discussion items here, dealing with linux programming (c/c++).  when it comes to small projects, i usually compile the source by hand... pkg-config and whatnot....

now, I'd like to do a few larger things, and I was wondering: what do you use  for your Makefiles?  autotools is overly complex and I can never remember all the AC_* and AM_* m4 macros... autoscan doesn't help.  writing Makefiles by hand may be ok, but if you have a large number of sources and libraries and things, it may become hard to maintain.  there are other options out there (iCompile looks decent) to generate makefiles too.

I am wondering how you all do it.   I'd like to be able to distribute things with one file to build it... be it a Makefile, a script, or whatever.

Thanks in advance

Offline

#2 2004-10-13 00:27:27

kill
Member
Registered: 2004-09-30
Posts: 126

Re: making Makefiles

I use hand made makefiles.  Its tedious but it works well and I know it works exactly how I want it to.  Usually I keep a few as templates around and pick one depending on the complexity of the task.  If you'd like me to post them just ask.

Offline

#3 2004-10-13 00:43:30

punkrockguy318
Member
From: New Jersey
Registered: 2004-02-15
Posts: 707
Website

Re: making Makefiles

Scons is a VERY useful utility for replacing make... google for it.. it's easy, you just make a little SConstruct file and that's it!  You don't NEED to know python to use it, but it sure does help.. it's written python (a real language) instead of bash


If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but have not love, I am nothing.   1 Corinthians 13:2

Offline

#4 2004-10-13 00:52:44

dp
Member
From: Zürich, Switzerland
Registered: 2003-05-27
Posts: 3,366
Website

Re: making Makefiles

i write my makefiles by hand (c++ and java) but my biggest project has 17 source files, so it is not big trouble for such a small thingy

an idea is to write some small perl (or python or soemtihng else if you prefer) script that creates you a makefile


The impossible missions are the only ones which succeed.

Offline

#5 2004-10-13 02:32:50

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: making Makefiles

Makefiles are so old school. :-P

I use ant for Java. I don't know how good it would be for C programs though. There's got to be better project management than those bloody makefiles though.

Dusty

Offline

#6 2004-10-13 03:15:13

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: making Makefiles

Dusty wrote:

Makefiles are so old school. :-P

I use ant for Java. I don't know how good it would be for C programs though. There's got to be better project management than those bloody makefiles though

I definatly agree.  However, make is part of almost all standard development environments under linux... and there's a version on windows and mac too.

And I know I hate it when I come across something (like the boost libs) which use some funky build system (boost uses jam which is .... not good).

Ideally, I'd like a python or perl script which will work with minimal setup... I don't need to detect if stdc headers exist, because if they don't you have bigger problems... libtool, install... these don't need replacement scripts... modern package management fixes this.  this script could be distributed with the source itslef, simplifying the build process....

Offline

#7 2004-10-13 03:38:42

dp
Member
From: Zürich, Switzerland
Registered: 2003-05-27
Posts: 3,366
Website

Re: making Makefiles

Dusty wrote:

Makefiles are so old school. :-P

I use ant for Java. I don't know how good it would be for C programs though. There's got to be better project management than those bloody makefiles though.

Dusty

makefiles are native in a shell and therefore very easily written

i see your point with java and the new bright future 8)

what do you think of maven?

( http://maven.apache.org/ )


The impossible missions are the only ones which succeed.

Offline

#8 2004-10-13 03:41:07

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: making Makefiles

punkrockguy318 wrote:

Scons is a VERY useful utility for replacing make... google for it.. it's easy, you just make a little SConstruct file and that's it!  You don't NEED to know python to use it, but it sure does help.. it's written python (a real language) instead of bash

Holy crap this may be exactly what I need... scons is really cool, and scons-local is even better - a stand alone script for distribution with the source...

looking into it now... we'll see

Offline

#9 2004-10-13 03:41:44

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: making Makefiles

Doom3 uses SCons... hah

Offline

#10 2004-10-13 04:44:04

dp
Member
From: Zürich, Switzerland
Registered: 2003-05-27
Posts: 3,366
Website

Re: making Makefiles

i'm moving scons from staging to extra - indeed: VERY USEFULL!!


The impossible missions are the only ones which succeed.

Offline

#11 2004-10-13 10:47:53

punkrockguy318
Member
From: New Jersey
Registered: 2004-02-15
Posts: 707
Website

Re: making Makefiles

big_smile Yay, people listened to me  lol


If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but have not love, I am nothing.   1 Corinthians 13:2

Offline

#12 2004-10-13 13:44:14

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: making Makefiles

ah, scons is in extra? ok ill remove my package from my repo - just a question, where does the scons python lib install to?
I noticed that it can install to multiple places, so i installed mine to /usr/lib/SCons
if this is the correct placement (the version dependent one seemed like a hack... I also updated my bittornado package to install the lib to /usr/lib/BitTornado

Offline

#13 2004-10-13 14:23:04

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: making Makefiles

hey punkrockguy, can you post a SConstruct example you have? I'd like to review some of it, but it seems easy enough...

this is a real good project (used by Blender and Doom3) - I'm going to make a real push to use this... i think it's the greatest thing since sliced bread... thanks

Offline

#14 2004-10-13 15:34:43

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: making Makefiles

dp wrote:

what do you think of maven?

( http://maven.apache.org/ )

I only just heard of it when I was investigating using Groovy for Ensmer. I haven't really researched it; I didn't realize it was an Apache project; is it meant to replace ant eventually, or are they different projects with different goals?

Edit: I see it works *with* ant... collects ant builds together in one spot?

Dusty

Offline

#15 2004-10-13 19:06:46

punkrockguy318
Member
From: New Jersey
Registered: 2004-02-15
Posts: 707
Website

Re: making Makefiles

phrakture wrote:

hey punkrockguy, can you post a SConstruct example you have? I'd like to review some of it, but it seems easy enough...

this is a real good project (used by Blender and Doom3) - I'm going to make a real push to use this... i think it's the greatest thing since sliced bread... thanks

I've only used SCons on one project... Which I lost the code for.. It was an RPG engine.. I have a windows version code left, but my linux port craashed when i nuked my arch by accident.  But the SConstruct was REALLY easy... This is what it looked like:

Program('wetfirerpg', 'main.cpp' 'main.h' 'saveload.cpp' 'saveload.h' 'foo.h' foo.cpp') # and a bunch of other files, etc...

This program didn't have any dependencies and I never wrote the install function.. But it's only like one line I believe... I love SCons...


If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but have not love, I am nothing.   1 Corinthians 13:2

Offline

Board footer

Powered by FluxBB