3 #     Copyright (C) Dean Camera, 2013.
 
   5 #  dean [at] fourwalledcubicle [dot] com
 
   8 # ---------------------------------------
 
   9 #  Makefile for the LUFA library itself.
 
  10 # ---------------------------------------
 
  12 LUFA_VERSION_NUM         = $(shell grep LUFA_VERSION_STRING $(LUFA_PATH)/Version.h | cut -d'"' -f2)
 
  13 EXCLUDE_FROM_EXPORT     := Documentation DoxygenPages CodeTemplates Build StudioIntegration *.conf *.tar *.o *.d *.lss *.lst *.hex *.elf *.hex *.eep *.map *.bin
 
  15 # Default target - no default action when attempting to build the core directly
 
  18 # Export the library core as a TAR archive for importing into an IDE
 
  20         @echo Exporting LUFA library to a TAR archive...
 
  21         @tar -cf LUFA_$(LUFA_VERSION_NUM).tar --directory=. $(EXCLUDE_FROM_EXPORT:%=--exclude=%) *
 
  22         @tar -cf LUFA_$(LUFA_VERSION_NUM)_Code_Templates.tar CodeTemplates
 
  23         @echo Export LUFA_$(LUFA_VERSION_NUM).tar complete.
 
  25 # Display the LUFA version of this library copy
 
  27         @echo "LUFA $(LUFA_VERSION_NUM)"
 
  29 # Check if this is being included from a legacy or non LUFA build system makefile
 
  31   LUFA_ROOT_PATH = $(patsubst %/,%,$(LUFA_PATH))/LUFA/
 
  33   include $(patsubst %/,%,$(LUFA_PATH))/LUFA/Build/lufa_sources.mk
 
  35   LUFA_BUILD_MODULES     += MASTER
 
  36   LUFA_BUILD_TARGETS     += export_tar version
 
  39   ARCH                    = {AVR8,UC3,XMEGA}
 
  40   DOXYGEN_OVERRIDE_PARAMS = QUIET=YES PROJECT_NUMBER=$(LUFA_VERSION_NUM)
 
  42   # Remove all object and associated files from the LUFA library core
 
  44         rm -f $(LUFA_SRC_ALL_FILES:%.c=%.o)
 
  45         rm -f $(LUFA_SRC_ALL_FILES:%.c=%.d)
 
  46         rm -f $(LUFA_SRC_ALL_FILES:%.c=%.lst)
 
  48   include Build/lufa_core.mk
 
  49   include Build/lufa_sources.mk
 
  50   include Build/lufa_doxygen.mk
 
  53 .PHONY: all export_tar version clean