First atomicity bug example from chapter

This commit is contained in:
Remzi Arpaci-Dusseau
2019-05-08 13:25:45 -05:00
parent 70c5ff84fb
commit 8bcb711e08
2 changed files with 85 additions and 0 deletions

25
threads-bugs/Makefile Normal file
View 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 $<