From 7cc06a24435ee07c0c934d34b2182e173a20a54e Mon Sep 17 00:00:00 2001 From: JasonButler Date: Mon, 27 Feb 2017 14:24:36 -0500 Subject: [PATCH] changes to Makefiles to build with math library --- getpid/Makefile | 3 ++- matrix/Makefile | 3 ++- moreExamples/Makefile | 3 ++- rdtscbench/Makefile | 5 +++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/getpid/Makefile b/getpid/Makefile index 7f9b2d9..4a9367e 100644 --- a/getpid/Makefile +++ b/getpid/Makefile @@ -1,6 +1,7 @@ NAME = getpid SRCDIR = ../rdtscbench CFLAGS = -lrt -lm +LDFLAGS=-lm OBJ = $(SRCDIR)/rdtscbench.o $(NAME).o @@ -9,7 +10,7 @@ all: $(MAKE) -C . $(NAME) $(NAME): $(OBJ) - $(CC) $(CFLAGS) -o $(NAME) $(OBJ) + $(CC) $(CFLAGS) -o $(NAME) $(OBJ) $(LDFLAGS) $(SRCDIR)/rdtscbench.o: $(SRCDIR)/rdtscbench.h $(SRCDIR)/rdtscbench.c diff --git a/matrix/Makefile b/matrix/Makefile index e05fd71..0a72c35 100644 --- a/matrix/Makefile +++ b/matrix/Makefile @@ -1,6 +1,7 @@ NAME = matrix SRCDIR = ../rdtscbench CFLAGS = -lrt -lm +LDFLAGS = -lm OBJ = $(SRCDIR)/rdtscbench.o $(NAME).o @@ -9,7 +10,7 @@ all: $(MAKE) -C . $(NAME) $(NAME): $(OBJ) - $(CC) $(CFLAGS) -o $(NAME) $(OBJ) + $(CC) $(CFLAGS) -o $(NAME) $(OBJ) $(LDFLAGS) $(SRCDIR)/rdtscbench.o: $(SRCDIR)/rdtscbench.h $(SRCDIR)/rdtscbench.c diff --git a/moreExamples/Makefile b/moreExamples/Makefile index 4b431bc..16682f9 100644 --- a/moreExamples/Makefile +++ b/moreExamples/Makefile @@ -1,6 +1,7 @@ NAME = moreExamples SRCDIR = ../rdtscbench CFLAGS = -lrt -lm +LDFLAGS = -lm OBJ = $(SRCDIR)/rdtscbench.o $(NAME).o @@ -9,7 +10,7 @@ all: $(MAKE) -C . $(NAME) $(NAME): $(OBJ) - $(CC) $(CFLAGS) -o $(NAME) $(OBJ) + $(CC) $(CFLAGS) -o $(NAME) $(OBJ) $(LDFLAGS) $(SRCDIR)/rdtscbench.o: $(SRCDIR)/rdtscbench.h $(SRCDIR)/rdtscbench.c diff --git a/rdtscbench/Makefile b/rdtscbench/Makefile index 4262536..eb3af63 100644 --- a/rdtscbench/Makefile +++ b/rdtscbench/Makefile @@ -1,11 +1,12 @@ -CFLAGS = -lrt -lm +CFLAGS = -lrt -lm +LDFLAGS = -lm all: gethz rdtscbench.o gethz: ./gethz.sh -rdtscbench.o: rdtscbench.h rdtscbench.c +rdtscbench.o: rdtscbench.h rdtscbench.c $(LDFLAGS) clean: rm -f *~