makefile 1.46 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 *.lss *.lst *.hex *.elf *.hex *.eep *.map *.bin *.d
14

15
DOXYGEN_OVERRIDE_PARAMS = PROJECT_NUMBER=$(LUFA_VERSION_NUM)
16

17
18
all:

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
version:
26
	@echo "LUFA $(LUFA_VERSION_NUM)"
27

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

  LUFA_PATH           = .
  ARCH                = {AVR8,UC3,XMEGA}
38
39
40
  
  clean:
	rm -f $(LUFA_SRC_ALL_FILES:%.c=%.o)
41
	rm -f $(LUFA_SRC_ALL_FILES:%.c=%.o.d)
42
43
44
	rm -f $(LUFA_SRC_ALL_FILES:%.c=%.lst)

  # Include LUFA build script makefiles
45
  include Build/lufa.core.in
46
47
  include Build/lufa.sources.in
  include Build/lufa.doxygen.in
48
endif