LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 06-05-2004, 07:06 AM   #1
melinda_sayang
Member
 
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:
http://www.murrayc.com/learning/linu...automake.shtml
http://www.murrayc.com/learning/linu...ibraries.shtml

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, 11:30 AM   #2
aluser
Member
 
Registered: Mar 2004
Location: Massachusetts
Distribution: Debian
Posts: 557

Rep: Reputation: 42
Here's a Makefile.am for two programs, foo and bar. In the example foo and bar share some code, blah.cpp blah.h and stuff.h
Code:
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.
 
  


Reply


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 06:37 PM
Why doesn't my cd produce sound? cinnamonq Linux - Hardware 11 06-09-2004 06:19 PM
Produce random character with c program liguorir Linux - Software 4 05-23-2004 06:30 PM
Running a program inside my QT application does not produce needed output files??? keos Programming 0 02-22-2004 11:37 PM
slackware 9 asking for automake 1.6 while i have automake 1.7 gtgoku Slackware 1 10-19-2003 08:59 AM


All times are GMT -5. The time now is 03:28 PM.

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