Makefiles, Geany CS 244 Brent M. Dingle, Ph.D. Game Design and Development Program Department of Mathematics, Statistics, and Computer Science University.

Slides:



Advertisements
Similar presentations
Using CD-R and CD-RW media to backup SIGNZ data. Step One … a bit of preparation.
Advertisements

Using Eclipse. Getting Started There are three ways to create a Java project: 1:Select File > New > Project, 2 Select the arrow of the button in the upper.
Copyright © 2008 Pearson Addison-Wesley. All rights reserved. Chapter 12 Separate Compilation Namespaces Simple Make Files (Ignore all class references.
1 ENERGY 211 / CME 211 Lecture 2 September 24, 2008.
Using the File Manager WebCT 6. Understanding File Manager The File Manager is the area where all course files are stored. Whenever you link a file in.
FIRST COURSE Creating Web Pages with Microsoft Office 2007.
Microsoft ® Office PowerPoint ® 2003 Training Playing movies [Your company name] presents:
Testing and Debugging Hakam Alomari
Editing Java programs with the BlueJ IDE. Working environments to develop (= write) programs There are 2 ways to develop (write) computer programs: 1.Using.
Microsoft ® Office PowerPoint ® 2003 Training Create your first Presentation Mr Garel…… presents:
1 ENG236: ENG236: C++ Programming Environment (2) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 2 - HelloWorld Application: Introduction to.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 22 Macros.
Getting started with Alice Adapted from presentations by Jenna Hayes, Duke University Donna Gavin, UWP Computer Science and Software Engineering.
Alice 2.0 Introductory Concepts and Techniques Project 1 Exploring Alice and Object-Oriented Programming.
C++ Basics Structure of a Program. C++ Source Code Plain text file Typical file extension .CPP Must compile the C++ source code without errors before.
1 The EDIT Program The Edit program is a full screen text editor that allows you to: Create text files Create text files Edit an existing text files Edit.
CPS120: Introduction to Computer Science Compiling Your Programs Using Visual C++
Booting Ubuntu Linux Live CSCI 130 – Fall 2008 Action Lab Dr. W. Jones.
An Introduction to Office  Office XP and Office 2007 look very different  This introduction should: ◦ Introduce you to some of the basic changes.
General Data Structures and Algorithms CS 244 Brent M. Dingle, Ph.D. Department of Mathematics, Statistics, and Computer Science University of Wisconsin.
Files to turn in for Homework # 1 1)TimerApplet.java 2)TimerApplet.html 3)TimerSyntaxErr.java 4)TimerSemanticErr.java 5)TimerSemanticErr.html 6)HomeWork1.txt.
9/2/ CS171 -Math & Computer Science Department at Emory University.
Linked Lists part 2 CS 244 Brent M. Dingle, Ph.D. Game Design and Development Program Department of Mathematics, Statistics, and Computer Science University.
Review and Prepare for Test 3 CS 244 Brent M. Dingle, Ph.D. Game Design and Development Program Department of Mathematics, Statistics, and Computer Science.
Using Microsoft Visual Studio C++ Express 2005 Name: Dr Ju Wang Ashwin Belle Course Resource:
Big Oh CS 244 Brent M. Dingle, Ph.D. Game Design and Development Program Department of Mathematics, Statistics, and Computer Science University of Wisconsin.
C++ and Ubuntu Linux Review and Practice CS 244 Brent M. Dingle, Ph.D. Game Design and Development Program Department of Mathematics, Statistics, and.
Computer Skills /1436 Department of Computer Science Foundation Year Program Umm Alqura University, Makkah Place photo here 1.
HelloWorld – GameOver CS 244 – Data Structures and Algorithms Department of Mathematics, Statistics, and Computer Science University of Wisconsin – Stout.
Hanoi Towers Big Oh Recursion Data Structures and Algorithms CS 244 Brent M. Dingle, Ph.D. Department of Mathematics, Statistics, and Computer Science.
Creating Programs on UNIX This term you can create programs on UNIX or you can create programs using a C++ compiler on your PC. This set of slides steps.
WELCOME to CS244 Brent M. Dingle, Ph.D Game Design and Development Program Mathematics, Statistics and Computer Science University of Wisconsin -
Linked Lists part 1 CS 244 Brent M. Dingle, Ph.D. Game Design and Development Program Department of Mathematics, Statistics, and Computer Science University.
Using This PowerPoint This PowerPoint presentation assumes your Computer Science teacher has provided you with the InstallingJava folder, which contains.
References and Pointers CS 244 Connect Speakers for this Presentation Brent M. Dingle, Ph.D. Game Design and Development Program Department of Mathematics,
C++ LANGUAGE TUTORIAL LESSON 1 –WRITING YOUR FIRST PROGRAM.
PowerPoint: Animation Randy Graff HSC IT Center Training
Compiling and running Java programs with BlueJ. Successfully compiled files program files in BlueJ You can tell from the shade of a program icon in BlueJ.
Photo Story. How to use Photo Story Photo Story 3 can be located in the Accessories folder on school computers. You will need to have your pictures already.
1 Getting Started with C++ Part 2 Linux. 2 Getting Started on Linux Now we will look at Linux. See how to copy files between Windows and Linux Compile.
Introduction to Computer Programming - Project 2 Intro to Digital Technology.
Make Make is a system utility that automatically compiles your programs for you Make looks for a file named Makefile (or makefile) in the current directory.
C code organization CSE 2451 Rong Shi. Topics C code organization Linking Header files Makefiles.
Building the CarryDrop simulation in Eclipse Creating a new project with existing code from John Murphy’s RePast tutorial.
Reading from a file, Sorting, and a little Searching Data Structures and Algorithms CS 244 Brent M. Dingle, Ph.D. Department of Mathematics, Statistics,
By Susan Fuentes Media Specialist Smiley Elementary.
Microsoft PowerPoint Prepared by the Academic Faculty Members of IT.
Hanoi Towers part 1 CS 244 Brent M. Dingle, Ph.D. Game Design and Development Program Department of Mathematics, Statistics, and Computer Science University.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Using Macros Lesson.
CS 201 Lecture 1 (b) Using an IDE Tarik Booker CS 201: Introduction to Programming California State University, Los Angeles.
Linux CSE 1222 CSE1222: Lecture 1BThe Ohio State University1.
Makefiles, Geany, ADTs, UML, C++ classes Data Structures and Algorithms CS 244 Brent M. Dingle, Ph.D. Department of Mathematics, Statistics, and Computer.
Note to trainers The videos in this presentation provide closed-caption files, and they’re on by default because it’s often easier for viewers of all.
Development Environment
Overview of SAMT Batch Upload
COMP 170 – Introduction to Object Oriented Programming
PowerPoint Activity 5: To Be Determined…
T_C_N_L_G_ E D I D I E O Y O H I E B J I R E A A W.
Microsoft Word 2010 Lesson 1.
How to complete a Referral Form via “Student” tab
Makefiles and the make utility
How to Run a Java Program
Creating the First Program
Makefiles and the make utility
How to use contrast.
SPL – PS1 Introduction to C++.
Presentation transcript:

Makefiles, Geany CS 244 Brent M. Dingle, Ph.D. Game Design and Development Program Department of Mathematics, Statistics, and Computer Science University of Wisconsin – Stout 2014

From Last Time Standard Template Library – Containers For example, std:: vector – Iterators – Algorithms

Things to Note Homework 3 is Due Soon – Like now – Please turn something in if you have not already Homework 4 and 5 are Posted on D2L – Do NOT delay in starting

For Today Makefiles – compiling multiple files Geany – a primitive IDE Then more

Marker Slide Any General Questions Next up – makefiles – geany

Multiple File Compiles and Builds Many programs in this class will have multiple files. To compile and build multiple files is done from the command prompt (terminal window): g++ file01.cpp file02.cpp file03.cpp

Class Activity – Using Makefiles In D2L locate: – Making_Makefiles_Example.pdf – Open that file and follow along with the next few slides ASIDE: Command: dos2unix myfile.txt may be helpful if copying text between windows and linux

Class Activity Demo – Create Source Create the 3 files (use editor of choice) – HelloMain.cpp – HelloFunction.cpp – HelloFunction.h HelloMain.cppHelloFunction.cppHelloFunction.h #include "HelloFunction.h" int main() { HelloFunction(); return 0; } #include "HelloFunction.h" void HelloFunction() { cout << "Hello there\n"; } // include standard stuff void HelloFunction(); Animated GIF

Class Activity Demo: g++ Compile/Build Compile and build from Terminal Window – g++ -o hello HelloMain.cpp HelloFunction.cpp Run the resulting executable –./hello Remove the hello file – rm hello Animated GIF

Class Activity Demo – Create makefile Create a makefile The lines that start with g++ (and rm) must begin with a TAB – spaces will not work makefile hello: HelloMain.o HelloFunction.o g++ -o hello HelloMain.o HelloFunction.o HelloMain.o: HelloMain.cpp g++ -c HelloMain.cpp HelloFunction.o: HelloFunction.cpp g++ -c HelloFunction.cpp clean: rm -rf *.o hello

Class Activity Demo – use makefile Compile and build from Terminal Window – make Run the resulting executable –./hello Remove the.o files and hello – make clean Animated GIF (run the powerpoint and wait a second or two)

Marker Slide Any questions on – makefiles Next up – geany

Using Geany Geany is a very primitive IDE But is better than command line =) Geany by “default” only compiles and builds a single cpp file – whatever the “active” one is This demo will show you how to use a makefile with Geany – The makefile must be in the same folder as your source code – The executable specified by the makefile must be the same name as the file that has your main() function in it

