-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Makefile
31 lines (24 loc) · 913 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
include ../support/Makefile.inc
all: $(BIN)/$(HL_TARGET)/test
$(GENERATOR_BIN)/halide_blur.generator: halide_blur_generator.cpp $(GENERATOR_DEPS)
@mkdir -p $(@D)
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS) $(HALIDE_SYSTEM_LIBS)
$(BIN)/%/halide_blur.a: $(GENERATOR_BIN)/halide_blur.generator
@mkdir -p $(@D)
$^ -g halide_blur -e $(GENERATOR_OUTPUTS) -o $(@D) target=$*
# g++ on OS X might actually be system clang without openmp
CXX_VERSION=$(shell $(CXX) --version)
ifeq (,$(findstring clang,$(CXX_VERSION)))
OPENMP_FLAGS=-fopenmp
else
OPENMP_FLAGS=
endif
# -O2 is faster than -O3 for this app (O3 unrolls too much)
$(BIN)/%/test: $(BIN)/%/halide_blur.a test.cpp
@mkdir -p $(@D)
$(CXX-$*) $(CXXFLAGS-$*) $(OPENMP_FLAGS) -Wall -O2 -I$(BIN)/$* test.cpp $(BIN)/$*/halide_blur.a -o $@ $(LDFLAGS-$*)
clean:
rm -rf $(BIN)
.PHONY: test
test: $(BIN)/$(HL_TARGET)/test
$(BIN)/$(HL_TARGET)/test