Create a make file and a a shell script

Assignment Help C/C++ Programming
Reference no: EM131161043

Makefiles and Shell Scripts

Instructions

Create a make file and a a shell script that perform the same functions.

The following commands may be useful in this assignment:

  • mkdir -p foo creates a directory called "foo" if it does not exist; otherwise, it does nothing
  • tar czf archive.tar.gz inputfile1 inputfile2 creates an archive called archive.tar.gz containing the specified input files (you can provide any number of input files).
  • date -r bar +%s prints the modification time of the file "bar", expressed as the number of seconds since midnight on Jan 1, 1970.

Makefile

Your makefile will operate on a directory containing PowerPoint (.ppt) files. The task of the makefile will be to convert each of the PowerPoint files to PDFs, copy all of the ppt and pdf files into an archive, and then copy the archive to another diretory. Your makefile should do the following:

  • For each ppt file in the current directory, check if a pdf file with the same name exists. If not, or if the ppt file is newer than the pdf file, your makefile should convert the ppt to a pdf. The names of the two files will be the same, except for the extension (so if there is a file called lecture1.ppt, you will create a file called lecture1.pdf). You can assume that the ppt on the end of the file name is lower case. You can also assume that the command ppttopdf file1.ppt will create a pdf file called file1.pdf.
  • Your makefile should then put all the ppt and pdf files into an archive called lectures.tar.gz. The command to do so is tar; for example, tar czf outputfile.tar.gz file1 file2 would put file1 and file2 into an archive called outputfile.tar.gz. Your makefile should only create the archive file if it does not exist, or if any of the pdf or ppt files is newer than the archive file.
  • Your makefile should then copy lectures.tar.gz into a subdirectory of the current directory called www. It should create this directory if it doesn't exist. However, it should not do either of these steps unless a new archive file was created in the previous step.
  • Your makefile should be set up such that typing "make" (without specifying a target) in the directory with the makefile performs the above actions.
  • Your makefile should also implement a "clean" option: if the user types "make clean", it should delete all the pdf files and lectures.tar.gz (but not the ppt files). It should only delete lectures.tar.gz in the current directory, NOT in the www directory.

You are required to use macros in your makefile - any command or file name that is repeated multiple times should be converted to a macro. You are also required to use comments to describe what your makefile does (comments in a makefile start with '#').

Shell Script

You must also create a shell script called "lecarchive.sh". You may create your script for any shell (bash, csh, etc), as long as it works on lectura. You are required to use a shell scripting language, though, not a higher level language such as Python. If you are not sure if your chosen scripting language is acceptable, please check with the instructor. Your script should perform exactly the same tasks as your makefile -- it should scan through the current directory and convert ppt files to pdf files as needed, and then create a new archive file if needed. The commands for creating pdf and archive files are given in the previous section.

Note that this file should also implement a "clean" command - so running "lecarchive.sh" should update the archive as described above, but running "lecharchive.sh clean" should delete the pdf and archive files.

As with the makefile, you are required to include comments in your script describing what it does.

You should name this file lecarchive.sh (this name is case sensitive). If you name your shell script something else, it may not work.

Reference no: EM131161043

Questions Cloud

What is the capability score of the filling process : A hospital is forced to manually put the flu shot vaccine into the syringes.- What is the capability score of the filling process.
System of equations using substitution : Solve the system of equations using substitution, elimination by addition, or augmented matrix methods (your choice). Show work.
How should you allocate your studying time to get best grade : After that, you will get 1 point for each 1.5 hours you spend up to the maximum of 50 points. How should you allocate your studying time to get the best grade? Why?
Total amount of money : Tamika's savings account has a balance of $4069. If she makes no deposits or withdrawals for 4 years, and the account accrues interest at 5% compounded quarterly, what will be the total amount of money in her savings account at the end of the 4-y..
Create a make file and a a shell script : Create a make file and a a shell script that perform the same functions. The following commands may be useful in this assignment: mkdir -p foo creates a directory called "foo" if it does not exist; otherwise, it does nothing
Hofstedes model sweden and the netherlands : Considering Hofstede's model, Sweden and The Netherlands appear similar. - What went wrong in the preceding situation?
What amount of labor input are the firm''s average equal : At what amount of labor input are the firm's average and marginal product of labor equal? Confirm that the average and marginal product curves satisfy the relationship discussed in the text.
Discuss the pros and cons of microsofts : discuss the pros and cons of microsoft's most recent i'm a pc campaign.- Is microsoft doing a good thing by acknowledging apple's campaign in its own marketing message?
Sample mean resonance frequency : What is the value of the sample mean resonance frequency? (Hint: Where is the confidence interval centered?)

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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