Produce an executable file, C/C++ Programming

Requirements

  • Create a "makefile" that will manage the construction of a program
  • The name of the makefile must be: makefile
  • The make file must produce an executable file. The name of the executable file must be:

myProgram

  • Use the g++ compiler (This is the C++ compiler from our friends at GNU. It is on Einstein)
  • Base the makefile on the source files listed below.
  • The makefile and the source files must be located in $HOME/itec400/homework
  • Make sure the permissions on the your itec400 directory are 705
  • Make sure the permissions on your make file and your source files are 705

Source files

Create the following 5 files under your "homework" directory:

Source File 1: main.cpp

#include "employee.h"

#include "address.h"

int main()

{

printf("program works\n");

}

Source File 2: employee.cpp

#include "address.h"

Source File 3: address.cpp

#include

Source File 4: employee.h

#ifndef EMPLOYEE_H

#define EMPLOYEE_H

#endif

Source File 5: address.h

#ifndef ADDRESS_H

#define ADDRESS_H

#include

#endif

Testing

The script "test_build.sh" is utilized to invoke the "make" command. You can obtain a copy "test_build.sh" at the following location:

http://cs.franklin.edu/~dandrear/itec400/Misc/test_build.sh If you have written your

"makefile" properly, execution of the test_build.sh script should generate the following output:

1. touch everything - everything should build

g++ -c main.cpp

g++ -c address.cpp

g++ -c employee.cpp

g++ -o myProgram main.o address.o employee.o

2. touch nothing - nothing should build

make: 'myProgram' is up to date.

3. touch address.h - main and employee should build

g++ -c main.cpp

g++ -c employee.cpp

g++ -o myProgram main.o address.o employee.o

4. touch main.cpp - only main.o should build

g++ -c main.cpp

g++ -o myProgram main.o address.o employee.o

5. touch employee.cpp - only employee.o should build

g++ -c employee.cpp

g++ -o myProgram main.o address.o employee.o

6. touch address.cpp - only address.o should build

g++ -c address.cpp

g++ -o myProgram main.o address.o employee.o

Remove myProgram and all object files (.o)

Posted Date: 4/2/2013 6:20:45 AM | Location : United States







Related Discussions:- Produce an executable file, Assignment Help, Ask Question on Produce an executable file, Get Answer, Expert's Help, Produce an executable file Discussions

Write discussion on Produce an executable file
Your posts are moderated
Related Questions
Problem Write a program in C++ to read N numbers in an array, the user should be able to search a particular number in the array using sequential search algorithm. Writing a

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b.

Explain Formatted Input Output with File Pointer? Likewise there are equivalents to the functions scanf and printf which write or read data to files. These are called fscanf a

Program is to search for a given character in a string: Program is to search for a given character in a string and print point of match char *stsearch(char *string, char sea

Write three functions in C or C++: one that declares a large array statically, one that declares the same large array on the stack, and one that creates the same large array from t

#questio#A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concatenation. For a string

•Flow Chart and Pseudocode of Add module - Hotel booking - Signup for new membership Delete module - Hotel reservation cancellation - Change of reservation

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

Explain the parts of operators Assignment Operators The equal (=) sign is used for assigning a value to another. The left hand side has to be a variable (lvalue, which exc

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec