| 1 |
THIS_MAKEFILE = $(realpath $(filter %Makefile, $(MAKEFILE_LIST))) |
| 2 |
SRC = $(strip $(shell dirname $(THIS_MAKEFILE))) |
| 3 |
HALIDE_ROOT = $(realpath $(SRC)/../../../) |
| 4 |
COMMON_DIR = $(realpath $(SRC)/../common/) |
| 5 |
|
| 6 |
HALIDE_DISTRIB_PATH ?= $(HALIDE_SRC_ROOT)/distrib |
| 7 |
include $(HALIDE_ROOT)/apps/support/Makefile.inc |
| 8 |
|
| 9 |
# Add the relative location of libHalide.so in the rpath in a distro so that the autoscheduler library can find libHalide |
| 10 |
ifeq ($(UNAME), Darwin) |
| 11 |
HALIDE_RPATH_FOR_LIB += '-Wl,-rpath,@loader_path' |
| 12 |
else |
| 13 |
HALIDE_RPATH_FOR_LIB += '-Wl,-rpath,$$ORIGIN' |
| 14 |
endif |
| 15 |
|
| 16 |
CXXFLAGS += -I$(COMMON_DIR) |
| 17 |
|
| 18 |
# Be sure *not* to include libHalide in the link steps here; that can cause misbehavior |
| 19 |
# on OSX systems in certain situations -- note that $(LIB_HALIDE) is an order-only dep, |
| 20 |
# to ensure that (eg) Halide.h is built before this. |
| 21 |
$(BIN)/libautoschedule_mullapudi2016.$(PLUGIN_EXT): $(SRC)/AutoSchedule.cpp | $(LIB_HALIDE) |
| 22 |
@mkdir -p $(@D) |
| 23 |
$(CXX) -shared $(USE_EXPORT_DYNAMIC) -fPIC -fvisibility=hidden -fvisibility-inlines-hidden $(CXXFLAGS) $(OPTIMIZE) $^ -o $@ $(HALIDE_RPATH_FOR_LIB) |