Libraries and Makefiles
Due: 11:00pm, Tuesday, September 5, 2023
Get the Assignment Code
Login to your university Unix account and copy the assignment code to a location under your home directory:
cp -r /export/home/public/schwesin/csc328/assignments/project1 LOCATION
where LOCATION is a directory of your choosing.
Description
The purpose of this assignment is to automate the process of creating static
and dynamic libraries using the make program. The assignment directory
contains the following files:
connectTCP.cconnectUDP.cconnectsock.cerrexit.cpassiveTCP.cpassiveUDP.cpassivesock.cMakefileMakefile-dynamicMakefile-static
You need to edit the Makefile-dynamic and Makefile-static files to create a
dynamic (shared) and static libraries respectively from the provided C source
files. The main target for Makefile-dynamic must be a dynamic library named
sockutils.so.1 and the main target for Makefile-static must be a static
library named sockutils.a. Write the Makefiles such that only the necessary
files are built when any given file changes.
In addition to the main target, each Makefile should have two phony rules named
clean and realclean. The clean rule must remove any temporary object
files and the realclean must remove all build artifacts.
Information about creating libraries can be found in the man pages for the ar
and gcc programs.
Turning in the Assignment
To turn in the assignment, execute the submit script by running the command
make submit
from within the project1 directory.
Grading Criteria
- Correct implementation of the specification