automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help to create automake


From: Alberto Luaces
Subject: Re: help to create automake
Date: Wed, 03 Oct 2012 09:05:43 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

Rudra Banerjee writes:

> Dear Friends,
> My Project has a structure
>                   MAIN DIR
>           __________|__________
>          |                     |
>         src/         main.c (and other .h file)
>
> Inside the src/ there are 100+ file, which will be linked to main.c to
> create the executable. So, there will be *NO* executable in src.
>
> For this goal, my manually created Makefile is:
>
> exe=ptbl
> CC=gcc
> CFLAGS =-O3
> SUBDIR=files
> PCONF1=pkg-config --cflags --libs gtk+-2.0
> sources := $(wildcard $(SUBDIR)/*.c)
> objects := $(sources:.c=.o)
> $(exe): $(objects) help.c  table.c  callbk_list.h  cwlst.h
>       $(CC) `$(PCONF1)` $(objects) help.c  table.c -o $(exe)
>
> $(SUBDIR)/%.o: $(SUBDIR)/%.c
>       $(CC) -c `$(PCONF1)` $<
>       mv $(*F).o $(SUBDIR)/$(*D)
>
> clean:
>       rm -vf $(SUBDIR)/*.o $(exe)
>
> I would like to achive the same goal using autotools.
> I googled, but all seems to assume there is a executable in each
> directory, like each, for me, src/Makefile.am *MUST* have a bin_PROGRAM,
> which is *NOT* what I am looking for.
> Can you kindly help me?

You don't have to create a Makefile.am file in the src/ directory.  Just
create it in the main dir, and declare all the src/*.c files and main.c
as the sources of your executable.

-- 
Alberto




reply via email to

[Prev in Thread] Current Thread [Next in Thread]