1 / 17

CS498ps

March 14, 2005 Lecture 9. CS498ps. Taming larger projects. File and resource organization Version control “make”. File and Resource Organization. Source files and headers Object files (.obj) Executables Test environment Deployment environment. Project Directory Structure.

roana
Download Presentation

CS498ps

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. March 14, 2005 Lecture 9 CS498ps

  2. Taming larger projects • File and resource organization • Version control • “make”

  3. File and Resource Organization • Source files and headers • Object files (.obj) • Executables • Test environment • Deployment environment

  4. Project Directory Structure • Project Development • Source files • Headers • .obj • Scripts and makefiles • Deployment • Contains only that which end user would have present • Testing • Data

  5. Version Control • Fixed deficiencies • New features • Changes in implementation

  6. Version Control • CVS • Subversion • Poor man's version control

  7. Poor Man's Version Control • Create subdirectories (folders) within project folder • Copy all pertinent content into directory • Use meaningful name for subdirectory • Write script to allow automatic version • “mversion march14verA”

  8. Makefiles • Reduce unnecessary steps in build • Insure all necessary components are up-to-date • Reduces human error

  9. The “make” utility... • Reads a text file and executes indicated steps. • Allows dependencies so that changes can cascade throughout project. • Reduces unnecessary rebuilds while maintaining integrity of the build. • Is recursive.

  10. Contents of a makefile • Comments • Macros • Dependencies • Shell lines • Directives

  11. Comments • '#' starts a comment line • Everything after the '#' to the end of the line is a comment • # this is an example comment for a makefile

  12. Macros • String replacement in your makefile • COMPILE = cl.exe /nologo /Gs /G5 /Z7 /c /W3 /MLd /D "WIN32" /D "_DEBUG" /D "__MSC__" • LIBRARY = lib

  13. Dependencies • Dependencies allow for conditional building based on a dependence relationship • The correct build of an executable depends on all the components being up-to-date. • You can also rebuild .obj files when headers change. • Warning: you may end up unnecessarily rebuilding which defeats part of the purpose. • hud.obj: hud.c

  14. Shell Lines • Shell lines are the command lines that execute when a dependency is met. • $(COMPILE) hud.c • NOT limited to compile, link, etc.

  15. Directives • Conditionals and flow control • $if, $else, $elif, $endif

  16. Directives and Command Line Macros • Can use command line macro definitions for control • Make “COMPILER=borland” • $if $(COMILER) == borland

  17. A makefile example • ldtt.mak

More Related