Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 06-05-2004, 08:06 AM   #1
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475

Rep: Reputation: 31
How to produce two binary program using automake

I use this Makefile to produce two of my program. These two of my program are related. CXX=g++
CXXFLAGS=-g -Wall `pkg-config --cflags libglademm-2.4 libxml++-1.0`
LIBS=`pkg-config --libs libglademm-2.4 libxml++-1.0`

daemon_wallpapoz: wallpapoz daemon_wallpapoz.o Process.o
$(CXX) $(LIBS) -o daemon_wallpapoz daemon_wallpapoz.o Process.o

daemon_wallpapoz.o: daemon_wallpapoz.cpp Process.cpp
$(CXX) $(CXXFLAGS) -c daemon_wallpapoz.cpp Process.cpp

wallpapoz: wallpapoz.o main.o Process.o
$(CXX) $(LIBS) wallpapoz.o main.o Process.o -o wallpapoz

Process.o: Process.cpp Process.h
g++ -c Process.cpp

main.o: main.cpp wallpapoz.h
$(CXX) -c $(CXXFLAGS) main.cpp

wallpapoz.o: wallpapoz.cpp Process.cpp wallpapoz.h
$(CXX) -c $(CXXFLAGS) wallpapoz.cpp

But however I want to upgrade this simple Makefile to more complicated Makefile so I can use autoconf and automake. I learn autoconf from here:

But the pages do not tell how to produce two program using autoconf and automake. How do I accomplish that? What file do I have to manipulate?
Old 06-05-2004, 12:30 PM   #2
Registered: Mar 2004
Location: Massachusetts
Distribution: Debian
Posts: 557

Rep: Reputation: 43
Here's a for two programs, foo and bar. In the example foo and bar share some code, blah.cpp blah.h and stuff.h
AM_CXXFLAGS = blah blah blah
bin_PROGRAMS = foo bar
foo_SOURCES = foo.cpp blah.cpp blah.h stuff.h
bar_SOURCES = bar.cpp blah.cpp blah.h stuff.h
There's a thing called autobook which describes autoconf, automake, and libtool real well. Google for it or there might be a package of it for your distro.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Scribus installation problem, sez I need automake 1.6 when automake 1.9 is istalled Rockgod2099 Linux - Software 13 11-14-2004 07:37 PM
Why doesn't my cd produce sound? cinnamonq Linux - Hardware 11 06-09-2004 07:19 PM
Produce random character with c program liguorir Linux - Software 4 05-23-2004 07:30 PM
Running a program inside my QT application does not produce needed output files??? keos Programming 0 02-23-2004 12:37 AM
slackware 9 asking for automake 1.6 while i have automake 1.7 gtgoku Slackware 1 10-19-2003 09:59 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:20 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration