I'm just getting started with Unix, C and somebody suggested me to use GNU make too. So I thought of doing that.
One thing I tried to do is to uncompress a .gtz file and compile the C files inside it with few flags on. Here's my code if you don't laugh.
What I'm trying to do here is to uncompress lab.tgz file and compile the C source files inside it.
Obviously, this is not working. I want the assignmentsCode:CC=gcc FLAGS=-l./-O3 -Wall -c all: tar -xzvf lab.tgz cd lab CFILES = $(shell ls /lab | grep .c) OBJS = $(CFILES:%.c=%.o) main : $(OBJS) $(CC) $(FLAGS) $(OBJS) -o main $(OBJS):$(CFILES) $(CC) $(FLAGS) $(OBJS)
to be executed beforeCode:tar -xzvf lab.tgz
But the second one executed earlier and complains that /lab does not exist. I'll be really thankful if somebody help me with this.Code:CFILES = $(shell ls /lab | grep .c)