Question
This assignment is intended to introduce you to Makefiles and Modules Makefiles: For this assignment (and every assignment after this assignment, unless otherwise indicated) you
This assignment is intended to introduce you to Makefiles and Modules Makefiles: For this assignment (and every assignment after this assignment, unless otherwise indicated) you will need to use a Makefile. You should be creating a standard Makefile with targets for "all" and "clean". You should also create object files for each of the modules, and they should be set up as proper dependencies so that they are only compiled when needed. Make sure to "cat" the makefile when making the script, and to include the makefile when you are submitting your code. The Assignment: For this assignment, I want you to write a simple math library. The library should include four functions - add(), subtract(), multiply() and divide(). All of the functions should take in a pair of ints, and all should returns ints except divide(), which should return a double. Write a menu that takes in a number to determine which function to call, take in the pair of numbers to pass to the function, and then call the function. Please note that all of these math functions should be in a file called myMath.c which has a corresponding myMath.hfile that you include in your main program. You should test the functions from your main program where you #import "myMath.h". The programming in this assignment (the math functions themselves) are pretty simple. The focus of this assignment is to make sure that you can figure out how modules work and how makefiles work. You will be marked on both the Makefile and the ability to write the library.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started