Use pkg-config to link in libelfin.

This commit is contained in:
Charlie Curtsinger 2019-10-15 08:45:13 -05:00
parent 8243f6c801
commit 06fa6d986b
12 changed files with 13 additions and 14 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,6 +1,6 @@
ROOT := ..
TARGETS := libcoz.so
LIBS := dl rt pthread elf++ dwarf++
LIBS := -ldl -lrt -lpthread $(shell pkg-config --libs libelf++ libdwarf++)
CXXFLAGS := --std=c++0x -g -O2 -fPIC -I$(ROOT)/include -I.
include $(ROOT)/common.mk