Makefiles1 MAKEFILES Purpose: contain UNIX commands and will run them in a specified sequence. Syntax Definition : { Section-name: {unix command #1} …

Slides:



Advertisements
Similar presentations
Introduction to the Omega Server CSE Overview Intro to Omega Basic Unix Command Files Directories Printing C and C++ compilers GNU Debugger.
Advertisements

Exploring the UNIX File System and File Security
Introducing the Command Line CMSC 121 Introduction to UNIX Much of the material in these slides was taken from Dan Hood’s CMSC 121 Lecture Notes.
Linux+ Guide to Linux Certification, Second Edition
Basic linux shell commands and Makefiles. Log on to engsoft.rutgers.edu Open SSH Secure Shell – Quick Connect Hostname: engsoft.rutgers.edu Username/password:
Guide To UNIX Using Linux Third Edition
Unix Basics. Systems Programming: Unix Basics 2 Unix Basics  Unix directories  Important Unix file commands  File and Directory Access Rights through.
Basic UNIX © McGraw Hill All rights reserved.
A Mini UNIX Tutorial. What’s UNIX?  An operating system run on many servers/workstations  Invented by AT&T Bell Labs in late 60’s  Currently there.
Linux Commands LINUX COMMANDS.
L INUX C OMMAND L INE I NTERFACE G UNAANBAN.G
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.
Systems Programming Concepts
Learning basic Unix command IT 325 operating system.
"Two of the most famous products of Berkeley are LSD and Unix. I don't think that this is a coincidence.” Anonymous.
Guide To UNIX Using Linux Fourth Edition
Notes Assignment #1 is due next Friday by 11:59 pm via Test #1 will be held Thursday February 18 at the start of class (one period long) Format:
1 THE UNIX FILE SYSTEM By Chokechai Chuensukanant ID COSC 513 Operating System.
The file structure and related utilities CS240 Computer Science II.
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
Linux Directory Navigation. File & Directory Commands This is a minimal list of Unix commands that you must know for file management: ls (list) mkdir.
1 Lecture 2 Working with Files and Directories COP 3344 Introduction to UNIX.
Essential Unix at ACEnet Joey Bernard, Computational Research Consultant.
Basic unix commands that everyone should know (Even if you have a mac) Slightly more advanced:
The UNIX Shell. The Shell Program that constantly runs at terminal after a user has logged in. Prompts the user and waits for user input. Interprets command.
Linux+ Guide to Linux Certification, Second Edition
The UNIX development environment CS 400/600 – Data Structures.
PROGRAMMING PROJECT POLICIES AND UNIX INTRO Sal LaMarca CSCI 1302, Fall 2009.
Chapter Two Exploring the UNIX File System and File Security.
UNIX Commands. Why UNIX Commands Are Noninteractive Command may take input from the output of another command (filters). May be scheduled to run at specific.
Lesson 9-Setting and Using Permissions. Overview Describing file permissions. Using execute permissions with a file. Changing file permissions using mnemonics.
Managing Files. Module 5 Managing Files ♦ Introduction “On a Linux system, everything is a file; if something is not a file, it is a process.” ♦ Topics.
Chapter Two Exploring the UNIX File System and File Security.
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Third Edition
Introduction to Programming Using C An Introduction to Operating Systems.
Λειτουργικά Συστήματα – Lab2 Γιάννης Πετράκης. Directory Navigation and Control  The Unix file system is set up like a tree branching out from the root.
Linux Commands C151 Multi-User Operating Systems.
File and Folder CLI Commands 12/24/ Agenda Overview of OS functions and the SHELL Internal v External Commands Command History Making & Modifying.
1 Lecture 2 Working with Files and Directories COP 3353 Introduction to UNIX.
C code organization CSE 2451 Rong Shi. Topics C code organization Linking Header files Makefiles.
UNIX filesystem CS 2204 Class meeting 2 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
1 Introduction to Unix. 2 What is UNIX?  UNIX is an Operating System (OS).  An operating system is a control program that helps the user communicate.
Unix Fundamentals CS 127. File navigation cd - change directory cd /var/log cd /etc/apache2 cd ~/Desktop ~ is a shortcut for the home directory.
Learning basic Unix command It 325 operating system.
Lesson 6-Using Utilities to Accomplish Complex Tasks.
Chapter 2: Exploring the UNIX File System (For Tuesday Section) File and File Systems.
Linux Tutorial Lesson Two *Getting Help in Linux *Data movement and manipulation *Relative and Absolute path *Processes Note: see chapter 1,2,3 from Linux.
Learning Unix/Linux Based on slides from: Eric Bishop.
Agenda The Linux File System (chapter 4 in text) Directory Structures / Navigation Terminology File Naming Rules Relative vs Absolute pathnames Unix Commands:
UNIX Basics Matt Hayward October 18, 2016 LS560 – Information Technology for information professionals.
UNIX To do work for the class, you will be using the Unix operating system. Once connected to the system, you will be presented with a login screen. Once.
File permissions Operating systems I800
Commands Basic syntax of shell commands UNIX or shell commands have a basic structure command -options target command comes first (such as cd or ls) any.
Andy Wang Object Oriented Programming in C++ COP 3330
Lecture 2 Working with Files and Directories
Some Linux Commands.
The Command Prompt Commands are the way to “do things” in Unix
Useful Linux Commands.
UNIX Basics Internet Technology.
Exploring the UNIX File System and File Security
Web Programming Essentials:
The Unix File System.
Andy Wang Object Oriented Programming in C++ COP 3330
Linux Shell Script Programming
Module 6 Working with Files and Directories
Lab 2: Terminal Basics.
January 26th, 2004 Class Meeting 2
Presentation transcript:

Makefiles1 MAKEFILES Purpose: contain UNIX commands and will run them in a specified sequence. Syntax Definition : { Section-name: {unix command #1} … } … Examples : lab5: ccbl lab5ap1.cob runcbl lab5ap1 ccbl lab5ap2.cob runcbl lab5ap2 ccbl lab5ap3.cob runcbl lab5ap3 ccbl lab5c.cob runcbl lab5ac clean: rm -f *.acu lab5*.dat cp /usr/class/cis314/lab5*in.dat. For Your Information Makefiles are a UNIX thing, not a COBOL thing You MUST put the unix commands in a file named: makefile (lower case with no extension) The directory you put the makefile in matters! You can only have one makefile per directory. Section names start in column 1 and end with a colon. The colon is immediately followed by a carriage return. Anything that can be entered at the UNIX command prompt can be in the makefile. Each command must be preceded by a TAB and is immediately followed by a carriage return MAKEFILES ARE UNFORGIVING WHEN IT COMES TO WHITESPACE! To execute… must be in the directory where the makefile is: % make section-name

Makefiles2 REMINDERS Two special folder names are useful when specifying relative paths: The. folder represents the current folder. The.. Folder represents the parent folder; the folder one level up in the folder hierarchy. The ~ character can be used as a shortcut for getting to your home directory. -r in the copy command  cp will copy the directory and all its files, including any subdirectories and their files to the target -f in the remove command  the files will be removed without prompting the user chmod command  read, write, execute (rwx) mine, group, everyone

Makefiles3 Currently in root directory Directories that exist: ~/cobol/oldinfo Want prelabout to compile and run the prelab file and show the output to the screen Want movedir to create a new directory directly under the root directory, and copy all the information from ~/cobol/oldinfo to the new directory leaving nothing behind prelabout: cd cobol ccbl prelab.cob runcbl prelab more prelabout.dat movedir: mkdir cobolold cd cobolold cp –r ~/cobol/oldinfo/*. rm -f ~/cobol/oldinfo/* rmdir ~/cobol/oldinfo ls *.* ANOTHER MAKEFILE EXAMPLE

Makefiles4 Deleting Unnecessary Files: As you work you create disk files, most of which do not need to be kept. These unnecessary files occupy disk space, and if not erased will eventually fill your disk quota. When this happens, you cannot save any other files, no matter how important. To help prevent this from occurring, there is a command called clean in the class directory (/usr/class/cis314/). Copy it in to your home directory using the UNIX cp command, and every so often enter the command clean. This will delete any unnecessary files from your home directory, leaving you more disk space. Clean Example: chmod 700 * rm *~ rm *.int rm *.obj rm *.acu rm *.err rm *.list ANOTHER EXAMPLE script file