makefile help

This is a discussion on makefile help within the C++ Programming forums, part of the General Programming Boards category; Hi I have some libraries that require execution with a certain make file. However I am unsure how to extend ...

  1. #1
    Registered User
    Join Date
    Jul 2005
    Posts
    41

    makefile help

    Hi

    I have some libraries that require execution with a certain make file. However I am unsure how to extend the makefile to include other .cpp files. I have listed below. Could some-one please explain how to do this, thanks

    Code:
    #---------------------------------------------------------------------#
    #                    include platform specific settings
    #---------------------------------------------------------------------#
    # Choose the right include file from the <cgalroot>/make directory.
    
    # CGAL_MAKEFILE = ENTER_YOUR_INCLUDE_MAKEFILE_HERE
    include $(CGAL_MAKEFILE)
    
    #---------------------------------------------------------------------#
    #                    compiler flags
    #---------------------------------------------------------------------#
    
    CXXFLAGS = \
               -I../../include \
               $(CGAL_CXXFLAGS) \
               $(LONG_NAME_PROBLEM_CXXFLAGS)
    
    #---------------------------------------------------------------------#
    #                    linker flags
    #---------------------------------------------------------------------#
    
    LIBPATH = \
              $(CGAL_LIBPATH)
    
    LDFLAGS = \
              $(LONG_NAME_PROBLEM_LDFLAGS) \
              $(CGAL_LDFLAGS)
    
    #---------------------------------------------------------------------#
    #                    target entries
    #---------------------------------------------------------------------#
    
    all:
    
    
    
    clean: 
    
    #---------------------------------------------------------------------#
    #                    suffix rules
    #---------------------------------------------------------------------#
    
    .C$(OBJ_EXT):
    	$(CGAL_CXX) $(CXXFLAGS) $(OBJ_OPT) $<
    
    
    .cpp$(OBJ_EXT):
    	$(CGAL_CXX) $(CXXFLAGS) $(OBJ_OPT) $<

  2. #2
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Give me the names and paths of the libraries and I'd be fine doing it for you. If you want to be independent though, just define where the files exist LIBPATH and the name of of the library in the linker path or even LDFLAGS if you wanted. Just as a shortcut a library such as libopengl.a could be noted as -lopengl or libmylibrary.a could be noted as -lmylibrary.

  3. #3
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    For everyone else in the world with the same question, after a quick google I found this handy tutorial:

    http://www.opussoftware.com/tutorial/TutMakefile.htm

    I think nothing beats just reading the makefiles your IDE spits out and deriving and understanding from that. But for people not using and IDE it helps to have a tutorial.

  4. #4
    Registered User
    Join Date
    Jul 2005
    Posts
    41
    Thanks for the link, but unless I am mistaken I did not see anything relating to the structure of the makefile that I have. I have been this archetype because I do not have an IDE simply the template makefile. I have been placing the single .ccp after all: But when I placed the second file I wish to incorporate into the compilation, it no longer works. So in a nutshell, how do I incorporate this second file....

    Thanks

  5. #5
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Hence my request for paths Just give me the names of your cpp files, the names of your libraries, and the paths to your include and library directories. What OS are you using? Perhaps I can recommend an IDE.

  6. #6
    Registered User
    Join Date
    Jul 2005
    Posts
    41
    dont want to go down the IDE route....

    I'm on ubuntu....

  7. #7
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    I have a machine sitting next to me operating systemless and ubuntu 7.1 waiting to be put on it. How are you liking it?

  8. #8
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,456
    dont want to go down the IDE route....
    Why not? Learning purposes?

    I admit that I am rather bad at manually editing makefiles, which is partially why I ended up using SCons unless a project maintainer or an IDE manages the makefile for me.

    I have a machine sitting next to me operating systemless and ubuntu 7.1 waiting to be put on it. How are you liking it?
    Perhaps you mean Ubuntu 7.10? Though Ubuntu 8.04 was released a few days ago...
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  9. #9
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Yeah it was released a couple of days after my 7.10 download (Jesus... I didn't think leaving out a minor version was a crime these days).

  10. #10
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,456
    I didn't think leaving out a minor version was a crime these days
    They have a funny naming convention. 7.10 is not 7.1.0, but literally 7.10, as in 2007, October (month #10). Thus 7.1 is an entirely different version, meaning 2007, January.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  11. #11
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Oh ok. Very well then laserlight, I will stop thinking of you as a semantics bully

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Makefile Problem: None rule to make target
    By chris24300 in forum Linux Programming
    Replies: 25
    Last Post: 06-17-2009, 09:45 AM
  2. Building a project using a Makefile
    By starcatcher in forum Windows Programming
    Replies: 2
    Last Post: 11-23-2008, 10:50 PM
  3. unix makefile won't work but works in Dev C++
    By jk1998 in forum C++ Programming
    Replies: 1
    Last Post: 06-09-2007, 03:54 PM
  4. makefile blues....
    By WaterNut in forum C Programming
    Replies: 6
    Last Post: 05-30-2005, 08:22 PM
  5. Need help with Makefile
    By xshapirox in forum C++ Programming
    Replies: 14
    Last Post: 09-28-2004, 03:32 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21