Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The custom application directory must include a Makefile and this makefile must all of the make targets expected by the NuttX build and must generate an archive called libapps.a in the top-level of the custom directory structure. The Makefile has just those minimum required targets:

Code Block

    APPDIR = ${shell pwd}
  
  
-include $(TOPDIR)/Make.defs

...

Code Block
    
    # files
    
    CSRCS = hello.c
    COBJS = hello.o
    
    ROOTDEPPATH = --dep-path .
    
    # Build targets
    
    all: libapps.a
    .PHONY: dirlinks context preconfig depend clean clean_context distclean
    .PRECIOUS: libapps$(LIBEXT)
    
    # Compile C Files
    
    $(COBJS): %$(OBJEXT): %.c
    	$(call COMPILE, $<, $@)
    
    # Add object files to the apps archive
    
    libapps.a: $(COBJS)
    	$(call ARCHIVE, libapps.a, $(COBJS))
    
    # Create directory links
    
    dirlinks:
    
    # Setup any special pre-build context
    
    context:
    
    # Setup any special pre-configuration context
    
    preconfig:
    
    # Make the dependency file, Make.deps
    
    depend: Makefile $(CSRCS)
    	$(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
    
    # Clean the results of the last build
    
    clean:
    	$(call CLEAN)
    
    # Remove the build context and directory links
    
    clean_context:
    
    # Restore the directory to its original state
    
    distclean: clean clean_context
    	$(call DELFILE, Make.dep)
    
    # Include dependencies
      
  
-include Make.dep
    

Kconfig

A Kconfig file must be included but need not be populated with any meaningful options. This is a place where you can add settings to generate customized builds of your custom application. In the minimum case, Kconfig is only:

...