Create a makefile called makefile

Assignment Help Operating System
Reference no: EM13669764

Write a Bash shell script, makemake.sh, that will create a makefile called Makefile based on all the .cpp files in the current directory. If a .cpp file has any #includes of non-system header files (those with double  quotes around them), then those files should be listed in its dependencies. The -Wall -ansi, and -g options will  always be used with g++. The shell script takes the name of the executable as its first argument. If no argument is  provided, the script should report the error, and print a usage statement. All other parameters are additional options  that should be used with every call to g++. The Makefile should end with a "clean:" routine that removes the  executable and all object files. (Hints: the -n option of echo inhibits the default newline, and \t and \n work with echo.  I used sed and awk to get at the name of the header files within the .cpp files.)[davis@lect1 p1]$ ls  appointment.cpp calendar.cpp day.h dayofweek.h Lnk.c private time.h year.h  appointment.h day.cpp dayofweek.cpp Ins.c makemake.sh time.cpp year.cpp 
[davis@lect1 p1]$ makemake.sh 
Executable name required. 
usage: makemake.sh executable_name 
[davis@lect1 p1]$ makemake.sh cal.out 
[davis@lect1 p1]$ make 
g++ -ansi -Wall -g -c appointment.cpp 
g++ -ansi -Wall -g -c calendar.cpp 
g++ -ansi -Wall -g -c day.cpp 
g++ -ansi -Wall -g -c dayofweek.cpp 
g++ -ansi -Wall -g -c time.cpp 
g++ -ansi -Wall -g -c year.cpp 
g++ -ansi -Wall -g -o cal.out appointment.o calendar.o day.o dayofweek.o time.o year.o 
[davis@lect1 p1]$ make clean 
rm -f cal.out appointment.o calendar.o day.o dayofweek.o time.o year.o 
[davis@lect1 p1]$ makemake.sh cal.out -O2 -g 
[davis@lect1 p1]$ cat Makefile 
cal.out : appointment.o calendar.o day.o dayofweek.o time.o year.o 
g++ -ansi -Wall -g -o cal.out -O2 -g appointment.o calendar.o day.o dayofweek.o time.o 
year.o 
appointment.o : appointment.cpp appointment.h 
g++ -ansi -Wall -g -c -O2 -g appointment.cpp 
calendar.o : calendar.cpp year.h 
g++ -ansi -Wall -g -c -O2 -g calendar.cpp 
day.o : day.cpp appointment.h day.h dayofweek.h 
g++ -ansi -Wall -g -c -O2 -g day.cpp 
dayofweek.o : dayofweek.cpp dayofweek.h 
g++ -ansi -Wall -g -c -O2 -g dayofweek.cpp 
time.o : time.cpp time.h 
g++ -ansi -Wall -g -c -O2 -g time.cpp 
year.o : year.cpp year.h day.h 
g++ -ansi -Wall -g -c -O2 -g year.cpp 
clean : 
rm -f cal.out appointment.o calendar.o day.o dayofweek.o time.o year.o 
[davis@lect1 p1]mce_markernbsp; 

Reference no: EM13669764

Questions Cloud

Obtain what is the magnitude of the electric field : An electron is released from rest in a uniform electric field. Determine what is the magnitude of the electric field
A magnetic field is directed perpendicular to the plane : A magnetic field is directed perpendicular to the plane of the.15 m *30 m rectangular coil comprised of 120 loops of wire. To induce an average emf of -1.2 V in the coil, the magnetic field is increased from .1 T to 1.5 T through a time interval Δt. ..
Calculate what is the force exerted by the person : A person pushes a 10 kilogram box from rest and accelerates it to a speed of 4.0 m/s with a constant force. calculate what is the force exerted by the person
Marketing theories for assignment : Build awareness for Haigh's Chocolate and to increase brand recognition for Haigh's Chocolate - marketing theories for this assignment.
Create a makefile called makefile : Create a makefile called Makefile based on all the .cpp files in the current directory
An overhead electric power line carries a maximum current : An overhead electric power line carries a maximum current of 125 A. What is the magnitude of the maximum magnetic field at a point 4.50 m directly below the power line?
Determine how much work does it take to move a charge : Determine how much work does it take to move a charge of 16C from point C to point D where the voltage at point D is 11 V greater than the voltage at point C
Decide the length of a copper wire that has a resistance : Decide the length of a copper wire that has a resistance of .172Ω and cross-sectional area of 1*10^-4 m^2. The resistivity of copper is 1.72 * 10^-8 Ω*m.
Find the magnitude of the magnetic field inside the torpid : A torpid having a square cross section, 7.00 cm on a side, and an inner radius of13.0 centimeter has 550 turns and carries a current of 0.650 Amp. Find the magnitude of the magnetic field inside the torpid at the outer radius

Reviews

Write a Review

Operating System Questions & Answers

  Task 1nbspon a fictitious computer of 32 bits paging memory

task 1nbspon a fictitious computer of 32 bits paging memory management system is used to manage its main memory

  Fragmentation on a storage device

Fragmentation on a storage device could be eliminated by re-compaction of the information. Typical disk devices do not have relocation or base registers (such as are used when memory is to be compacted)

  Pros and cons of using embedded uid and pw

Think about an embedded user id and password which provides me access to a client/server environment. Discuss the pros and cons of using an embedded uid and pw?

  It assets and intellectual property in opensource

Will IBM's plan to give away some of its IT assets and intellectual property and increase its support of opensource software products like Linux be a successful growth strategy in the "brutally competitive marketplace" in which it operates?

  Security monitoring activities in it

Discuss and explain the security monitoring activities that should be conducted in an company with both internal IT and e commerce applications.

  Question about internet use policies

Internet use policies are often utilized in corporations. Conduct independent research on these and construct an Internet use policy for your company or an organization of your choice.

  Explain page trace analysis using fifo

Increase size of memory so it contains four page frames for public use. Using same page request as above and FIFO, do another page trace analysis and calculate the failure and success ratio.

  Page table entries are needed for two-level paging

Assume that word 0 is part of a hole and that the highest word in memory contains valid tries are needed in the page table if traditional(one-level) paging is used? how many page table entries are needed for two-level paging, with 10 bits in ea..

  How much cylinder skew is needed for an oceangate disk

How much cylinder skew is needed for an oceangate disk operating at 20,000 rpm(new series for the christmas promotions) which has a seek time of 0.5 milliseconds? This disk has 800 sectors of 512 bytes each on each track?

  Consider a scenario of post mailbox there are two processes

consider a scenario of post mailbox there are two processes named sender s and receiver r. both processes can

  In a table forma compare between segmentation and virtual

in a table forma compare between segmentation and virtual memory organizations in terms of the memory structure

  Illustrate how many entries are there in logical address

Consider a computer system with 48-bit logical address and 4-KB page size. System supports up to 1 GB of physical memory. Illustrate how many entries are there in each of the following?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd