-
Notifications
You must be signed in to change notification settings - Fork 0
/
libraries.mak
111 lines (85 loc) · 3.7 KB
/
libraries.mak
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#
# Makefile snippet to build libraries for teensy-duino in your project space.
#
LIB_C_FILES = analog.c mk20dx128.c nonstd.c pins_teensy.c serial1.c
LIB_C_FILES += usb_desc.c usb_dev.c usb_inst.c usb_mem.c usb_midi.c usb_seremu.c usb_serial.c
LIB_CPP_FILES = AudioStream.cpp DMAChannel.cpp EventResponder.cpp \
HardwareSerial.cpp HardwareSerial1.cpp IntervalTimer.cpp Print.cpp \
WMath.cpp WString.cpp avr_emulation.cpp i2c_t3.cpp main.cpp \
new.cpp serialEvent.cpp usb_audio.cpp yield.cpp
LIBOBJDIR ?= ${OBJDIR}
LIB_OBJS := $(LIB_C_FILES:.c=.o) $(LIB_CPP_FILES:.cpp=.o)
LIB_OBJS := $(addprefix $(LIBOBJDIR)/,$(LIB_OBJS))
$(LIBOBJDIR)/%.o : $(LIBRARYPATH)/src/%.c | ${LIBOBJDIR}
@echo Compiling $@ from $<
@$(COMPILE.c) $(OUTPUT_OPTION) $<
$(LIBOBJDIR)/%.o : $(LIBRARYPATH)/src/%.cpp | ${LIBOBJDIR}
@echo Compiling $@ from $<
@$(COMPILE.cpp) $(OUTPUT_OPTION) $<
$(TEENSY_LIB): $(LIB_OBJS) | ${LIBDIR}
@echo Collecting library $@
@$(AR) $(ARFLAGS) $@ $(LIB_OBJS)
AUDIO_LIB_CPP_FILES = control_sgtl5000.cpp effect_multiply.cpp filter_biquad.cpp \
mixer.cpp output_i2s.cpp output_pt8211.cpp play_memory.cpp play_memory2.cpp \
synth_dc.cpp synth_simple_drum.cpp synth_sine.cpp synth_whitenoise.cpp
AUDIO_LIB_C_FILES = data_ulaw.c data_waveforms.c
AUDIO_LIB_S_FILES = memcpy_audio.S
AUDIO_OBJS := $(addprefix $(LIBOBJDIR)/,$(AUDIO_LIB_C_FILES:.c=.o) \
$(AUDIO_LIB_CPP_FILES:.cpp=.o) $(AUDIO_LIB_S_FILES:.S=.o))
$(LIBOBJDIR)/%.o : $(LIBRARYPATH)/Audio/%.c | $(LIBOBJDIR)
@echo Compiling $@ from $<
@$(COMPILE.c) $(OUTPUT_OPTION) $<
$(LIBOBJDIR)/%.o : $(LIBRARYPATH)/Audio/%.S | $(LIBOBJDIR)
@echo Compiling $@ from $<
@$(COMPILE.S) $(OUTPUT_OPTION) $<
$(LIBOBJDIR)/%.o : $(LIBRARYPATH)/Audio/%.cpp | $(LIBOBJDIR)
@echo Compiling $@ from $<
@$(COMPILE.cpp) $(OUTPUT_OPTION) $<
$(AUDIO_LIB): $(AUDIO_OBJS) | ${LIBDIR}
@echo Collecting library $@
@$(AR) $(ARFLAGS) $@ $(AUDIO_OBJS)
BOUNCE_LIB_CPP_FILES = Bounce.cpp
BOUNCE_LIB_C_FILES =
BOUNCE_OBJS := $(addprefix $(LIBOBJDIR)/,$(BOUNCE_LIB_C_FILES:.c=.o) \
$(BOUNCE_LIB_CPP_FILES:.cpp=.o))
$(LIBOBJDIR)/%.o : $(LIBRARYPATH)/Bounce/%.c | $(LIBOBJDIR)
@echo Compiling $@ from $<
@$(COMPILE.c) $(OUTPUT_OPTION) $<
$(LIBOBJDIR)/%.o : $(LIBRARYPATH)/Bounce/%.cpp | $(LIBOBJDIR)
@echo Compiling $@ from $<
@$(COMPILE.cpp) $(OUTPUT_OPTION) $<
$(BOUNCE_LIB): $(BOUNCE_OBJS) | ${LIBDIR}
@echo Collecting library $@
@$(AR) $(ARFLAGS) $@ $(BOUNCE_OBJS)
WIRE_LIB_CPP_FILES = Wire.cpp WireKinetis.cpp
WIRE_LIB_C_FILES =
WIRE_OBJS := $(addprefix $(LIBOBJDIR)/,$(WIRE_LIB_C_FILES:.c=.o) \
$(WIRE_LIB_CPP_FILES:.cpp=.o))
$(LIBOBJDIR)/%.o : $(LIBRARYPATH)/Wire/%.c | $(LIBOBJDIR)
@echo Compiling $@ from $<
@$(COMPILE.c) $(OUTPUT_OPTION) $<
$(LIBOBJDIR)/%.o : $(LIBRARYPATH)/Wire/%.cpp | $(LIBOBJDIR)
@echo Compiling $@ from $<
@$(COMPILE.cpp) $(OUTPUT_OPTION) $<
$(WIRE_LIB): $(WIRE_OBJS) | ${LIBDIR}
@echo Collecting library $@
@$(AR) $(ARFLAGS) $@ $(WIRE_OBJS)
SD_LIB_CPP_FILES = File.cpp SD.cpp Sd2Card.cpp SdFile.cpp SdVolume.cpp
SD_OBJS := $(addprefix $(LIBOBJDIR)/,$(SD_LIB_CPP_FILES:.cpp=.o))
$(LIBOBJDIR)/%.o : $(LIBRARYPATH)/SD/%.cpp | $(LIBOBJDIR)
@echo Compiling $@ from $<
@$(COMPILE.cpp) $(OUTPUT_OPTION) $<
$(LIBOBJDIR)/%.o : $(LIBRARYPATH)/SD/utility/%.cpp | $(LIBOBJDIR)
@echo Compiling $@ from $<
@$(COMPILE.cpp) -I$(LIBRARYPATH)/SD/utility $(OUTPUT_OPTION) $<
$(SD_LIB): $(SD_OBJS) | ${LIBDIR}
@echo Collecting library $@
@$(AR) $(ARFLAGS) $@ $(SD_OBJS)
SPI_LIB_CPP_FILES = SPI.cpp
SPI_OBJS := $(addprefix $(LIBOBJDIR)/,$(SPI_LIB_CPP_FILES:.cpp=.o))
$(LIBOBJDIR)/%.o : $(LIBRARYPATH)/SPI/%.cpp | $(LIBOBJDIR)
@echo Compiling $@ from $<
@$(COMPILE.cpp) $(OUTPUT_OPTION) $<
$(SPI_LIB): $(SPI_OBJS) | ${LIBDIR}
@echo Collecting library $@
@$(AR) $(ARFLAGS) $@ $(SPI_OBJS)