Merge pull request #140 from plasma-umass/libelfin-pkg-config

Use pkg-config to link in libelfin
This commit is contained in:
Charlie Curtsinger 2019-10-15 09:52:41 -04:00 committed by GitHub
commit 3c68685e8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 15 additions and 15 deletions

View File

@ -1,6 +1,6 @@
ROOT := ../..
TARGETS := histogram
LIBS := pthread
LIBS := -lpthread
CFLAGS := -g -O2
include $(ROOT)/benchmark.mk

View File

@ -1,6 +1,6 @@
ROOT := ../..
TARGETS := kmeans
LIBS := pthread
LIBS := -lpthread
CFLAGS := -g -O2
include $(ROOT)/benchmark.mk

View File

@ -1,6 +1,6 @@
ROOT := ../..
TARGETS := linear_regression
LIBS := pthread
LIBS := -lpthread
CFLAGS := -g -O2
include $(ROOT)/benchmark.mk

View File

@ -1,6 +1,6 @@
ROOT := ../..
TARGETS := matrix_multiply
LIBS := pthread
LIBS := -lpthread
CFLAGS := -g -O2 -Wno-format
include $(ROOT)/benchmark.mk

View File

@ -1,6 +1,6 @@
ROOT := ../..
TARGETS := pbzip2
LIBS := bz2 pthread
LIBS := -lbz2 -lpthread
CXXFLAGS := -g -O2 -Wno-format -Ibzip2-1.0.6
LDFLAGS := -Lbzip2-1.0.6

View File

@ -1,6 +1,6 @@
ROOT := ../..
TARGETS := pca
LIBS := pthread
LIBS := -lpthread
CFLAGS := -g -O2
include $(ROOT)/benchmark.mk

View File

@ -1,6 +1,6 @@
ROOT := ../..
TARGETS := producer_consumer
LIBS := pthread
LIBS := -lpthread
CXXFLAGS := -g -O2
include $(ROOT)/benchmark.mk

View File

@ -1,6 +1,6 @@
ROOT := ../..
TARGETS := string_match
LIBS := pthread
LIBS := -lpthread
CFLAGS := -g -O2
include $(ROOT)/benchmark.mk

View File

@ -1,6 +1,6 @@
ROOT := ../..
TARGETS := toy
LIBS := pthread
LIBS := -lpthread
CXXFLAGS := --std=c++11 -g -O2
include $(ROOT)/benchmark.mk

View File

@ -1,6 +1,6 @@
ROOT := ../..
TARGETS := word_count
LIBS := pthread
LIBS := -lpthread
CFLAGS := -g -O2
include $(ROOT)/benchmark.mk

View File

@ -23,7 +23,6 @@ endif
# Default flags
CFLAGS ?= -g -O2
CXXFLAGS ?= $(CFLAGS)
LDLIBS += $(addprefix -l,$(LIBS))
# Default source and object files
SRCS ?= $(wildcard *.cpp) $(wildcard *.c)
@ -79,7 +78,7 @@ obj/%.o: %.c $(PREREQS)
# Link a shared library
$(SHARED_LIB_TARGETS): $(OBJS)
@echo $(LOG_PREFIX) Linking $@ $(LOG_SUFFIX)
@$(CXX) -shared $(LDFLAGS) -o $@ $^ $(LDLIBS)
@$(CXX) -shared $(LDFLAGS) -o $@ $^ $(LIBS)
$(STATIC_LIB_TARGETS): $(OBJS)
@echo $(LOG_PREFIX) Linking $@ $(LOG_SUFFIX)
@ -88,7 +87,7 @@ $(STATIC_LIB_TARGETS): $(OBJS)
# Link binary targets
$(OTHER_TARGETS): $(OBJS)
@echo $(LOG_PREFIX) Linking $@ $(LOG_SUFFIX)
@$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
@$(CXX) $(LDFLAGS) -o $@ $^ $(LIBS)
# Include dependency rules for all objects
-include $(OBJS:.o=.d)

View File

@ -1,7 +1,8 @@
ROOT := ..
TARGETS := libcoz.so
LIBS := dl rt pthread elf++ dwarf++
CXXFLAGS := --std=c++0x -g -O2 -fPIC -I$(ROOT)/include -I.
LIBS := -ldl -lrt -lpthread $(shell pkg-config --libs libelf++ libdwarf++)
CXXFLAGS := --std=c++0x -g -O2 -fPIC -I$(ROOT)/include -I. \
$(shell pkg-config --cflags libelf++ libdwarf++)
include $(ROOT)/common.mk