From a06e53b1f92d008ae69f8d4afa7d236bedce1319 Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Tue, 30 May 2023 18:12:18 +0800 Subject: [PATCH] tools/Wasm.mk: Generate object file name with full path For example, before this patch, object file is like: ``` apps/examples/hello/hello_main.wo ``` With this patch, it will be: ``` apps/examples/hello/hello_main.c.home.huang.Work.nx.apps.examples.hello.wo ''' Follow the native build: ''' apps/examples/hello/hello_main.c.home.huang.Work.nx.apps.examples.hello.o ``` Signed-off-by: Huang Qi --- tools/Wasm.mk | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/Wasm.mk b/tools/Wasm.mk index 4517588ae..ba4f53463 100644 --- a/tools/Wasm.mk +++ b/tools/Wasm.mk @@ -93,27 +93,27 @@ PRIORITY ?= SCHED_PRIORITY_DEFAULT # XIP: Execution In Place # JIT: Just In Time -WAMR_MODE ?= INT +WAMR_MODE ?= INT # Targets follow .PRECIOUS: $(WBIN) WSRCS := $(MAINSRC) $(CSRCS) -WOBJS := $(WSRCS:%.c=%.wo) +WOBJS := $(WSRCS:=$(SUFFIX).wo) all:: $(WBIN) -$(WOBJS): %.wo : %.c +$(WOBJS): %.c$(SUFFIX).wo : %.c $(Q) $(WCC) $(WCFLAGS) -c $^ -o $@ $(WBIN): $(WOBJS) $(shell mkdir -p $(APPDIR)/wasm) - $(Q) $(WAR) $@ $(filter-out $(MAINSRC:%.c=%.wo),$^) + $(Q) $(WAR) $@ $(filter-out $(MAINSRC:=$(SUFFIX).wo),$^) $(foreach main,$(MAINSRC), \ $(eval mainindex=$(strip $(call GETINDEX,$(main),$(MAINSRC)))) \ - $(eval dstname=$(shell echo $(main:%.c=%.wo) | sed -e 's/\//_/g')) \ - $(shell cp -rf $(strip $(main:%.c=%.wo)) \ + $(eval dstname=$(shell echo $(main:=$(SUFFIX).wo) | sed -e 's/\//_/g')) \ + $(shell cp -rf $(strip $(main:=$(SUFFIX).wo)) \ $(strip $(APPDIR)/wasm/$(word $(mainindex),$(PROGNAME))#$(WASM_INITIAL_MEMORY)#$(STACKSIZE)#$(PRIORITY)#$(WAMR_MODE)#$(dstname)) \ ) \ )