# the shared memory example from OSC 9e Sec. 3.5.1, Fig. 3.17, 3.18

CC = gcc
# compiler options -- C99 with warnings
OPT_GCC = -std=c99 -Wall -Wextra
OPT = -D_XOPEN_SOURCE=700

LIB = -lrt

all: cons prod

cons: shm-posix-consumer.c
	$(CC) $(OPT_GCC) $(OPT) -o cons shm-posix-consumer.c $(LIB)

prod: shm-posix-producer.c
	$(CC) $(OPT_GCC) $(OPT) -o prod shm-posix-producer.c $(LIB)

run: cons prod
	./prod
	./cons

clean:
	rm -f cons prod

