Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 11-22-2010, 09:24 AM   #1
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

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


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)


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

    \rm *.o *~ liffe_runbreach-64bit

    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, 10:46 AM   #2
LQ Newbie
Registered: Nov 2010
Posts: 6

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

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

Rep: Reputation: 100Reputation: 100
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, 03:17 AM   #5
LQ Newbie
Registered: Nov 2010
Posts: 6

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



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 02:58 PM
Help needed for make file problem : make: *** No rule to make target `flash', needed rameshsatyavaram Linux - Newbie 3 09-11-2008 02: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 01:32 PM
How to Make a Linux Script File TankerKevo Linux - Newbie 3 06-18-2004 07:39 PM
Make file, dos, linux The_Nerd Programming 1 05-29-2004 11:36 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:47 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration