File: Makefile

package info (click to toggle)
halide 19.0.0-6
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 55,096 kB
  • sloc: cpp: 286,920; ansic: 22,751; python: 5,821; makefile: 4,374; sh: 2,445; java: 1,549; javascript: 282; pascal: 212; xml: 127; asm: 9
file content (44 lines) | stat: -rw-r--r-- 1,842 bytes parent folder | download | duplicates (2)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
include ../support/Makefile.inc

# Some older arm64 compilers will choke on our C backend code at -O3;
# we'll just use -O2 for this app since performance here isn't critical
OPTIMIZE = -O2

.PHONY: build clean test
build: $(BIN)/$(HL_TARGET)/run $(BIN)/$(HL_TARGET)/run_cpp
test: build
	$(BIN)/$(HL_TARGET)/run
	$(BIN)/$(HL_TARGET)/run_cpp

$(GENERATOR_BIN)/pipeline.generator: pipeline_generator.cpp $(GENERATOR_DEPS)
	@mkdir -p $(@D)
	$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LIBHALIDE_LDFLAGS) $(HALIDE_SYSTEM_LIBS)

$(BIN)/%/pipeline_native.a: $(GENERATOR_BIN)/pipeline.generator
	@mkdir -p $(@D)
	$^ -g pipeline -o $(@D) -f pipeline_native -e $(GENERATOR_OUTPUTS) target=$*

$(BIN)/%/pipeline_c.halide_generated.cpp: $(GENERATOR_BIN)/pipeline.generator
	@mkdir -p $(@D)
	$^ -g pipeline -o $(@D) -f pipeline_c -e c_source,c_header target=$*

$(BIN)/%/run: run.cpp $(BIN)/%/pipeline_c.halide_generated.cpp $(BIN)/%/pipeline_native.a
	$(CXX) $(CXXFLAGS) -Wall -I$(BIN)/$* $(filter-out %.h,$^) -o $@  $(LDFLAGS)

$(GENERATOR_BIN)/pipeline_cpp.generator: pipeline_cpp_generator.cpp $(GENERATOR_DEPS)
	@mkdir -p $(@D)
	$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LIBHALIDE_LDFLAGS) $(HALIDE_SYSTEM_LIBS)

$(BIN)/%/pipeline_cpp_cpp.halide_generated.cpp: $(GENERATOR_BIN)/pipeline_cpp.generator
	@mkdir -p $(@D)
	$^ -g pipeline_cpp -o $(@D) -f pipeline_cpp_cpp -e c_source,c_header target=host-c_plus_plus_name_mangling

$(BIN)/%/pipeline_cpp_native.a: $(GENERATOR_BIN)/pipeline_cpp.generator
	@mkdir -p $(@D)
	$^ -g pipeline_cpp -o $(@D) -f pipeline_cpp_native -e $(GENERATOR_OUTPUTS) target=host-c_plus_plus_name_mangling

$(BIN)/%/run_cpp: run_cpp.cpp $(BIN)/%/pipeline_cpp_cpp.halide_generated.cpp $(BIN)/%/pipeline_cpp_native.a
	$(CXX) $(CXXFLAGS) -Wall -I$(BIN)/$* $(filter-out %.h,$^) -o $@  $(LDFLAGS)

clean:
	rm -rf $(BIN)