473,385 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to use automake to generate a Makefile

I am using an open source library called IGI_UDP for measure the available bandwidth of a link (http://www.cs.cmu.edu/%7Ehnn/igi/ ).
with that library they have provided a "Makefile" which is not an auto generated one.

the following is the given Makefile,

************************************************** ***************
CC = gcc
INCS = -I.
CFLAGS = -g -Wall $(DEFS) $(INCS)

# for linux
DEFS = -DLINUX -DRETSIGTYPE=void -DHAVE_SIGACTION=1
LIBS = -lpthread


CLIOBJS = nbs_setsignal.o nbs_client.o nbs_client_test.o
SRVOBJS = nbs_setsignal.o nbs_server.o

.c.o:
@rm -f $@
$(CC) $(CFLAGS) -c $*.c

all: igi_server igi_client

igi_client: $(CLIOBJS)
@rm -f $@
$(CC) $(CFLAGS) -o $@ $(CLIOBJS) $(LIBS)

igi_server: $(SRVOBJS)
@rm -f $@
$(CC) $(CFLAGS) -o $@ $(SRVOBJS) $(LIBS)

clean:
rm -f *.o igi_client igi_server
************************************************** ***************


But now I want to generate this Makefile through the automake tool (for using with my application)
So that I created the following Makefile.am file


************************************************** ***************
CC = gcc
INCS = -I.


# for linux
DEFS = -DLINUX -DRETSIGTYPE=void -DHAVE_SIGACTION=1
LIBS = -lpthread


bin_PROGRAMS = igi_server igi_client


igi_server_SOURCES = nbs_server.c nbs_setsignal.c
igi_server_LDADD = $(LIBS)
igi_server_CFLAGS = -g -Wall $(DEFS) $(INCS)


igi_client_SOURCES = nbs_setsignal.c nbs_client.c nbs_client_test.c
igi_client_LDADD = $(LIBS)
igi_client_CFLAGS = -g -Wall $(DEFS) $(INCS)
************************************************** ***************

the configure.in file is as follow.
************************************************** ***************
AC_INIT(igi_server.c)
AM_INIT_AUTOMAKE(igi_server, 1.0)
AC_PROG_CC
#indicate where to create make files
AC_OUTPUT(Makefile)
************************************************** ***************

By using this Makefile.am and configure.in, I can just compile the sources and create the executables. But the problem is those compiled code does not give the expected result (it is highly differ form when it is used the previous Makefile)

It is obvious that the problem is with my Makefile.am file or configure.in, (I guess that required macro has not been used)
So please can anyone help me to create the proper Makefile.am file and configure.in file.
Feb 15 '08 #1
1 5013
I just able to fix the bug, but unfortunately I can not explain the reasons for it.

new Makefile.am
************************************************** ******************************

DEFS = -DLINUX -DRETSIGTYPE=void -DHAVE_SIGACTION=1
LIBS = -lpthread



CFLAGS = -g -Wall $(DEFS) $(INCS)



bin_PROGRAMS = igi_server igi_client


igi_server_SOURCES = nbs_server.c nbs_setsignal.c
igi_server_LDADD = $(LIBS)

igi_client_SOURCES = nbs_setsignal.c nbs_client.c nbs_client_test.c
igi_client_LDADD = $(LIBS)


************************************************** ******************************

I suggest that the main reason for this is the line
CFLAGS = -g -Wall $(DEFS) $(INCS)

Please if anyone know the reason, you are highly appreciate.
Feb 16 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Bryan Olson | last post by:
Here's the problem: Suppose we use: import socket f = some_socket.makefile() Then: f.read() is efficient, but verbose, and incorrect (or at least does not play will with others);
2
by: Magnus Therning | last post by:
I am currently using Automake to make distributable tar-balls of my application. Is there something else (hopefully better) that I can use? I use the following functionality of Automake: -...
2
by: Shalafi | last post by:
Hi, I've modified an old library, flip (fuzzy logic stuff), to work with new gcc compiler, I've made operation like substituting #include <strstream.h> with #include <strstream> and inserted...
2
by: Juhan Voolaid | last post by:
Hello I need help with my makefile, so that when I compile my project the source code files would be separated from the object (*.o) files. So if I have: main.cpp and classes.cpp - the...
0
by: Lynn Allan | last post by:
I'm a newbie to using the .net Visual Studio. I couldn't figure out a way for VS to generate a makefile that the sdk could compile. In VisStudio98, it was possible to select an option so that a...
6
by: jpetrang | last post by:
We use VS6.0 to support our automated build environment, and we'd like to move to something that is currently supported. One aspect of VS6.0 is part of the "Generate Makefile" feature, which it...
0
by: sana24 | last post by:
Hi all, i'm using linux and i would compile c++ files and genrate a dll outpout and not an executable. can you please help me how can i write a makefile to do it? thank you
4
by: Jess | last post by:
Hello, I am now trying to use makefile to compile C++ programs. My makefile looks like: f1.o : f1.cpp h1.h h2.h g++ -c f1.cpp f2.o : f2.cpp h2.h h3.h g++ -c f2.cpp
1
by: wingri | last post by:
Hello, I`ve got problem with make tool. I`ve got project and source codes are in direcory. Then, there are some other source codes in subdirectory of this directory. Now, from file in directory I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.