Debian Codegraph @

apps/c_backend/Makefile

raw symbols SCIP
1 include ../support/Makefile.inc
2
3 # Some older arm64 compilers will choke on our C backend code at -O3;
4 # we'll just use -O2 for this app since performance here isn't critical
5 OPTIMIZE = -O2
6
7 .PHONY: build clean test
8 build: $(BIN)/$(HL_TARGET)/run $(BIN)/$(HL_TARGET)/run_cpp
9 test: build
10 $(BIN)/$(HL_TARGET)/run
11 $(BIN)/$(HL_TARGET)/run_cpp
12
13 $(GENERATOR_BIN)/pipeline.generator: pipeline_generator.cpp $(GENERATOR_DEPS)
14 @mkdir -p $(@D)
15 $(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LIBHALIDE_LDFLAGS)
16
17 $(BIN)/%/pipeline_native.a: $(GENERATOR_BIN)/pipeline.generator
18 @mkdir -p $(@D)
19 $^ -g pipeline -o $(@D) -f pipeline_native -e $(GENERATOR_OUTPUTS) target=$*
20
21 $(BIN)/%/pipeline_c.halide_generated.cpp: $(GENERATOR_BIN)/pipeline.generator
22 @mkdir -p $(@D)
23 $^ -g pipeline -o $(@D) -f pipeline_c -e c_source,c_header target=$*
24
25 $(BIN)/%/run: run.cpp $(BIN)/%/pipeline_c.halide_generated.cpp $(BIN)/%/pipeline_native.a
26 $(CXX) $(CXXFLAGS) -Wall -I$(BIN)/$* $(filter-out %.h,$^) -o $@ $(LDFLAGS)
27
28 $(GENERATOR_BIN)/pipeline_cpp.generator: pipeline_cpp_generator.cpp $(GENERATOR_DEPS)
29 @mkdir -p $(@D)
30 $(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LIBHALIDE_LDFLAGS)
31
32 $(BIN)/%/pipeline_cpp_cpp.halide_generated.cpp: $(GENERATOR_BIN)/pipeline_cpp.generator
33 @mkdir -p $(@D)
34 $^ -g pipeline_cpp -o $(@D) -f pipeline_cpp_cpp -e c_source,c_header target=host-c_plus_plus_name_mangling
35
36 $(BIN)/%/pipeline_cpp_native.a: $(GENERATOR_BIN)/pipeline_cpp.generator
37 @mkdir -p $(@D)
38 $^ -g pipeline_cpp -o $(@D) -f pipeline_cpp_native -e $(GENERATOR_OUTPUTS) target=host-c_plus_plus_name_mangling
39
40 $(BIN)/%/run_cpp: run_cpp.cpp $(BIN)/%/pipeline_cpp_cpp.halide_generated.cpp $(BIN)/%/pipeline_cpp_native.a
41 $(CXX) $(CXXFLAGS) -Wall -I$(BIN)/$* $(filter-out %.h,$^) -o $@ $(LDFLAGS)
42
43 clean:
44 rm -rf $(BIN)