Advertisement
doragasu

CMSIS DSPLib Bottom level makefile

Nov 17th, 2012
774
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 1.11 KB | None | 0 0
  1. #*****************************************************************************#
  2. # Makefile: Generic makefile for compiling .c files, leaving the generated    #
  3. # objects under $(ROOT)/obj. This makefile imports default variables from     #
  4. # $(ROOT)/Makefile.inc.                                                       #
  5. #-----------------------------------------------------------------------------#
  6. # Jesús Alonso Fernández @doragasu, 2012                                      # #*****************************************************************************#
  7.  
  8. # Set root directory
  9. ROOT ?= ../../..
  10.  
  11. # Import default variables
  12. include $(ROOT)/Makefile.inc
  13.  
  14. # Set target object directory
  15. OBJDIR = $(ROOT)/obj
  16.  
  17. # Compute a list of object files
  18. objects := $(patsubst %.c,$(OBJDIR)/%.o,$(wildcard *.c))
  19.  
  20. # Main target: build all object files
  21. all: $(objects)
  22.  
  23. # Target for building each object file
  24. $(OBJDIR)/%.o: %.c | $(OBJDIR)
  25.     $(PREFIX)$(CC) $(CFLAGS) -c $< -o $@
  26.  
  27. # Creates destination directory if it doesn't exist
  28. $(OBJDIR):
  29.     mkdir -p $(OBJDIR)
  30.  
  31. # Clean target
  32. .PHONY: clean
  33. clean:
  34.     @$(RM) -f $(objects)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement