makefile 1.78 KB
Newer Older
1
2
#
#             LUFA Library
3
#     Copyright (C) Dean Camera, 2012.
4
#
5
#  dean [at] fourwalledcubicle [dot] com
6
#           www.lufa-lib.org
7
#
8
9
10
# ---------------------------------------
#  Makefile for the LUFA library itself.
# ---------------------------------------
11

12
LUFA_VERSION_NUM        := $(shell grep LUFA_VERSION_STRING Version.h | cut -d'"' -f2)
13
EXCLUDE_FROM_EXPORT     := Documentation DoxygenPages CodeTemplates Build *.conf *.tar *.o *.d *.lss *.lst *.hex *.elf *.hex *.eep *.map *.bin
14

15
# Default target - no default action when attempting to build the core directly
16
17
all:

18
# Export the library core as a TAR archive for importing into an IDE
19
export_tar:
20
	@echo Exporting LUFA library to a TAR archive...
21
	@tar -cf LUFA_$(LUFA_VERSION_NUM).tar --directory=. $(EXCLUDE_FROM_EXPORT:%=--exclude=%) *
22
23
	@tar -cf LUFA_$(LUFA_VERSION_NUM)_Code_Templates.tar CodeTemplates
	@echo Export LUFA_$(LUFA_VERSION_NUM).tar complete.
24

25
# Display the LUFA version of this library copy
26
version:
27
	@echo "LUFA $(LUFA_VERSION_NUM)"
28

29
30
# Check if this is being included from a legacy or non LUFA build system makefile
ifneq ($(LUFA_PATH),)
31
  LUFA_ROOT_PATH = $(patsubst %/,%,$(LUFA_PATH))/LUFA/
32
  
33
  include $(patsubst %/,%,$(LUFA_PATH))/LUFA/Build/lufa.sources.in
34
else
35
36
37
  LUFA_BUILD_MODULES     += MASTER
  LUFA_BUILD_TARGETS     += export_tar version

38
39
40
  LUFA_PATH               = .
  ARCH                    = {AVR8,UC3,XMEGA}
  DOXYGEN_OVERRIDE_PARAMS = QUIET=YES PROJECT_NUMBER=$(LUFA_VERSION_NUM)
41
  
42
  # Remove all object and associated files from the LUFA library core
43
44
  clean:
	rm -f $(LUFA_SRC_ALL_FILES:%.c=%.o)
45
	rm -f $(LUFA_SRC_ALL_FILES:%.c=%.d)
46
47
	rm -f $(LUFA_SRC_ALL_FILES:%.c=%.lst)

48
49
50
  include Build/lufa_core.mk
  include Build/lufa_sources.mk
  include Build/lufa_doxygen.mk
51
endif
52
53

.PHONY: all export_tar version clean