From 23066a71f0c916886323b90731f8885d08c11afc Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 22 Aug 2018 12:19:36 -0600 Subject: [PATCH] Grr.. last commit unreverted some changes. I think it is right now. --- Make.defs | 41 ++++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/Make.defs b/Make.defs index 0d0918b2d..e86827a56 100644 --- a/Make.defs +++ b/Make.defs @@ -43,23 +43,46 @@ DEPCONFIG = $(TOPDIR)$(DELIM).config ifeq ($(CONFIG_WINDOWS_NATIVE),y) define REGISTER $(Q) echo Register: $1 - $(Q) echo { "$1", $2, $3, $4 }, > "$(BUILTIN_REGISTRY)$(DELIM)$1.bdat" - $(Q) if [ ! -z $4 ]; then \ - echo "int $4(int argc, char *argv[]);" > "$(BUILTIN_REGISTRY)$(DELIM)$1.pdat"; \ - fi; + $(Q) echo { "$1", $2, $3, $4 }, > "$(BUILTIN_REGISTRY)$(DELIM)$4.bdat" + $(Q) echo int $4(int argc, char *argv[]); > "$(BUILTIN_REGISTRY)$(DELIM)$4.pdat" $(Q) touch $(BUILTIN_REGISTRY)$(DELIM).updated" endef else define REGISTER - $(Q) echo "Register: $1 $4" - $(Q) echo "{ \"$1\", $2, $3, $4 }," > "$(BUILTIN_REGISTRY)$(DELIM)$1.bdat" - $(Q) if [ ! -z $4 ]; then \ - echo "int $4(int argc, char *argv[]);" > "$(BUILTIN_REGISTRY)$(DELIM)$1.pdat"; \ - fi; + $(Q) echo "Register: $1" + $(Q) echo "{ \"$1\", $2, $3, $4 }," > "$(BUILTIN_REGISTRY)$(DELIM)$4.bdat" + $(Q) echo "int $4(int argc, char *argv[]);" > "$(BUILTIN_REGISTRY)$(DELIM)$4.pdat" $(Q) touch "$(BUILTIN_REGISTRY)$(DELIM).updated" endef endif +# COMPILE - a macro to compile a loadable app in C + +ifeq ($(LOADABLE),y) +define COMPILE + @echo "CC) $1" + $(Q) $(CC) -c $(CELFFLAGS) -DLOADABLE_APP $1 -o $2 +endef +endif + +# COMPILEXX - a macro to compile a loadable app in C++ + +ifeq ($(LOADABLE),y) +define COMPILEXX + @echo "CXX: $1" + $(Q) $(CXX) -c $(CXXELFFLAGS) -DLOADABLE_APP $1 -o $2 +endef +endif + +# ELFLD - a macro to link loadable app +# Example: $(call ELFLD, entry point, in-file(s), out-file) + +define ELFLD + @echo "LD: $3" + $(Q) $(LD) $(LDELFFLAGS) $2 -o $3 + $(Q) chmod +x $3 +endef + # Tools # # In a normal build, tools will reside in the nuttx/tools sub-directory and