Skip to content

Commit

Permalink
tools: Fix pthread flag for Makefile of trace-agent used by virtio-trace
Browse files Browse the repository at this point in the history
pthread flag should not be -lpthread but -pthread using gcc. The -lpthread
links the external multithread library. On the other hand, the -pthread manages
both the gcc's preprocessor and linker to be able to compile with pthread.

Signed-off-by: Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
Yoshihiro YUNOMAE authored and Rusty Russell committed Sep 28, 2012
1 parent 108fc82 commit 5b8fa82
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tools/virtio/virtio-trace/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
CC = gcc
CFLAGS = -O2 -Wall
LFLAG = -lpthread
CFLAGS = -O2 -Wall -pthread

all: trace-agent

.c.o:
$(CC) $(CFLAGS) $(LFLAG) -c $^ -o $@
$(CC) $(CFLAGS) -c $^ -o $@

trace-agent: trace-agent.o trace-agent-ctl.o trace-agent-rw.o
$(CC) $(CFLAGS) $(LFLAG) -o $@ $^
$(CC) $(CFLAGS) -o $@ $^

clean:
rm -f *.o trace-agent

0 comments on commit 5b8fa82

Please sign in to comment.