A new template for Lab 5 (Consumer Producer Assignment) based on the old one.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

30 lines
552 B

CC = gcc
GLOBAL_FLAGS = -DUNIX -lpthread
all: build
build:
FLAGS="-O2"
export FLAGS
$(MAKE) _all
debug:
FLAGS="-g"
export FLAGS
$(MAKE) _all
_all: main.o thread.o queue.o
$(CC) $(FLAGS) $(GLOBAL_FLAGS) main.o thread.o queue.o -o ConsumerProducer
rm *.o
main.o: main.c thread.h queue.h
$(CC) $(FLAGS) $(GLOBAL_FLAGS) -c main.c -o main.o
thread.o: thread.c thread.h queue.h
$(CC) $(FLAGS) $(GLOBAL_FLAGS) -c thread.c -o thread.o
queue.o: queue.c queue.h
$(CC) $(FLAGS) $(GLOBAL_FLAGS) -c queue.c -o queue.o
clean:
rm ConsumerProducer