Skip to content
Permalink
Browse files

Use pkg-config to link in libelfin.

  • Loading branch information...
ccurtsinger committed Oct 15, 2019
1 parent 8243f6c commit 06fa6d986b0bef7c09f2ebafb43a9ebb0fbeaf4a
@@ -1,6 +1,6 @@
ROOT := ../..
TARGETS := histogram
LIBS := pthread
LIBS := -lpthread
CFLAGS := -g -O2

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

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

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

include $(ROOT)/benchmark.mk
@@ -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

@@ -1,6 +1,6 @@
ROOT := ../..
TARGETS := pca
LIBS := pthread
LIBS := -lpthread
CFLAGS := -g -O2

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

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

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

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

include $(ROOT)/benchmark.mk
@@ -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)
@@ -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

0 comments on commit 06fa6d9

Please sign in to comment.
You can’t perform that action at this time.