Find the answer to your Linux question:
Results 1 to 2 of 2
Hi all, I have a project which has the following code structure: folder_1 5 C++ source/header files folder_2 5 C++ source/header files folder_3 5 C++ source/header files Each folder has ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2012
    Posts
    1

    Makefile question


    Hi all,
    I have a project which has the following code structure:

    folder_1
    5 C++ source/header files
    folder_2
    5 C++ source/header files
    folder_3
    5 C++ source/header files

    Each folder has files that #include files in other folders and I was wondering how do I create a Makefile for each individual folder where it only compiles the files in that folder? During development, I don't want to build my entire program, but just want to compile pieces of it and I'm not sure how to do that...

    I found this from a tutorial website:
    Code:
    all:
    	g++ main.cpp hello.cpp factorial.cpp -o hello
    Unfortunately, I don't have a machine where I can test this right now, but should I just do something as simple as this:
    Code:
    all:
    	g++ *.cpp -o folder1.o

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,444
    Get the Gnu Make Manual from here: GNU Make Manual - GNU Project - Free Software Foundation (FSF) - it has a lot of good material to help understand how to do what you want.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •