Grr.. last commit unreverted some changes.  I think it is right now.
@@ -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
