mirror of
https://github.com/plasma-umass/coz.git
synced 2024-10-26 07:39:17 +03:00
goodbye make
This commit is contained in:
parent
31d1e03909
commit
2f16a5973b
12
.gitignore
vendored
12
.gitignore
vendored
@ -1,23 +1,13 @@
|
||||
.sconsign.dblite
|
||||
deps
|
||||
|
||||
debug
|
||||
release
|
||||
|
||||
benchmarks/*/debug
|
||||
benchmarks/*/release
|
||||
benchmarks/*/profile.log
|
||||
benchmarks/*/profile.csv
|
||||
benchmarks/*/profile.lines
|
||||
benchmarks/*/Rplots.pdf
|
||||
lib/*/debug
|
||||
lib/*/release
|
||||
tests/*/debug
|
||||
tests/*/release
|
||||
tests/*/profile.log
|
||||
tests/*/results.csv
|
||||
tests/*/Rplots.pdf
|
||||
tools/*/debug
|
||||
tools/*/release
|
||||
|
||||
tests/toy/results
|
||||
tests/toy/toy_clean
|
||||
|
10
Makefile
10
Makefile
@ -1,10 +0,0 @@
|
||||
ROOT = .
|
||||
DIRS = lib tools benchmarks tests
|
||||
|
||||
include $(ROOT)/common.mk
|
||||
|
||||
bench: debug
|
||||
@$(MAKE) -C benchmarks bench
|
||||
|
||||
test: debug
|
||||
@$(MAKE) -C tests test
|
21
SConstruct
Normal file
21
SConstruct
Normal file
@ -0,0 +1,21 @@
|
||||
# Set up the default build environment
|
||||
env = Environment()
|
||||
Export('env')
|
||||
|
||||
env.Replace(CXX='clang++')
|
||||
|
||||
# Set C++11 mode, generate position-independent code
|
||||
env.Append(CCFLAGS='--std=c++11 -fPIC')
|
||||
|
||||
# Add include paths
|
||||
env.Append(CPPPATH=['include',
|
||||
'#/deps/libelfin/dwarf',
|
||||
'#/deps/libelfin/elf',
|
||||
'#/deps/cppgoodies/include'])
|
||||
|
||||
# Add lib paths
|
||||
env.Append(LIBPATH=['#/deps/libelfin/dwarf',
|
||||
'#/deps/libelfin/elf'])
|
||||
|
||||
# Invoke scons in all building subdirectories
|
||||
targets = env.SConscript(dirs=['lib', 'tools'])
|
@ -1,6 +0,0 @@
|
||||
ROOT = ..
|
||||
DIRS = histogram kmeans linear_regression matrix_multiply \
|
||||
pbzip2 pca producer_consumer string_match word_count
|
||||
RECURSIVE_TARGETS = debug test bench
|
||||
|
||||
include $(ROOT)/common.mk
|
@ -1,20 +0,0 @@
|
||||
ROOT = ../..
|
||||
TARGET = histogram
|
||||
LIBS = pthread dl
|
||||
ARGS = histogram_datafiles/large.bmp
|
||||
TEST_ARGS = histogram_datafiles/small.bmp
|
||||
|
||||
include $(ROOT)/common.mk
|
||||
|
||||
setup: histogram_datafiles/small.bmp
|
||||
|
||||
histogram_datafiles/%:
|
||||
wget http://mapreduce.stanford.edu/datafiles/histogram.tar.gz
|
||||
tar xvzf histogram.tar.gz
|
||||
rm histogram.tar.gz
|
||||
|
||||
bench:: debug/bin/histogram setup
|
||||
$(ROOT)/release/bin/causal --- debug/bin/histogram $(ARGS)
|
||||
|
||||
test:: debug/bin/histogram setup
|
||||
$(ROOT)/debug/bin/causal --- debug/bin/histogram $(TEST_ARGS)
|
@ -1,13 +0,0 @@
|
||||
ROOT = ../..
|
||||
TARGET = kmeans
|
||||
LIBS = pthread dl
|
||||
ARGS = -d 3 -c 100 -p 100000 -s 1000
|
||||
TEST_ARGS = -d 3 -c 100 -p 10000 -s 100
|
||||
|
||||
include $(ROOT)/common.mk
|
||||
|
||||
bench:: debug/bin/kmeans
|
||||
$(ROOT)/release/bin/causal --- debug/bin/kmeans $(ARGS)
|
||||
|
||||
test:: debug/bin/kmeans
|
||||
$(ROOT)/debug/bin/causal --- debug/bin/kmeans $(TEST_ARGS)
|
@ -1,20 +0,0 @@
|
||||
ROOT = ../..
|
||||
TARGET = linear_regression
|
||||
LIBS = pthread dl
|
||||
ARGS = linear_regression_datafiles/key_file_500MB.txt
|
||||
TEST_ARGS = linear_regression_datafiles/key_file_50MB.txt
|
||||
|
||||
include $(ROOT)/common.mk
|
||||
|
||||
setup: linear_regression_datafiles/key_file_50MB.txt
|
||||
|
||||
linear_regression_datafiles/%:
|
||||
wget http://mapreduce.stanford.edu/datafiles/linear_regression.tar.gz
|
||||
tar xvzf linear_regression.tar.gz
|
||||
rm linear_regression.tar.gz
|
||||
|
||||
bench:: debug/bin/linear_regression setup
|
||||
$(ROOT)/release/bin/causal --- debug/bin/linear_regression $(ARGS)
|
||||
|
||||
test:: debug/bin/linear_regression setup
|
||||
$(ROOT)/debug/bin/causal --- debug/bin/linear_regression $(TEST_ARGS)
|
@ -1,19 +0,0 @@
|
||||
ROOT = ../..
|
||||
TARGET = matrix_multiply
|
||||
LIBS = pthread dl
|
||||
MATRIX_SIZE = 1000
|
||||
TEST_MATRIX_SIZE = 400
|
||||
|
||||
include $(ROOT)/common.mk
|
||||
|
||||
bench:: debug/bin/matrix_multiply
|
||||
@rm -f matrix_file_A.txt matrix_file_B.txt
|
||||
@echo $(INDENT)[bench] Generating matrix input
|
||||
@debug/bin/matrix_multiply $(MATRIX_SIZE) $(MATRIX_SIZE) > /dev/null
|
||||
$(ROOT)/release/bin/causal --- debug/bin/matrix_multiply $(MATRIX_SIZE) > /dev/null
|
||||
|
||||
test:: debug/bin/matrix_multiply
|
||||
@rm -f matrix_file_A.txt matrix_file_B.txt
|
||||
@echo $(INDENT)[test] Generating matrix input
|
||||
@debug/bin/matrix_multiply $(TEST_MATRIX_SIZE) $(TEST_MATRIX_SIZE) > /dev/null
|
||||
$(ROOT)/debug/bin/causal --- debug/bin/matrix_multiply $(TEST_MATRIX_SIZE) > /dev/null
|
@ -1,45 +0,0 @@
|
||||
ROOT = ../..
|
||||
TARGET = pbzip2
|
||||
LIBS = pthread dl
|
||||
ARGS = -c < data/input.txt > data/output.txt
|
||||
TEST_ARGS = -c < data/input.txt > data/output.txt
|
||||
|
||||
all:: debug release
|
||||
|
||||
clean::
|
||||
rm -rf bzip2-1.0.6
|
||||
|
||||
debug/bin/pbzip2:: debug/lib/libbz2.a
|
||||
release/bin/pbzip2:: release/lib/libbz2.a
|
||||
|
||||
debug/lib/libbz2.a: bzip2-1.0.6
|
||||
cd bzip2-1.0.6; make CFLAGS=-g
|
||||
mkdir -p debug/lib
|
||||
cp bzip2-1.0.6/libbz2.a debug/lib/
|
||||
|
||||
release/lib/libbz2.a: bzip2-1.0.6
|
||||
cd bzip2-1.0.6; make CFLAGS=-g
|
||||
mkdir -p release/lib
|
||||
cp bzip2-1.0.6/libbz2.a release/lib/
|
||||
|
||||
bzip2-1.0.6:
|
||||
wget http://bzip.org/1.0.6/bzip2-1.0.6.tar.gz
|
||||
tar xvzf bzip2-1.0.6.tar.gz
|
||||
rm bzip2-1.0.6.tar.gz
|
||||
|
||||
include $(ROOT)/common.mk
|
||||
|
||||
OBJS += lib/libbz2.a
|
||||
|
||||
setup: data/input.txt
|
||||
|
||||
data/input.txt:
|
||||
@$(MAKE) -C ../linear_regression setup
|
||||
mkdir -p data
|
||||
cp ../linear_regression/linear_regression_datafiles/key_file_500MB.txt data/input.txt
|
||||
|
||||
bench:: debug/bin/pbzip2 setup
|
||||
$(ROOT)/release/bin/causal --- debug/bin/pbzip2 $(ARGS)
|
||||
|
||||
test:: debug/bin/pbzip2 setup
|
||||
$(ROOT)/debug/bin/causal --- debug/bin/pbzip2 $(TEST_ARGS)
|
@ -1,13 +0,0 @@
|
||||
ROOT = ../..
|
||||
TARGET = pca
|
||||
LIBS = pthread dl
|
||||
ARGS = > /dev/null
|
||||
TEST_ARGS = > /dev/null
|
||||
|
||||
include $(ROOT)/common.mk
|
||||
|
||||
bench:: debug/bin/pca
|
||||
$(ROOT)/release/bin/causal --- debug/bin/pca $(ARGS)
|
||||
|
||||
test:: debug/bin/pca
|
||||
$(ROOT)/debug/bin/causal --- debug/bin/pca $(TEST_ARGS)
|
@ -1,16 +0,0 @@
|
||||
ROOT = ../..
|
||||
TARGET = producer_consumer
|
||||
LIBS = pthread dl
|
||||
ARGS =
|
||||
TEST_ARGS =
|
||||
|
||||
include $(ROOT)/common.mk
|
||||
|
||||
CFLAGS += -O3
|
||||
CXXFLAGS += -O3
|
||||
|
||||
bench:: debug/bin/producer_consumer
|
||||
$(ROOT)/release/bin/causal --- debug/bin/producer_consumer $(ARGS)
|
||||
|
||||
test:: debug/bin/producer_consumer
|
||||
$(ROOT)/debug/bin/causal --- debug/bin/producer_consumer $(TEST_ARGS)
|
@ -1,20 +0,0 @@
|
||||
ROOT = ../..
|
||||
TARGET = string_match
|
||||
LIBS = pthread dl
|
||||
ARGS = string_match_datafiles/key_file_500MB.txt > /dev/null
|
||||
TEST_ARGS = string_match_datafiles/key_file_50MB.txt > /dev/null
|
||||
|
||||
include $(ROOT)/common.mk
|
||||
|
||||
setup: string_match_datafiles/key_file_50MB.txt
|
||||
|
||||
string_match_datafiles/%:
|
||||
wget http://mapreduce.stanford.edu/datafiles/string_match.tar.gz
|
||||
tar xvzf string_match.tar.gz
|
||||
rm string_match.tar.gz
|
||||
|
||||
bench:: debug/bin/string_match setup
|
||||
$(ROOT)/release/bin/causal --- debug/bin/string_match $(ARGS)
|
||||
|
||||
test:: debug/bin/string_match setup
|
||||
$(ROOT)/debug/bin/causal --- debug/bin/string_match $(TEST_ARGS)
|
@ -1,20 +0,0 @@
|
||||
ROOT = ../..
|
||||
TARGET = word_count
|
||||
LIBS = pthread dl
|
||||
ARGS = word_count_datafiles/word_100MB.txt
|
||||
TEST_ARGS = word_count_datafiles/word_10MB.txt
|
||||
|
||||
include $(ROOT)/common.mk
|
||||
|
||||
setup: word_count_datafiles/word_100MB.txt
|
||||
|
||||
word_count_datafiles/%:
|
||||
wget http://mapreduce.stanford.edu/datafiles/word_count.tar.gz
|
||||
tar xvzf word_count.tar.gz
|
||||
rm word_count.tar.gz
|
||||
|
||||
bench:: debug/bin/word_count setup
|
||||
$(ROOT)/release/bin/causal --- debug/bin/word_count $(ARGS)
|
||||
|
||||
test:: debug/bin/word_count setup
|
||||
$(ROOT)/debug/bin/causal --- debug/bin/word_count $(TEST_ARGS)
|
210
common.mk
210
common.mk
@ -1,210 +0,0 @@
|
||||
# Set the default compilers and flags
|
||||
CC = clang
|
||||
CXX = clang++
|
||||
CFLAGS ?=
|
||||
CXXFLAGS ?= $(CFLAGS)
|
||||
CXXLIB = $(CXX) -shared -fPIC
|
||||
LINKFLAGS ?= -L$(ROOT)/deps/libelfin/dwarf -L$(ROOT)/deps/libelfin/elf
|
||||
|
||||
DEBUG_CFLAGS ?= -g
|
||||
DEBUG_CXXFLAGS ?= $(DEBUG_CFLAGS)
|
||||
DEBUG_LINKFLAGS ?= -g -L$(ROOT)/debug/lib
|
||||
|
||||
RELEASE_CFLAGS ?= -DNDEBUG -O3
|
||||
RELEASE_CXXFLAGS ?= $(RELEASE_CFLAGS)
|
||||
RELEASE_LINKFLAGS ?= -L$(ROOT)/release/lib
|
||||
|
||||
INSTALL ?=
|
||||
|
||||
ifneq ($(INSTALL),)
|
||||
INSTALL_DIR = $(ROOT)
|
||||
else
|
||||
INSTALL_DIR = .
|
||||
endif
|
||||
|
||||
# Don't build into subdirectories by default
|
||||
DIRS ?=
|
||||
|
||||
# Don't require any libraries by default
|
||||
LIBS ?=
|
||||
|
||||
# Set the default include directories
|
||||
INCLUDE_DIRS += $(ROOT)/include
|
||||
|
||||
# Recurse into subdirectories for the 'clean' and 'build' targets
|
||||
RECURSIVE_TARGETS ?= clean debug release
|
||||
|
||||
# Build by default
|
||||
all:: debug release
|
||||
|
||||
.PHONY: all debug release clean
|
||||
|
||||
# Set the default source and include files with wildcards
|
||||
SRCS ?= $(wildcard *.c) $(wildcard *.cpp) $(wildcard *.cc) $(wildcard *.C)
|
||||
OBJS ?= $(addprefix obj/, $(patsubst %.c, %.o, $(patsubst %.cpp, %.o, $(patsubst %.cc, %.o, $(patsubst %.C, %.o, $(SRCS))))))
|
||||
INCLUDES ?= $(wildcard *.h)\
|
||||
$(wildcard *.hpp)\
|
||||
$(wildcard *.hh)\
|
||||
$(wildcard *.H)\
|
||||
$(wildcard include/*.h)\
|
||||
$(wildcard include/*.hpp)\
|
||||
$(wildcard include/*.hh)\
|
||||
$(wildcard include/*.H)\
|
||||
$(wildcard $(addsuffix /*.h, $(INCLUDE_DIRS)))\
|
||||
$(wildcard $(addsuffix /*.hpp, $(INCLUDE_DIRS)))\
|
||||
$(wildcard $(addsuffix /*.hh, $(INCLUDE_DIRS)))\
|
||||
$(wildcard $(addsuffix /*.H, $(INCLUDE_DIRS)))
|
||||
|
||||
# Clean up all byproducts
|
||||
clean::
|
||||
@rm -rf debug release
|
||||
|
||||
INDENT +=" "
|
||||
export INDENT
|
||||
|
||||
# Generate flags to link required libraries and get includes
|
||||
LIBFLAGS = $(addprefix -l, $(LIBS))
|
||||
INCFLAGS = -Iinclude $(addprefix -I, $(INCLUDE_DIRS))
|
||||
|
||||
# Create separate object lists for debug/release
|
||||
DEBUG_OBJS = $(addprefix debug/, $(OBJS))
|
||||
RELEASE_OBJS = $(addprefix release/, $(OBJS))
|
||||
|
||||
# Separate target names by type
|
||||
SHLIB_TARGET = $(filter %.so, $(TARGET))
|
||||
LIB_TARGET = $(filter %.a, $(TARGET))
|
||||
BIN_TARGET = $(filter-out %.so, $(filter-out %.a, $(TARGET)))
|
||||
|
||||
# Add the local debug path prefix to each target type
|
||||
DEBUG_SHLIB_TARGET = $(addprefix debug/lib/, $(SHLIB_TARGET))
|
||||
DEBUG_LIB_TARGET = $(addprefix debug/lib/, $(LIB_TARGET))
|
||||
DEBUG_BIN_TARGET = $(addprefix debug/bin/, $(BIN_TARGET))
|
||||
DEBUG_TARGET = $(DEBUG_SHLIB_TARGET) $(DEBUG_LIB_TARGET) $(DEBUG_BIN_TARGET)
|
||||
|
||||
# Add the local release path prefix to each target type
|
||||
RELEASE_SHLIB_TARGET = $(addprefix release/lib/, $(SHLIB_TARGET))
|
||||
RELEASE_LIB_TARGET = $(addprefix release/lib/, $(LIB_TARGET))
|
||||
RELEASE_BIN_TARGET = $(addprefix release/bin/, $(BIN_TARGET))
|
||||
RELEASE_TARGET = $(RELEASE_SHLIB_TARGET) $(RELEASE_LIB_TARGET) $(RELEASE_BIN_TARGET)
|
||||
|
||||
debug:: $(addprefix $(INSTALL_DIR)/, $(DEBUG_TARGET))
|
||||
|
||||
release:: $(addprefix $(INSTALL_DIR)/, $(RELEASE_TARGET))
|
||||
|
||||
ifneq ($(INSTALL),)
|
||||
|
||||
# Copy debug files to the root debug directory
|
||||
$(addprefix $(INSTALL_DIR)/, $(DEBUG_TARGET)):: $(DEBUG_TARGET)
|
||||
@echo $(INDENT)[make] Copying `basename $@` to `dirname $@`
|
||||
@mkdir -p `dirname $@`
|
||||
@cp $< $@
|
||||
|
||||
# Copy release files to the root release directory
|
||||
$(addprefix $(INSTALL_DIR)/, $(RELEASE_TARGET)):: $(RELEASE_TARGET)
|
||||
@echo $(INDENT)[make] Copying `basename $@` to `dirname $@`
|
||||
@mkdir -p `dirname $@`
|
||||
@cp $< $@
|
||||
|
||||
endif
|
||||
|
||||
# Compilation rules for debug
|
||||
|
||||
debug/obj/%.o:: %.c Makefile $(ROOT)/common.mk $(INCLUDE_DIRS) $(INCLUDES)
|
||||
@mkdir -p debug/obj
|
||||
@echo $(INDENT)[$(notdir $(firstword $(CC)))] Compiling $< for debug build
|
||||
@$(CC) $(CFLAGS) $(DEBUG_CFLAGS) $(INCFLAGS) -c $< -o $@
|
||||
|
||||
debug/obj/%.o:: %.cpp Makefile $(ROOT)/common.mk $(INCLUDE_DIRS) $(INCLUDES)
|
||||
@mkdir -p debug/obj
|
||||
@echo $(INDENT)[$(notdir $(firstword $(CXX)))] Compiling $< for debug build
|
||||
@$(CXX) $(CXXFLAGS) $(DEBUG_CXXFLAGS) $(INCFLAGS) -c $< -o $@
|
||||
|
||||
debug/obj/%.o:: %.cc Makefile $(ROOT)/common.mk $(INCLUDE_DIRS) $(INCLUDES)
|
||||
@mkdir -p debug/obj
|
||||
@echo $(INDENT)[$(notdir $(firstword $(CXX)))] Compiling $< for debug build
|
||||
@$(CXX) $(CXXFLAGS) $(DEBUG_CXXFLAGS) $(INCFLAGS) -c $< -o $@
|
||||
|
||||
debug/obj/%.o:: %.C Makefile $(ROOT)/common.mk $(INCLUDE_DIRS) $(INCLUDES)
|
||||
@mkdir -p debug/obj
|
||||
@echo $(INDENT)[$(notdir $(firstword $(CXX)))] Compiling $< for debug build
|
||||
@$(CXX) $(CXXFLAGS) $(DEBUG_CXXFLAGS) $(INCFLAGS) -c $< -o $@
|
||||
|
||||
# Linking rules for debug
|
||||
|
||||
$(DEBUG_SHLIB_TARGET):: $(DEBUG_OBJS) $(INCLUDE_DIRS) $(INCLUDES) Makefile $(ROOT)/common.mk
|
||||
@echo $(INDENT)[$(notdir $(firstword $(CXXLIB)))] Linking `basename $@` for debug build
|
||||
@mkdir -p debug/lib
|
||||
@$(CXXLIB) $(CXXFLAGS) $(LINKFLAGS) $(DEBUG_LINKFLAGS) $(INCFLAGS) $(DEBUG_OBJS) -o $@ $(LIBFLAGS)
|
||||
|
||||
$(DEBUG_LIB_TARGET):: $(DEBUG_OBJS) $(INCLUDE_DIRS) $(INCLUDES) Makefile $(ROOT)/common.mk
|
||||
@echo $(INDENT)[ar] Linking `basename $@` for debug build
|
||||
@mkdir -p debug/lib
|
||||
@ar rcs $@ $(DEBUG_OBJS)
|
||||
|
||||
$(DEBUG_BIN_TARGET):: $(DEBUG_OBJS) $(INCLUDE_DIRS) $(INCLUDES) Makefile $(ROOT)/common.mk
|
||||
@echo $(INDENT)[$(notdir $(firstword $(CXX)))] Linking `basename $@` for debug build
|
||||
@mkdir -p debug/bin
|
||||
@$(CXX) $(CXXFLAGS) $(LINKFLAGS) $(DEBUG_LINKFLAGS) $(INCFLAGS) $(DEBUG_OBJS) -o $@ $(LIBFLAGS)
|
||||
|
||||
# Compilation rules for release
|
||||
|
||||
release/obj/%.o:: %.c Makefile $(ROOT)/common.mk $(INCLUDE_DIRS) $(INCLUDES)
|
||||
@mkdir -p release/obj
|
||||
@echo $(INDENT)[$(notdir $(firstword $(CC)))] Compiling $< for release build
|
||||
@$(CC) $(CFLAGS) $(RELEASE_CFLAGS) $(INCFLAGS) -c $< -o $@
|
||||
|
||||
release/obj/%.o:: %.cpp Makefile $(ROOT)/common.mk $(INCLUDE_DIRS) $(INCLUDES)
|
||||
@mkdir -p release/obj
|
||||
@echo $(INDENT)[$(notdir $(firstword $(CXX)))] Compiling $< for release build
|
||||
@$(CXX) $(CXXFLAGS) $(RELEASE_CXXFLAGS) $(INCFLAGS) -c $< -o $@
|
||||
|
||||
release/obj/%.o:: %.cc Makefile $(ROOT)/common.mk $(INCLUDE_DIRS) $(INCLUDES)
|
||||
@mkdir -p release/obj
|
||||
@echo $(INDENT)[$(notdir $(firstword $(CXX)))] Compiling $< for release build
|
||||
@$(CXX) $(CXXFLAGS) $(RELEASE_CXXFLAGS) $(INCFLAGS) -c $< -o $@
|
||||
|
||||
release/obj/%.o:: %.C Makefile $(ROOT)/common.mk $(INCLUDE_DIRS) $(INCLUDES)
|
||||
@mkdir -p release/obj
|
||||
@echo $(INDENT)[$(notdir $(firstword $(CXX)))] Compiling $< for release build
|
||||
@$(CXX) $(CXXFLAGS) $(RELEASE_CXXFLAGS) $(INCFLAGS) -c $< -o $@
|
||||
|
||||
# Linking rules for release
|
||||
|
||||
$(RELEASE_SHLIB_TARGET):: $(RELEASE_OBJS) $(INCLUDE_DIRS) $(INCLUDES) Makefile $(ROOT)/common.mk
|
||||
@echo $(INDENT)[$(notdir $(firstword $(CXXLIB)))] Linking `basename $@` for release build
|
||||
@mkdir -p release/lib
|
||||
@$(CXXLIB) $(CXXFLAGS) $(LINKFLAGS) $(RELEASE_LINKFLAGS) $(INCFLAGS) $(RELEASE_OBJS) -o $@ $(LIBFLAGS)
|
||||
|
||||
$(RELEASE_LIB_TARGET):: $(RELEASE_OBJS) $(INCLUDE_DIRS) $(INCLUDES) Makefile $(ROOT)/common.mk
|
||||
@echo $(INDENT)[ar] Linking `basename $@` for release build
|
||||
@mkdir -p release/lib
|
||||
@ar rcs $@ $(RELEASE_OBJS)
|
||||
|
||||
$(RELEASE_BIN_TARGET):: $(RELEASE_OBJS) $(INCLUDE_DIRS) $(INCLUDES) Makefile $(ROOT)/common.mk
|
||||
@echo $(INDENT)[$(notdir $(firstword $(CXX)))] Linking `basename $@` for release build
|
||||
@mkdir -p release/bin
|
||||
@$(CXX) $(CXXFLAGS) $(LINKFLAGS) $(RELEASE_LINKFLAGS) $(INCFLAGS) $(RELEASE_OBJS) -o $@ $(LIBFLAGS)
|
||||
|
||||
# Recursive target rules
|
||||
|
||||
$(RECURSIVE_TARGETS)::
|
||||
@for dir in $(DIRS); do \
|
||||
echo "$(INDENT)[$@] Entering $$dir"; \
|
||||
$(MAKE) -s -C $$dir $@; \
|
||||
done
|
||||
|
||||
# Dependencies
|
||||
|
||||
$(ROOT)/deps/libelfin/dwarf $(ROOT)/deps/libelfin/elf:
|
||||
@echo $(INDENT)[git] Checking out libelfin
|
||||
@rm -rf $(ROOT)/deps/libelfin
|
||||
@mkdir -p $(ROOT)/deps
|
||||
@git clone git@github.com:ccurtsinger/libelfin.git -b all-fixes $(ROOT)/deps/libelfin
|
||||
@echo $(INDENT)[make] Building libelfin
|
||||
@cd $(ROOT)/deps/libelfin; CXXFLAGS=-fPIC make
|
||||
|
||||
$(ROOT)/deps/cppgoodies/include:
|
||||
@echo $(INDENT)[git] Checking out cppgoodies
|
||||
@rm -rf $(ROOT)/deps/cppgoodies
|
||||
@mkdir -p $(ROOT)/deps
|
||||
@git clone git://github.com/ccurtsinger/cppgoodies.git $(ROOT)/deps/cppgoodies
|
@ -1,4 +0,0 @@
|
||||
ROOT = ..
|
||||
DIRS = support runtime
|
||||
|
||||
include $(ROOT)/common.mk
|
5
lib/SConscript
Normal file
5
lib/SConscript
Normal file
@ -0,0 +1,5 @@
|
||||
# Inherit the default build environment
|
||||
Import('env')
|
||||
|
||||
# Build libraries
|
||||
env.SConscript(dirs=['support', 'runtime'])
|
@ -1,16 +0,0 @@
|
||||
ROOT = ../..
|
||||
TARGET = libcausal.so
|
||||
INSTALL = 1
|
||||
LIBS = pthread dl rt causal_support dwarf++ elf++ boost_filesystem boost_program_options boost_system tbb
|
||||
INCLUDE_DIRS = $(ROOT)/lib/support/include\
|
||||
$(ROOT)/deps/cppgoodies/include
|
||||
|
||||
CFLAGS =
|
||||
|
||||
include $(ROOT)/common.mk
|
||||
|
||||
debug/lib/libcausal.so:: $(ROOT)/debug/lib/libcausal_support.a
|
||||
|
||||
release/lib/libcausal.so:: $(ROOT)/release/lib/libcausal_support.a
|
||||
|
||||
CXXFLAGS += --std=c++11 -fPIC
|
14
lib/runtime/SConscript
Normal file
14
lib/runtime/SConscript
Normal file
@ -0,0 +1,14 @@
|
||||
# Inherit the build evironment
|
||||
Import('env')
|
||||
env.Append(CPPPATH=['#include', '#lib/support/include'])
|
||||
env.Append(LIBPATH='#/lib/support')
|
||||
env.Append(LIBS=['boost_filesystem',
|
||||
'boost_program_options',
|
||||
'boost_system',
|
||||
'causal_support',
|
||||
'dl',
|
||||
'dwarf++',
|
||||
'elf++',
|
||||
'rt'])
|
||||
|
||||
env.SharedLibrary('causal', Glob('*.cpp'))
|
@ -1,11 +0,0 @@
|
||||
ROOT = ../..
|
||||
TARGET = libcausal_support.a
|
||||
INSTALL = 1
|
||||
LIBS = dwarf++ elf++ boost_filesystem boost_system
|
||||
INCLUDE_DIRS = $(ROOT)/deps/cppgoodies/include \
|
||||
$(ROOT)/deps/libelfin/dwarf\
|
||||
$(ROOT)/deps/libelfin/elf
|
||||
|
||||
include $(ROOT)/common.mk
|
||||
|
||||
CXXFLAGS += --std=c++11 -fPIC
|
5
lib/support/SConscript
Normal file
5
lib/support/SConscript
Normal file
@ -0,0 +1,5 @@
|
||||
# Inherit the build evironment
|
||||
Import('env')
|
||||
env.Append(LIBS=['dwarf++', 'elf++', 'boost_filesystem', 'boost_system'])
|
||||
|
||||
env.StaticLibrary('causal_support', Glob('*.cpp'))
|
@ -1,5 +0,0 @@
|
||||
ROOT = ..
|
||||
DIRS = loopy toy
|
||||
RECURSIVE_TARGETS = debug test
|
||||
|
||||
include $(ROOT)/common.mk
|
@ -1,8 +0,0 @@
|
||||
ROOT = ../..
|
||||
TARGET = loopy
|
||||
LIBS = pthread dl
|
||||
|
||||
include $(ROOT)/common.mk
|
||||
|
||||
test:: debug/bin/loopy
|
||||
debug/bin/loopy
|
@ -1,29 +0,0 @@
|
||||
CXX = g++
|
||||
CXXFLAGS = --std=c++11 -O3 -g
|
||||
|
||||
debug: toy_clean toy_gprof
|
||||
|
||||
release: toy_clean toy_gprof
|
||||
|
||||
clean:
|
||||
@rm -f toy_clean toy_gprof gmon.out perf.data perf_output gprof_output
|
||||
|
||||
toy_clean: toy.cpp
|
||||
$(CXX) $(CXXFLAGS) -o toy_clean toy.cpp -pthread
|
||||
|
||||
toy_gprof: toy.cpp
|
||||
$(CXX) $(CXXFLAGS) -pg -o toy_gprof toy.cpp -pthread
|
||||
|
||||
gmon.out: toy_gprof
|
||||
./toy_gprof
|
||||
|
||||
gprof_output: gmon.out
|
||||
gprof --brief toy_gprof > gprof_output
|
||||
|
||||
perf.data: toy_clean
|
||||
perf record -e task-clock -c 1000000 ./toy_clean
|
||||
|
||||
perf_output: perf.data
|
||||
perf report > perf_output
|
||||
|
||||
test: gprof_output perf_output
|
@ -1,4 +0,0 @@
|
||||
ROOT = ..
|
||||
DIRS = causal inspect coz-plot coz-process
|
||||
|
||||
include $(ROOT)/common.mk
|
5
tools/SConscript
Normal file
5
tools/SConscript
Normal file
@ -0,0 +1,5 @@
|
||||
# Inherit the default build environment
|
||||
Import('env')
|
||||
|
||||
# Build all tools
|
||||
env.SConscript(dirs=['causal', 'inspect'])
|
@ -1,11 +0,0 @@
|
||||
ROOT = ../..
|
||||
TARGET = causal
|
||||
INSTALL = 1
|
||||
LIBS = boost_program_options
|
||||
INCLUDE_DIRS = $(ROOT)/lib/runtime/include
|
||||
|
||||
include $(ROOT)/common.mk
|
||||
|
||||
ROOT_PATH = $(shell pwd)/$(ROOT)
|
||||
|
||||
CXXFLAGS += --std=c++11 -fPIC -DCAUSAL_ROOT_PATH=\"$(ROOT_PATH)\"
|
10
tools/causal/SConscript
Normal file
10
tools/causal/SConscript
Normal file
@ -0,0 +1,10 @@
|
||||
import os
|
||||
|
||||
# Inherit the build evironment
|
||||
Import('env')
|
||||
env.Append(CPPPATH=['#lib/support/include', '#lib/runtime/include'])
|
||||
env.Append(LIBPATH='#/lib/support')
|
||||
env.Append(LIBS=['boost_program_options'])
|
||||
env.Append(CCFLAGS='-DCAUSAL_ROOT_PATH=\\\"' + os.getcwd() + '\\\"')
|
||||
|
||||
env.Program('causal', Glob('*.cpp'))
|
@ -1,10 +0,0 @@
|
||||
ROOT = ../..
|
||||
TARGET = coz-plot
|
||||
INSTALL = 1
|
||||
|
||||
debug: $(ROOT)/debug/bin/coz-plot
|
||||
|
||||
release: $(ROOT)/release/bin/coz-plot
|
||||
|
||||
$(ROOT)/debug/bin/coz-plot $(ROOT)/release/bin/coz-plot:: coz-plot
|
||||
@cp coz-plot $@
|
@ -1,10 +0,0 @@
|
||||
ROOT = ../..
|
||||
TARGET = coz-process
|
||||
INSTALL = 1
|
||||
|
||||
debug: $(ROOT)/debug/bin/coz-process
|
||||
|
||||
release: $(ROOT)/release/bin/coz-process
|
||||
|
||||
$(ROOT)/debug/bin/coz-process $(ROOT)/release/bin/coz-process:: coz-process
|
||||
@cp coz-process $@
|
@ -1,17 +0,0 @@
|
||||
ROOT = ../..
|
||||
TARGET = inspect
|
||||
INSTALL = 1
|
||||
LIBS = causal_support dwarf++ elf++ boost_filesystem boost_system
|
||||
INCLUDE_DIRS = $(ROOT)/lib/support/include \
|
||||
$(ROOT)/deps/cppgoodies/include
|
||||
|
||||
include $(ROOT)/common.mk
|
||||
|
||||
CXXFLAGS += --std=c++11 -fPIC
|
||||
|
||||
debug:: $(ROOT)/lib/support/debug/lib/libcausal_support.a
|
||||
|
||||
release:: $(ROOT)/lib/support/release/lib/libcausal_support.a
|
||||
|
||||
test: debug
|
||||
./debug/bin/inspect $(ROOT)/benchmarks/producer_consumer/debug/bin/producer_consumer
|
11
tools/inspect/SConscript
Normal file
11
tools/inspect/SConscript
Normal file
@ -0,0 +1,11 @@
|
||||
# Inherit the build evironment
|
||||
Import('env')
|
||||
env.Append(CPPPATH=['#lib/support/include'])
|
||||
env.Append(LIBPATH='#/lib/support')
|
||||
env.Append(LIBS=['causal_support',
|
||||
'dwarf++',
|
||||
'elf++',
|
||||
'boost_filesystem',
|
||||
'boost_system'])
|
||||
|
||||
env.Program('inspect', Glob('*.cpp'))
|
Loading…
Reference in New Issue
Block a user