xiaoxiang781216 commented on code in PR #3762: URL: https://github.com/apache/nuttx-apps/pull/3762#discussion_r3980583674
########## examples/fdpicxip/modules/Makefile: ########## @@ -44,19 +45,57 @@ CPU ?= cortex-m3 -FDPICDIR = $(NUTTX_DIR)/tools/fdpic -MODULE_MK = $(FDPICDIR)/nuttx-fdpic.mk -EMBED = $(FDPICDIR)/fdpic-embed.py +# The tools and the flags are the configured tree's own, so a fixture is +# built the way CONFIG_FDPIC builds any module: same compiler, same +# arm-uclinuxfdpiceabi linker, same linker script, same crt0 source. -# Where each generated header goes, and its path from the repository root -- -# fdpic-embed.py puts that on line 2, which is what nxstyle wants. +TOPDIR := $(NUTTX_DIR) +include $(NUTTX_DIR)/Make.defs + +# Except for two things. The CPU, and thus the architecture flags the tree +# chose for its own target, because a v7-M module runs on both the v7-M and +# the v8-M targets and one built for the configured target would not. And +# the debug information, because these artifacts are committed as headers. +# +# crt0 is compiled here rather than taken built, for the CPU reason. + +DROPFLAGS = -march=% -mtune=% -mcpu=% -mfpu=% -mfloat-abi=% +MODCFLAGS = $(filter-out $(DROPFLAGS),$(CELFFLAGS)) -mcpu=$(CPU) -g0 +MODCXXFLAGS = $(filter-out $(DROPFLAGS),$(CXXELFFLAGS)) -mcpu=$(CPU) -g0 +MODLDFLAGS = $(filter-out %crt0.o -e _start,$(LDELFFLAGS)) DEMODIR = .. DEMOREL = apps/examples/fdpicxip TESTDIR = ../../../testing/fs/xipfs TESTREL = apps/testing/fs/xipfs -BUILD = $(MAKE) -f $(MODULE_MK) NUTTX_DIR=$(NUTTX_DIR) CPU=$(CPU) +%.o: %.c Review Comment: can we build fdpic so like the normal so by `DYNLIB = y` like examples/sotest, examples/module? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
