CSCI 2122 - Systems Programming - lab5 Makefiles and Lists


  • 作业标题:CSCI 2122 - Systems Programming - lab5 Makefiles and Lists
  • 课程名称:Dalhouse University CSCI 2122 Systems Programming
  • 完成周期:1天

1. Introduction

This lab is designed to introduce you to makefiles, array lists, and linked lists. By the end of this lab, you will be expected to understand those concepts.

In this lab you are expected to perform the basics of cloning your Lab 5 repository from the GitLab course group. A link to the course group can be found here and your repository can be found in the Lab5 subgroup. See the Lab Technical Document for more information on using git. You will notice that your repository has a file in the Lab5 directory named delete this file. Due to the limitations of GitLab, we are not able to push completely empty directories. Before your push your work to your repository (which should be in the Lab5 directory anyway), make sure to first use the git rm command to remove the extra file. If you do not, your pipeline will fail.

2. Makefiles

Are you sick of typing out really long gcc commands to compile your code? Do you press the up arrow a dozen times to find your last gcc command, so you can run it again? If this sounds like you, then have I got a deal for you! It’s called the make utility and you and your family are going to love it!

2.1. The make Utility

The make utility is a Unix command which is capable of managing your files during the compilation process. It can be used with any programming language whose compiler can be run with a shell command, including C.

When executed, make automatically searches the directory it’s contained in for a file named Makefile. A makefile lets you organize a series of compilation commands into a series of conditions and requirements. By describing the relationships among files in a program, and defining the requirements for keeping your various compiled code files up-to-date, make can run through your source files from the top down in order to guarantee all of your code compiles properly, with the shortest path to success possible.

The make utility only updates compiled code which needs updating. If no changes have been made to the source code, make won’t attempt to compile that file again. This can drastically reduce compilation times and help alleviate excessive use of computing resources, especially in large projects.

。。。

3. Lab 5 Function Contracts

In this lab you will be responsible for fulfilling two lab contracts: the Array List contract and the Linked List
contract. Each contract is designed to test you on some of the things you’ve learned throughout the instruction portion of this lab.

All contracts must be completed exactly as the requirements are laid out. Be very careful to thoroughly read the contract instructions before proceeding. This does not, however, preclude you from writing more functions than you are asked for. You may write as many additional functions as you wish in your C source files.

All contracts are designed to be submitted without a main function, but that does not mean you cannot write a main function in order to test your code yourself. It may be more convenient for you to write a C source file with a main function by itself and take advantage of the compiler’s ability to link files together by accepting multiple source files as inputs. When you push your code to Gitlab, you don’t need to git add any of your extra main function source files.

The programs you write for this lab will not be compiled with any additional libraries, as they should not be required. For those of you who are concerned, when deciding which naming conventions you want to use in your code, favour consistency in style, not dedication to a style that doesn’t work.

The contracts in this document are worth the following points values, for a total of 10.

4. Submission

4.1. Required Files

When submitting this lab, you must submit your C source and header files only. Each file must be contained in the directory listed in the structure requirement diagram below. These files include:

  1. array list.c
  2. array list.h
  3. linked list.c
  4. linked list.h
  5. Makefile (for array list)
  6. Makefile (for linked list)

As with all labs, submitting anything other than what is required in this section will yield a mark of 0.

。。。


文章作者: IT神助攻
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 IT神助攻 !
  目录