CC=arm-none-eabi-gcc
AR=arm-none-eabi-ar
###########################################
vpath %.c rtx/TARGET_CORTEX_M
vpath %.S rtx/TARGET_CORTEX_M/TARGET_RTOS_M4_M7/TOOLCHAIN_GCC
SRCS = rtos/rtos_idle.c \
HAL_CM.c \
rt_CMSIS.c \
rt_Event.c \
rt_List.c \
rt_Mailbox.c \
rt_MemBox.c \
rt_Mutex.c \
rt_Robin.c \
rt_Semaphore.c \
rt_System.c \
rt_Task.c \
rt_Time.c \
RTX_Conf_CM.c \
HAL_CM4.S \
SVC_Table.S
OBJS = $(patsubst %.S,%.o, $(patsubst %.c,%.o, $(SRCS)))
all: librtos.a
%.o : %.c
$(CC) $(CFLAGS) -c -o $@ $<
%.o : %.S
$(CC) $(CFLAGS) -c -o $@ $<
librtos.a: $(OBJS)
$(AR) -r $@ $(OBJS)
clean:
rm -f $(OBJS) librtos.a
'>
blob: 6da552d84766c9aea811df665b3712b13acfb598 (
plain) (
blame)
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
|
# This duplicates more of sw/thirdparty/libtfm/Makefile than I
# would like, but it does the job. Prettier makefiles can wait for another day.
# vpath %.c ${LIBTFM_SRC}
# vpath %.h ${LIBTFM_SRC}
BITS := 8192
HDR := ${LIBTFM_SRC}/tomsfastmath/src/headers/tfm.h
LIB := tomsfastmath/libtfm.a
#CFLAGS += -DTFM_X86
#CFLAGS += -DTFM_NO_ASM
CFLAGS += -fPIC -Wall -W -Wshadow -I${LIBTFM_SRC}/tomsfastmath/src/headers -g3 -DFP_MAX_SIZE="(${BITS}*2+(8*DIGIT_BIT))"
TARGETS := $(notdir ${HDR} ${LIB})
all: ${TARGETS}
clean:
rm -rf ${TARGETS} $(notdir ${HDR}.tmp) ${LIB} tomsfastmath/src
distclean: clean
rm -f TAGS
$(notdir ${HDR}): ${HDR}
echo >$@.tmp '/* Configure size of largest bignum we want to handle -- see notes in tfm.pdf */'
echo >>$@.tmp '#define FP_MAX_SIZE (${BITS}*2+(8*DIGIT_BIT))'
echo >>$@.tmp ''
cat >>$@.tmp $^
mv -f $@.tmp $@
$(notdir ${LIB}): ${LIB}
ln -f $^ $@
${LIB}: ${HDR}
(cd ${LIBTFM_SRC} && find tomsfastmath/src -type d) | xargs mkdir -p
cd tomsfastmath; ${MAKE} CFLAGS='${CFLAGS}'
|