Application.mk: Fix some issues when building directories such as fsutils/mkfatfs that have not mainobj. In this case, the MAINSRC is undefined and it would generate a bad linker command line.

This commit is contained in:
Gregory Nutt 2018-09-04 13:00:03 -06:00
parent 3921bbad79
commit 305278d1ae
5 changed files with 9 additions and 3 deletions

View File

@ -187,10 +187,12 @@ PROGLIST := $(addprefix $(PROGPRFX),$(PROGNAME))
PROGOBJ := $(MAINOBJ)
.proglist: $(MAINOBJ) $(OBJS)
$(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(firstword $(PROGLIST)) $(ARCHCRT0OBJ) $(firstword $(PROGOBJ)) $(LDLIBS)
ifneq ($(PROGOBJ),)
$(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) $(ARCHCRT0OBJ) $(firstword $(PROGOBJ)) $(LDLIBS) -o $(firstword $(PROGLIST))
$(Q) $(NM) -u $(firstword $(PROGLIST))
$(eval PROGLIST=$(filter-out $(firstword $(PROGLIST)),$(PROGLIST)))
$(eval PROGOBJ=$(filter-out $(firstword $(PROGOBJ)),$(PROGOBJ)))
endif
install:: .proglist

View File

@ -1,3 +1,4 @@
/hello
/Make.dep
/.depend
/.built

View File

@ -36,6 +36,7 @@
-include $(TOPDIR)/Make.defs
# mkfatfs utility
ifeq ($(CONFIG_FSUTILS_MKFATFS),y)
CSRCS = mkfatfs.c configfat.c writefat.c
endif

View File

@ -37,9 +37,10 @@
-include $(TOPDIR)/Make.defs
# Web client library
# SmartFS file utility
ifeq ($(CONFIG_FSUTILS_MKSMARTFS),y)
CSRCS = mksmartfs.c
CSRCS = mksmartfs.c
endif
include $(APPDIR)/Application.mk

View File

@ -36,6 +36,7 @@
-include $(TOPDIR)/Make.defs
# The Readline Library
CSRCS = readline.c readline_common.c
include $(APPDIR)/Application.mk