2 # this is not really used as we don't do 'make install'. You can still specify
3 # it in case you _want_ to manually 'make install' the target libosmocore.
4 CROSS_INST_PREFIX ?= /usr/local/stow/osmocom-bb/arm-2010.09
6 # this is the host tuple of your cross-toolchain
7 CROSS_HOST ?= $(shell which arm-elf-gcc >/dev/null 2>&1 && echo arm-elf || echo arm-none-eabi)
9 # this is the prefix of your cross-toolchain programs
10 CROSS_TOOL_PREFIX=$(CROSS_HOST)-
13 OSMOCORE_CONFIGURE_ENV= LIBOSMOCORE_LIBS=$(TOPDIR)/shared/libosmocore/build-host/src/.libs/libosmocore.a \
14 LIBOSMOVTY_LIBS=$(TOPDIR)/shared/libosmocore/build-host/src/vty/.libs/libosmovty.a \
15 LIBOSMOGSM_LIBS=$(TOPDIR)/shared/libosmocore/build-host/src/gsm/.libs/libosmogsm.a \
16 LIBOSMOCORE_CFLAGS=-I$(TOPDIR)/shared/libosmocore/include \
17 LIBOSMOVTY_CFLAGS=-I$(TOPDIR)/shared/libosmocore/include \
18 LIBOSMOGSM_CFLAGS=-I$(TOPDIR)/shared/libosmocore/include
20 all: libosmocore-target nofirmware firmware mtk-firmware
21 nofirmware: libosmocore-host layer23 osmocon gsmmap
23 libosmocore-host: shared/libosmocore/build-host/src/.libs/libosmocore.la
25 shared/libosmocore/build-host:
28 shared/libosmocore/configure: shared/libosmocore/configure.in
29 cd shared/libosmocore && autoreconf -i
31 shared/libosmocore/build-host/Makefile: shared/libosmocore/configure shared/libosmocore/build-host
32 cd shared/libosmocore/build-host && ../configure $(HOST_CONFARGS)
34 shared/libosmocore/build-host/src/.libs/libosmocore.la: shared/libosmocore/build-host/Makefile
35 cd shared/libosmocore/build-host && make
38 libosmocore-target: shared/libosmocore/build-target/src/.libs/libosmocore.a
40 shared/libosmocore/build-target:
43 shared/libosmocore/build-target/Makefile: shared/libosmocore/configure shared/libosmocore/build-target
44 cd shared/libosmocore/build-target && ../configure \
45 --host=$(CROSS_HOST) --disable-vty --enable-panic-infloop \
46 --disable-shared --disable-talloc --disable-tests ac_cv_header_sys_select_h=no \
47 CFLAGS="-Os -ffunction-sections -I$(TOPDIR)/target/firmware/include -nostartfiles -nodefaultlibs"
49 shared/libosmocore/build-target/src/.libs/libosmocore.a: shared/libosmocore/build-target/Makefile
50 cd shared/libosmocore/build-target && make
54 osmocon: host/osmocon/osmocon
56 host/osmocon/configure: host/osmocon/configure.ac
57 cd host/osmocon && autoreconf -i
59 host/osmocon/Makefile: host/osmocon/configure
60 cd host/osmocon && $(OSMOCORE_CONFIGURE_ENV) ./configure $(HOST_CONFARGS)
62 host/osmocon/osmocon: host/osmocon/Makefile libosmocore-host
67 gsmmap: host/gsmmap/gsmmap
69 host/gsmmap/configure: host/gsmmap/configure.ac
70 cd host/gsmmap && autoreconf -i
72 host/gsmmap/Makefile: host/gsmmap/configure
73 cd host/gsmmap && $(OSMOCORE_CONFIGURE_ENV) ./configure $(HOST_CONFARGS)
75 host/gsmmap/gsmmap: host/gsmmap/Makefile libosmocore-host
80 layer23: host/layer23/layer23
82 host/layer23/configure: host/layer23/configure.ac
83 cd host/layer23 && autoreconf -i
85 host/layer23/Makefile: host/layer23/configure
86 cd host/layer23 && $(OSMOCORE_CONFIGURE_ENV) ./configure $(HOST_CONFARGS)
88 host/layer23/layer23: host/layer23/Makefile libosmocore-host
93 firmware: libosmocore-target
94 make -C target/firmware CROSS_COMPILE=$(CROSS_TOOL_PREFIX)
97 mtk-firmware: libosmocore-target
98 make -C target/firmware -f Makefile.mtk CROSS_COMPILE=$(CROSS_TOOL_PREFIX)
102 make -C shared/libosmocore/build-host $@
103 make -C shared/libosmocore/build-target $@
104 make -C host/layer23 $@
105 make -C host/osmocon $@
106 make -C target/firmware $@
107 make -C target/firmware -f Makefile.mtk $@
110 rm -rf shared/libosmocore/build-host
111 rm -rf shared/libosmocore/build-target
112 make -C host/layer23 $@
113 make -C host/osmocon $@
114 # 'firmware' also handles 'mtk-firmware'
115 make -C target/firmware $@