forked from psgroove/psgroove
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.lufa
54 lines (36 loc) · 1.03 KB
/
Makefile.lufa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
include Makefile.conf
TARGET = lufa
# Object files directory
# To put object files in current directory, use a dot (.), do NOT make
# this an empty or blank macro!
OBJDIR = .
# Path to the LUFA library
LUFA_PATH = lufa-lib/trunk
# Create the LUFA source path variables by including the LUFA root makefile
include $(LUFA_PATH)/LUFA/makefile
# List C source files here. (C dependencies are automatically generated.)
SRC = $(LUFA_SRC_USB)
EXTRAINCDIRS = $(LUFA_PATH)/
# Define programs and commands.
CC = avr-gcc
AR = avr-ar
REMOVE = rm -f
REMOVEDIR = rm -rf
OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
GENDEPFLAGS = -MMD -MP -MF .depl/$(@F).d
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
all: deps lib
deps:
@mkdir -p .depl
LIBNAME=lib$(TARGET).a
lib: $(LIBNAME)
%.a: $(OBJ)
$(AR) r $@ $(OBJ)
%.o : %.c
$(CC) -c $(ALL_CFLAGS) $< -o $@
clean:
$(REMOVE) $(LIBNAME)
$(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
$(REMOVEDIR) .depl
-include $(wildcard .depl/*)
.PHONY: all lib clean deps