# the shared memory example # this must use GNU Make ("make" on Linux and Mac OS X, "gmake" on Solaris) # compiler options -- C99 with warnings OPT_GCC = -std=c99 -Wall -Wextra # compiler options and libraries for Linux, Mac OS X or Solaris #ifeq ($(OSTYPE),linux-gnu) # default linux-gnu // Agustin OPT = -D_XOPEN_SOURCE=700 LIB = -lrt -lpthread #endif ifeq ($(OSTYPE),darwin) # Mac OS X OPT = LIB = endif ifeq ($(OSTYPE),solaris) OPT = -D_XOPEN_SOURCE=600 LIB = -lrt -lpthread endif all: cons prod cons: consumer.c gcc $(OPT_GCC) $(OPT) -o cons consumer.c $(LIB) prod: producer.c gcc $(OPT_GCC) $(OPT) -o prod producer.c $(LIB) clean: rm -f *.o cons prod