I need to create a makefile for a C program it contains two

I need to create a makefile for a C++ program. it contains two programs provided in class as listed below.

it will also contain two other files. a header file, fraction.h and fraction.cpp which is a class file. that will overide several functions to allow fraction cpp to add the fractions. Can someone write a basic makefile for me?

Solution


All:
   g++ -Wall calculator.cpp Fraction.cpp Fraction.h -o homework1a
   g++ -Wall useFraction.cpp Fraction.cpp Fraction.h -o homework1b
calculator.o:
   g++ -c calculator.cpp
useFraction.o:
   g++ -c useFraction.cpp

I need to create a makefile for a C++ program. it contains two programs provided in class as listed below. it will also contain two other files. a header file,

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site