Presentation is loading. Please wait.

Presentation is loading. Please wait.

Makefile Assignment Create a file called f1.cpp. It should contain the following function: int squareIt ( int x ) { //insert code to calc and return the.

Similar presentations


Presentation on theme: "Makefile Assignment Create a file called f1.cpp. It should contain the following function: int squareIt ( int x ) { //insert code to calc and return the."— Presentation transcript:

1 Makefile Assignment Create a file called f1.cpp. It should contain the following function: int squareIt ( int x ) { //insert code to calc and return the square of x }

2 Assignment (cont’d.) Create a file called f2.cpp. It should contain the following function: int cubeIt ( int x ) { //insert code to calc and return the cube of x }

3 Assignment (cont’d.) Create a main program in a file called main.cpp.
#include <stdio.h> extern int squareIt ( int x ); extern int cubeIt ( int x ); int main ( int argc, char* argv[] ) { }

4 Assignment (cont’d.) main should then call the two functions using any values you wish, and add up the values. main should repeat the above 3 times. Get this to compile, link, and run using makefiles on both Windows and Unix/Linux/MacOS. (Do not use cmake to create the makefiles.)

5 Assignment (cont’d.) Then create a makefile which should recompile and relink only when changes are made. The makefile should also contain a tag called clean. Whenever the user types make clean, this tag should simply delete all object and executable files. See the man page for rm (Unix) and del (Windows). If no object or executable files are present, make clean should not report any errors.

6 Assignment (cont’d.) Fully document each C/C++ file and each function with doxygen. Add a tag to the makefile called docs. When the user enters ‘make docs’ or ‘nmake docs’, doxygen is executed to update the documentation. f1.cpp, f2.cpp, main.cpp, and your makefiles to me. The subject must be SE Makefile.


Download ppt "Makefile Assignment Create a file called f1.cpp. It should contain the following function: int squareIt ( int x ) { //insert code to calc and return the."

Similar presentations


Ads by Google