[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: help to create automake
From: |
Rudra Banerjee |
Subject: |
Re: help to create automake |
Date: |
Wed, 03 Oct 2012 16:29:59 +0100 |
Yes,
I got some site on non-recursive automake.
But I have one more queries: I have 100+ routine in src/.
Do I need to enter ALL of them manually as automake do not like
wildcards, or we have any shorter way?
On Wed, 2012-10-03 at 09:05 +0200, Alberto Luaces wrote:
> 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.
>