some thread API examples

This commit is contained in:
Remzi Arpaci-Dusseau
2019-04-23 12:12:17 -05:00
parent b4fa80ad67
commit 502a67f965
5 changed files with 121 additions and 0 deletions

21
threads-api/Makefile Normal file
View File

@@ -0,0 +1,21 @@
CC := gcc
CFLAGS := -Wall -Werror -I../include
SRCS := thread_create.c \
thread_create_simple_args.c \
thread_create_with_return_args.c
OBJS := ${SRCS:c=o}
PROGS := ${SRCS:.c=}
.PHONY: all
all: ${PROGS}
${PROGS} : % : %.o Makefile
${CC} $< -o $@ -pthread
clean:
rm -f ${PROGS} ${OBJS}
%.o: %.c Makefile
${CC} ${CFLAGS} -c $<