First atomicity bug example from chapter
This commit is contained in:
25
threads-bugs/Makefile
Normal file
25
threads-bugs/Makefile
Normal file
@@ -0,0 +1,25 @@
|
||||
CC := gcc
|
||||
CFLAGS := -Wall -Werror -I../include -pthread
|
||||
|
||||
OS := $(shell uname -s)
|
||||
LIBS :=
|
||||
ifeq ($(OS),Linux)
|
||||
LIBS += -pthread
|
||||
endif
|
||||
|
||||
SRCS := atomicity.c
|
||||
|
||||
OBJS := ${SRCS:c=o}
|
||||
PROGS := ${SRCS:.c=}
|
||||
|
||||
.PHONY: all
|
||||
all: ${PROGS}
|
||||
|
||||
${PROGS} : % : %.o Makefile
|
||||
${CC} $< -o $@ ${LIBS}
|
||||
|
||||
clean:
|
||||
rm -f ${PROGS} ${OBJS}
|
||||
|
||||
%.o: %.c Makefile
|
||||
${CC} ${CFLAGS} -c $<
|
||||
Reference in New Issue
Block a user