Application.mk: Add module install logic. Possibly only needed in KERNEL build mode? Makefile: Simplify import target for KERNEL build. A symbol table is not needed because the KERNEL-mode programs are completely linked. Also fix missing deletion in clean and distclean targets. tools/mksymtab.sh: Fix a typo introduced in previous commit.

This commit is contained in:
Gregory Nutt 2018-09-04 16:04:25 -06:00
parent fff0ffa185
commit 6f6bc758cc
3 changed files with 14 additions and 21 deletions

View File

@ -190,6 +190,7 @@ PROGOBJ := $(MAINOBJ)
ifneq ($(PROGOBJ),)
$(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) $(ARCHCRT0OBJ) $(firstword $(PROGOBJ)) $(LDLIBS) -o $(firstword $(PROGLIST))
$(Q) $(NM) -u $(firstword $(PROGLIST))
$(Q) install -m 0755 -D $(firstword $(PROGLIST)) $(BIN_DIR)/$(firstword $(PROGLIST))
$(eval PROGLIST=$(filter-out $(firstword $(PROGLIST)),$(PROGLIST)))
$(eval PROGOBJ=$(filter-out $(firstword $(PROGOBJ)),$(PROGOBJ)))
endif

View File

@ -103,39 +103,29 @@ $(foreach SDIR, $(CONFIGURED_APPS), $(eval $(call SDIR_template,$(SDIR),depend))
$(foreach SDIR, $(CLEANDIRS), $(eval $(call SDIR_template,$(SDIR),clean)))
$(foreach SDIR, $(CLEANDIRS), $(eval $(call SDIR_template,$(SDIR),distclean)))
# In the KERNEL build, we must build and install all of the modules. No
# symbol table is needed
ifeq ($(CONFIG_BUILD_KERNEL),y)
.install: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_install)
install: $(BIN_DIR) .install
$(SYMTABSRC): $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_all)
$(Q) $(MAKE) install TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"
$(Q) $(APPDIR)$(DELIM)tools$(DELIM)mksymtab.sh $(EXE_DIR)$(DELIM)system $(SYMTABSRC)
$(SYMTABOBJ): %$(OBJEXT): %.c
ifeq ($(WINTOOL),y)
$(call COMPILE, -fno-lto "${shell cygpath -w $<}", "${shell cygpath -w $@}")
else
$(call COMPILE, -fno-lto $<, $@)
endif
$(BIN): $(SYMTABOBJ)
ifeq ($(WINTOOL),y)
$(call ARCHIVE, $(BIN), "${shell cygpath -w $^}")
else
$(call ARCHIVE, $(BIN), $^)
endif
$(BIN_DIR):
$(Q) mkdir -p $(BIN_DIR)
.import: $(BIN_DIR) $(SYMTABSRC) $(BIN)
.import: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_all)
$(Q) $(MAKE) install TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"
import:
import: $(BIN_DIR)
$(Q) $(MAKE) .import TOPDIR="$(APPDIR)$(DELIM)import"
else
# In FLAT and protected modes, the modules have already been created. A
# symbol table is required.
ifeq ($(CONFIG_BUILD_LOADABLE),)
$(BIN): $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_all)
@ -204,6 +194,7 @@ clean_context:
clean: $(foreach SDIR, $(CLEANDIRS), $(SDIR)_clean)
$(call DELFILE, $(SYMTABSRC))
$(call DELFILE, $(SYMTABOBJ))
$(call DELFILE, $(BIN))
$(call DELFILE, Kconfig)
$(call DELDIR, $(BIN_DIR))
@ -227,6 +218,7 @@ else
endif
$(call DELFILE, .depend)
$(call DELFILE, $(SYMTABSRC))
$(call DELFILE, $(SYMTABOBJ))
$(call DELFILE, $(BIN))
$(call DELFILE, Kconfig)
$(call DELDIR, $(BIN_DIR))

View File

@ -69,7 +69,7 @@ rm -f $outfile
# list of sorted, unique undefined variable names.
execlist=`find ${dir} -type f`
if [ ! -z "${execlist}"]; then
if [ ! -z "${execlist}" ]; then
for exec in ${execlist}; do
nm $exec | fgrep ' U ' | sed -e "s/^[ ]*//g" | cut -d' ' -f2 >>_tmplist
done