LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 11-22-2010, 10:24 AM   #1
gulHK
LQ Newbie
 
Registered: Nov 2010
Posts: 6

Rep: Reputation: 0
linux make file


Hello everyone.

I am new to creating make files. I have been able to create simple makefiles for those applications which do not involve database but am unable to create for the ones that do involve database. When I run that make file, it just deletes the .exe file of that application from the folder. Could anyone please help me with this.

That's how my make file looks


Code:
INCLUDES = -I/usr/include/mysql++ -I/usr/include/mysql
LIBRARY = -L/usr/lib64/ -L/usr/lib64/mysql -lmysqlpp
SOURCE = /usr/local/babbage/bin/BreachCheck

VPATH = $(INCLUDES) $(LIBRARY) $(SOURCE)

OBJS = breachtester.o breachwriter.o cherrypicker.o datecl.o formatter.o frontrunner.o liffeconnect.o \
    liffe_runbreach.o logger.o positionmonitor.o reportwriter.o

CC = g++

DEBUG = -g

CFLAGS = -Wall -c $(DEBUG)

LFLAGS = -Wall $(DEBUG)

liffe_runbreach-64bit : $(OBJS)
    $(CC) $(LFLAGS) $(OBJS) -o liffe_runbreach-64bit

breachtester.o : breachtester.h breachtester.cpp breachwriter.h logger.h formatter.h \
        datecl.h liffeconnect.h
        $(CC) $(INCLUDES) $(CFLAGS) breachtester.cpp

breachwriter.o : breachwriter.h breachwriter.cpp breachtester.h liffeconnect.h
    $(CC) $(INCLUDES) $(CFLAGS) breachwriter.cpp

cherrypicker.o : cherrypicker.h cherrypicker.cpp reportwriter.h
    $(CC) $(INCLUDES) $(CFLAGS) cherrypicker.cpp

datecl.o : datecl.h datecl.cpp
    $(CC) $(CFLAGS) datecl.cpp

formatter.o : formatter.h formatter.cpp
    $(CC) $(CFLAGS) formatter.cpp

frontrunner.o : frontrunner.h frontrunner.cpp liffeconnect.h reportwriter.h
    $(CC) $(INCLUDES) $(CFLAGS) frontrunner.cpp

liffeconnect.o : liffeconnect.h liffeconnect.cpp logger.h formatter.h breachtester.h
    $(CC) $(INCLUDES) $(CFLAGS) liffeconnect.cpp

logger.o : logger.h logger.cpp
    $(CC) $(CFLAGS) logger.cpp

positionmonitor.o : positionmonitor.h positionmonitor.cpp logger.h formatter.h
    $(CC) $(INCLUDES) $(CFLAGS) positionmonitor.cpp

reportwriter.o : reportwriter.h reportwriter.cpp frontrunner.h liffeconnect.h
    $(CC) $(INCLUDES) $(CFLAGS) reportwriter.cpp

liffe_runbreach.o : liffe_runbreach.cpp datecl.h logger.h breachtester.h liffeconnect.h formatter.h \
            breachwriter.h cherrypicker.h frontrunner.h reportwriter.h
    $(CC) $(INCLUDES) $(CFLAGS) liffe_runbreach.cpp

clean:
    \rm *.o *~ liffe_runbreach-64bit

tar:
    tar cfv liffe_runbreach-64bit.tar breachwriter.h breachwriter.cpp cherrypicker.h \
        cherrypicker.cpp logger.cpp logger.h breachtester.cpp breachtester.h datecl.h datecl.cpp \
        frontrunner.h frontrunner.cpp positionmonitor.h positionmonitor.cpp liffe_runbreach.cpp
 
Old 11-22-2010, 11:46 AM   #2
gulHK
LQ Newbie
 
Registered: Nov 2010
Posts: 6

Original Poster
Rep: Reputation: 0
it gives me the following error message

Code:
collect2: ld returned 1 exit status
make: *** [liffe_runbreach-64bit] Error 1
 
Old 11-23-2010, 02:45 AM   #3
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,477

Rep: Reputation: 87
Take a look at the GNU Autotools (just google it).

This is a very comprehensive set of tools that writes makefiles FOR you based on rules you provide - much easier and faster to use and very powerful.
 
Old 11-23-2010, 04:17 AM   #5
gulHK
LQ Newbie
 
Registered: Nov 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks knudfl and rylan76 . Let me go through these links
 
  


Reply

Tags
autotools


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
make with make file yields error: /usr/bin/javac: cannot execute binary file bweaver Ubuntu 4 11-19-2010 03:58 PM
Help needed for make file problem : make: *** No rule to make target `flash', needed rameshsatyavaram Linux - Newbie 3 09-11-2008 03:13 AM
I want to make a link from word in one file to a different file using Ubuntu linux gilbert.baumslag Linux - Newbie 3 01-11-2008 02:32 PM
How to Make a Linux Script File TankerKevo Linux - Newbie 3 06-18-2004 08:39 PM
Make file, dos, linux The_Nerd Programming 1 05-30-2004 12:36 AM


All times are GMT -5. The time now is 02:34 PM.

Main Menu
Advertisement
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