Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1.In your ubuntu, open course website (https://github.com/syracuse-fullstacksecu

ID: 3807608 • Letter: 1

Question

1.In your ubuntu, open course website (https://github.com/syracuse-fullstacksecurity/cis342) (e.g. using Firefox) and hit the green "Clone or download" button to download all the files into a .zip file. Extract the zip file and use the following command to compile `h2.c` as a library: `gcc -c h2.c -o liby.a`. Edit the file named "makefile" and add a new rule about the command. You may use `compilelib` as its label. And then type "make compilelib" to compile `h2.c` as a library. Submit the screenshot.

Attach File

2.We can compile `h1.c` and link it to the library we just created using command `gcc -o a.out h1.c -L. -ly`. Add this command to the makefile with a new rule named `liblink`. What argument do you provide to "make" so that it can link the library liby. Provide a screenshot of making the program.

Explanation / Answer

SRCS = h1.c h2.c
OBJS = $(SRCS:.c=.o)
OBJS = h1.o h2.o
CC = gcc

all: link
   ./a.out

link: $(OBJS)
   $(CC) $(OBJS)

liblink: compilelib
gcc -o a.out h1.c -L. -ly

compilelib:
gcc -c h2.c -o liby.a

clean:
   rm *.o *.out *.a

make liblink

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at drjack9650@gmail.com
Chat Now And Get Quote