forked from exo/tvm-rcx
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.am
53 lines (43 loc) · 956 Bytes
/
Makefile.am
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
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I ../../m4
CPPFLAGS = \
-Ilibtvm \
-I../../runtime/libtvm \
@CPPFLAGS@
LDFLAGS = -Llibtvm @LDFLAGS@
LIBS = -ltvm @LIBGCC@ @LIBS@
noinst_PROGRAMS = tvm_rcx
tvm_rcx_SOURCES = \
librcx.c \
systime.c \
ffi.c \
tvm.c \
tvm-rcx.c
%.coff: $(tvm_rcx_OBJECTS)
$(LD) $(LDFLAGS) \
-o $@ -T rcx.lds \
$(tvm_rcx_OBJECTS) \
$(LIBS)
%.srec: %.coff
$(OBJCOPY) -O srec $< $@
tvm_rcx: tvm-rcx.coff tvm-rcx.srec
touch $@
# All the source files need libtvm to be built first.
$(tvm_rcx_SOURCES): libtvm/libtvm.a
# Rebuild libtvm if we've been reconfigured.
libtvm/libtvm.a: config.status
rm -fr libtvm
mkdir libtvm
cd libtvm && ../../../runtime/libtvm/configure \
--host=h8300-hms \
--with-memory-allocator=none \
--enable-custom-memory-ops \
CFLAGS="@CFLAGS@" \
LDFLAGS="@LDFLAGS@"
$(MAKE) -C libtvm
CLEANFILES = \
tvm_rcx \
tvm-rcx.coff \
tvm-rcx.srec
distclean-local:
rm -Rf libtvm