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

  Which of the following is a pure abstract function

Which of the following is a pure abstract function?

  Program that allows two human players to play the chess

The official rules of checkers allows a player to jump many times in a row with the same piece, capturing several of the opposing pieces on the same turn.

  Write a program that will calculate the percentage

Write a program that will calculate the percentage wins of a team. The program will input the number of wins and losses that a team acquired during a season. The wins should be input in a parameter-less value returning function that returns the wi..

  Write the definition of the constructor in line 1

Write the definition of the constructor in Line 1 so that the private member variables are initialized to 0.

  Write program that stores the numbers in array

Write a c++ program that stores the following numbers in the array named miles: 15,22,16,18,27,23, and 20. have your program copy the data stored in miles to another array.

  Provide a three-argument constructor

Create a class called Point that has two data members: x- and y-coordinates of the point. Provide a no-argument and a 2-argument constructor - Provide a three-argument constructor

  Develop a two dimensional interactive game

The player starts as a disk, but can "morph" (that is expand and contract) in selected directions

  Create a data file called friends.dat

Create a data file called friends.dat using any text-based editor and enter at least three records storing your friends' first and last names. Make sure that each field in the record is separated by a white space.

  What is the output of the following c++ statements

What is the output of the following C++ statements? See attached file for full problem description.

  Prepare a cc program that uses the pthread library to

prepare a cc program that uses the pthread library to create threads and mutexes to synchronize them. the program must

  Create a structure array

Create a structure array of at least 10 imaginary students in the class - choose names, numbers and marks randomly - they do not have to relate to real students in your class. Each student structure must contain the following fields:

  Write a program that reads the scores from the file

Write a program that reads the scores from the file and displays their total and average. Scores are separated by blanks.

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