Skip to content

Commit

Permalink
Fix make build
Browse files Browse the repository at this point in the history
  • Loading branch information
rascani committed Sep 14, 2023
1 parent f74988b commit 162a907
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
5 changes: 0 additions & 5 deletions codegen/runtime/Makefile.inc

This file was deleted.

12 changes: 4 additions & 8 deletions tensorflow/lite/micro/tools/make/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,6 @@ CODEGEN_PREPROCESSOR_PATH := $(BINDIR)codegen_preprocessor

MICRO_LITE_CODEGEN_PREPROCESSOR := $(TENSORFLOW_ROOT)codegen/preprocessor/Makefile.inc

MICRO_LITE_CODEGEN_RUNTIME := $(TENSORFLOW_ROOT)codegen/runtime/Makefile.inc

MICRO_LITE_CODEGEN_EXAMPLES := $(shell find $(TENSORFLOW_ROOT)codegen/examples/ -name Makefile.inc)

MICROLITE_TEST_SRCS := \
Expand Down Expand Up @@ -560,7 +558,11 @@ include $(MAKEFILE_DIR)/additional_kernels.inc
MICROLITE_CC_SRCS := $(filter-out $(MICROLITE_TEST_SRCS), $(MICROLITE_CC_BASE_SRCS))
MICROLITE_CC_SRCS := $(filter-out $(MICROLITE_BENCHMARK_SRCS), $(MICROLITE_CC_SRCS))

CODEGEN_RUNTIME_CC_SRCS := \
$(TENSORFLOW_ROOT)codegen/runtime/micro_codegen_context.cc

CODEGEN_RUNTIME_CC_HDRS := \
$(TENSORFLOW_ROOT)codegen/runtime/micro_codegen_context.h

# The download scripts require that the downloads directory already exist for
# improved error checking. To accomodate that, we first create a downloads
Expand Down Expand Up @@ -717,9 +719,6 @@ include $(MAKEFILE_DIR)/additional_tests.inc
# Load codegen preprocessor rules
include $(MICRO_LITE_CODEGEN_PREPROCESSOR)

# Load codegen runtime rules
include $(MICRO_LITE_CODEGEN_RUNTIME)

# Create rules for downloading third-party dependencies.
THIRD_PARTY_TARGETS :=
$(foreach DOWNLOAD,$(THIRD_PARTY_DOWNLOADS),$(eval $(call create_download_rule,$(DOWNLOAD))))
Expand All @@ -737,9 +736,6 @@ $(patsubst %.S,%.o,$(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(THIRD_PARTY_KERNEL_C
MICROLITE_KERNEL_OBJS := $(addprefix $(KERNEL_OBJDIR), \
$(patsubst %.S,%.o,$(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(MICROLITE_CC_KERNEL_SRCS)))))

MICROLITE_CODEGEN_RUNTIME_OBJS := $(addprefix $(CORE_OBJDIR), \
$(patsubst %.S,%.o,$(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(MICROLITE_CC_CODEGEN_RUNTIME_SRCS)))))

$(CORE_OBJDIR)%.o: %.cc $(THIRD_PARTY_TARGETS)
@mkdir -p $(dir $@)
$(CXX) $(CXXFLAGS) $(CORE_OPTIMIZATION_LEVEL) $(INCLUDES) -c $< -o $@
Expand Down
9 changes: 5 additions & 4 deletions tensorflow/lite/micro/tools/make/helper_functions.inc
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,15 @@ define codegen_model_binary
# C++11 stdlib, so preprocessor fails to link.
ifneq ($(TARGET), $(filter $(TARGET), bluepill riscv32_generic hexagon))

$(1)_CODEGEN_SRCS := $(4)
$(1)_CODEGEN_HDRS := $(5)
$(1)_CODEGEN_SRCS := $(4) $$(CODEGEN_RUNTIME_CC_SRCS)
$(1)_CODEGEN_HDRS := $(5) $$(CODEGEN_RUNTIME_CC_HDRS)

$(call codegen_model,$(1)_codegen,$(2),$(3))

$(1)_CODEGEN_SRCS += $$($(1)_codegen_GENERATED_SRCS)
$(1)_CODEGEN_HDRS += $$($(1)_codegen_GENERATED_HDRS)

$(1)_CODEGEN_OBJS := $(MICROLITE_CODEGEN_RUNTIME_OBJS)
$(1)_CODEGEN_OBJS += $$(addprefix $$(CORE_OBJDIR), \
$(1)_CODEGEN_OBJS := $$(addprefix $$(CORE_OBJDIR), \
$$(patsubst %.S,%.o,$$(patsubst %.cc,%.o,$$(patsubst %.c,%.o,$$($(1)_CODEGEN_SRCS)))))

$(1)_BINARY := $$(BINDIR)$(1)
Expand All @@ -202,6 +201,8 @@ $$($(1)_BINARY): $$($(1)_CODEGEN_OBJS) $$(MICROLITE_LIB_PATH)
$(1): $$($(1)_BINARY)
$(1)_bin: $$($(1)_BINARY).bin

MICROLITE_BUILD_TARGETS += $$($(1)_BINARY)

run_$(1): $$($(1)_BINARY)
$$(RUN_COMMAND) $$($(1)_BINARY)

Expand Down

0 comments on commit 162a907

Please sign in to comment.