473,395 Members | 1,823 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,395 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 5014
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: 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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.