COP3353 - 2013 Spring
Assignment 3 "Porting a Makefile"
Due by 5:00pm Tuesday, July 30
Late assignments (50% grade penalty) can be turned in until August 2

Porting a Makefile

Your assignment is to "port" a Makefile from a Debian-based machine to a RedHat-based one.

Start by downloading the following Makefile to one of the linprog machines Assign03.tar (hint: wget is ideal for this kind of retrieval), and unpack it.

Try a make clean && make with the initial Makefile. You should see several error messages of the ilk (i.e., similar but not necessarily the same exact error messages):

[user@linprog1 Assign03]$ make clean && make && ./hello rm hello.o hello.s gcc -S -DUSERNAME='"Sam Smith"' hello.c as -o hello.o hello.s ld -o hello -dynamic-linker /lib/ /usr/lib/x86_64-linux-gnu/crti.o /usr/lib/x86_64-linux-gnu/crt1.o /usr/lib/x86_64-linux-gnu/crtn.o hello.o -lc ld: /usr/lib/x86_64-linux-gnu/crti.o: No such file: No such file or directory make: *** [hello] Error 1

[ To repeat: please note that you should see errors with the initial Makefile, but not necessarily the ones in the example above. Your task is to fix what problems you find in porting this Makefile, and certainly not to replicate the above errors. Look at it this way: when I test your Makefile, I am looking for "correct output", not "correct errors". ]

These are four requirements for this port:

  1. Find the correct locations in the linprog machines' filesystems to fix the ld "No such file" problem, and change the Makefile accordingly.
  2. Change "Sam Smith" to your own name.
  3. Modify the clean target so that the rm is done silently rather than verbosely.
  4. Make sure that your specified shared library location is correct (if it isn't, you will see an error like ./hello: Accessing a corrupted shared library when you run ./hello).

Please verify your changes: when you do make clean && make && ./hello, you should see something like:

make clean && make && ./hello gcc -S -DUSERNAME='"Randolph Langley"' hello.c as -o hello.o hello.s ld -o hello -dynamic-linker /lib64/ /usr/lib/x86_64-linux/crti.o /usr/lib/x86_64-linux/crt1.o /usr/lib/x86_64-linux/crtn.o hello.o -lc Hello, this is from 'Randolph Langley'

Two things to note from above: despite the fact that we did a make clean again, we don't see any output from rm as per requirement 3; second, your library paths in the link line will not be the same since these paths do not work on the linprog machines, as per requirement 1.

Once you have done that and verified as above, please email me your new Makefile as an attachment (not inline). Please send your email to "".

I will accept one submission (your first one), so please make sure that you are sending me your final copy.