Class Activity – Geany Makefiles You may want to follow along with the next few slides It will make things easier for you in the future

Class Activity Demo – Open Geany

Class Activity Demo – Geany Open all the files in Geany – HelloMain.cpp HelloFunction.cpp HelloFunction.h – and makefile Reiterating to use makefiles with Geany the executable name in the makefile must be the same as the filename that has main()

Class Activity Demo – Geany Adapt 1 Change the makefile slightly: makefile hello: HelloMain.o HelloFunction.o g++ -o hello HelloMain.o HelloFunction.o HelloMain.o: HelloMain.cpp g++ -c HelloMain.cpp HelloFunction.o: HelloFunction.cpp g++ -c HelloFunction.cpp clean: rm -rf *.o hello Change the hello executable name to be HelloMain Animated GIF

Class Activity Demo – Geany Adapt 1 Change the makefile slightly: makefile HelloMain: HelloMain.o HelloFunction.o g++ -o HelloMain HelloMain.o HelloFunction.o HelloMain.o: HelloMain.cpp g++ -c HelloMain.cpp HelloFunction.o: HelloFunction.cpp g++ -c HelloFunction.cpp clean: rm -rf *.o HelloMain Change the hello executable name to be HelloMain Animated GIF

Class Activity Demo – Geany Now, if you open the file with the main() function in it – In this case HelloMain.cpp You can select the dropdown “make all” option in Geany – to compile and build all the files – as described in the makefile – [ shown on next slides ]

Class Activity Demo – Geany Make All Press this down arrow button to get the drop down menu Be sure the file with your main() function is the “current tab”

Class Activity Demo – Geany Make Success

Class Activity Demo – Geany Run Run the program – Press the ‘gray’ gears button – or on the keyboard press F5 Be sure the.cpp file with main() is still the “current tab” in Geany – In this case HelloMain.cpp

Class Activity Demo – Geany Make Clean After running the program If you make any changes to your files you will need to do a – make clean – before the next make all

Class Activity Demo – Mantra Make Clean then Make All Repeat

Class Activity Demo – Make Clean Geany Select: Make Custom Target Press this down arrow button to get the drop down menu

Class Activity Demo – Make Clean Geany Type: clean and press OK

Class Activity Demo – Make Clean Geany Near the bottom of the screen you should see a message like this (if it succeeds)

Marker Slide Any questions on – makefiles – geany Next up – another presentation file

The End Or is it? – Go to next presentation