Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #15641

Re: Building a sample application with libraries located in nonstandard directory

From Markus Wichmann <nullplan@gmx.net>
Newsgroups comp.lang.c
Subject Re: Building a sample application with libraries located in nonstandard directory
Date 2012-01-09 15:00 +0100
Organization Aioe.org NNTP Server
Message-ID <tg8rt8-u1j.ln1@voyager.wichi.de.vu> (permalink)
References <33269556.1062.1325935591686.JavaMail.geo-discussion-forums@prak33> <20120107093130.782@kylheku.com> <14529213.1578.1326103925594.JavaMail.geo-discussion-forums@prmw6>

Show all headers | View raw


On 09.01.2012 11:12, ArifulHossain tuhin wrote:
> So you are suggesting avoiding configure scripts if i'm building a large project?
> 
> What are the alternatives? Do you think hand made "makefiles" are more efficient way to approach?

What do you need? Stuff like "compile all C files together into one big
executable" goes like this:

SRC:=$(wildcard *.c)
OBJ:=$(SRC:.c=.o)

executable: $(OBJ)
	cc -o $@ $^

%.o: %.c
	cc -c -o $@ $<


What's not to like? You may even append the output of "gcc -MM *.c" to
that for more accuracy (which is usually only of interest during
development)

If you need subdirectories, you prepend:

VPATH=subdir1:subdir2

You will also probably need to have a config.h. I'd hand-craft a script
to create it. That should be faster than autotools (because I don't
check for fortran compilers).

Also, you should avoid version tests, because at best they work for a
relatively short period of time. Rather, you should check for the wanted
features. Yes, that takes more time than a version check, but is more
secure.

I have yet to see a project make couldn't handle alone.

Ciao,
Markus

Back to comp.lang.c | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Building a sample application with libraries located in nonstandard directory ArifulHossain tuhin <etothepowerpi@gmail.com> - 2012-01-07 03:26 -0800
  Re: Building a sample application with libraries located in nonstandard directory ec429 <ec429@cam.ac.uk> - 2012-01-07 14:15 +0000
    Re: Building a sample application with libraries located in nonstandard directory gazelle@shell.xmission.com (Kenny McCormack) - 2012-01-07 16:26 +0000
    Re: Building a sample application with libraries located in nonstandard directory jt@toerring.de (Jens Thoms Toerring) - 2012-01-07 17:40 +0000
  Re: Building a sample application with libraries located in nonstandard directory Kaz Kylheku <kaz@kylheku.com> - 2012-01-07 17:50 +0000
    Re: Building a sample application with libraries located in nonstandard directory Seebs <usenet-nospam@seebs.net> - 2012-01-07 21:24 +0000
      [OT] Bashing on autotools (Was: Building a sample application with libraries located in nonstandard directory) ec429 <ec429@cam.ac.uk> - 2012-01-08 05:19 +0000
        Re: [OT] Bashing on autotools (Was: Building a sample application with libraries located in nonstandard directory) Dr Nick <3-nospam@temporary-address.org.uk> - 2012-01-08 09:15 +0000
          Re: [OT] Bashing on autotools Markus Wichmann <nullplan@gmx.net> - 2012-01-08 23:09 +0100
            Re: [OT] Bashing on autotools Dr Nick <3-nospam@temporary-address.org.uk> - 2012-01-09 07:53 +0000
            Re: [OT] Bashing on autotools Seebs <usenet-nospam@seebs.net> - 2012-01-09 19:21 +0000
    Re: Building a sample application with libraries located in nonstandard directory falk@rahul.net (Edward A. Falk) - 2012-01-08 07:13 +0000
    Re: Building a sample application with libraries located in nonstandard directory ArifulHossain tuhin <etothepowerpi@gmail.com> - 2012-01-09 02:12 -0800
      Re: Building a sample application with libraries located in nonstandard directory Markus Wichmann <nullplan@gmx.net> - 2012-01-09 15:00 +0100

csiph-web