2010-02-20 22:13:25 +00:00
|
|
|
|
|
|
|
# this is not really used as we don't do 'make install'. You can still specify
|
|
|
|
# it in case you _want_ to manually 'make install' the target libosmocore.
|
2011-03-12 13:38:08 +00:00
|
|
|
CROSS_INST_PREFIX ?= /usr/local/stow/osmocom-bb/arm-2010.09
|
|
|
|
|
|
|
|
# this is the host tuple of your cross-toolchain
|
|
|
|
CROSS_HOST ?= $(shell which arm-elf-gcc >/dev/null 2>&1 && echo arm-elf || echo arm-none-eabi)
|
2010-02-20 22:13:25 +00:00
|
|
|
|
|
|
|
# this is the prefix of your cross-toolchain programs
|
2011-03-12 13:38:08 +00:00
|
|
|
CROSS_TOOL_PREFIX=$(CROSS_HOST)-
|
2010-02-20 22:13:25 +00:00
|
|
|
|
|
|
|
TOPDIR=$(shell pwd)
|
|
|
|
OSMOCORE_CONFIGURE_ENV= LIBOSMOCORE_LIBS=$(TOPDIR)/shared/libosmocore/build-host/src/.libs/libosmocore.a \
|
2010-06-26 14:00:29 +00:00
|
|
|
LIBOSMOVTY_LIBS=$(TOPDIR)/shared/libosmocore/build-host/src/vty/.libs/libosmovty.a \
|
2011-04-26 00:55:30 +00:00
|
|
|
LIBOSMOGSM_LIBS=$(TOPDIR)/shared/libosmocore/build-host/src/gsm/.libs/libosmogsm.a \
|
2010-06-26 14:00:29 +00:00
|
|
|
LIBOSMOCORE_CFLAGS=-I$(TOPDIR)/shared/libosmocore/include \
|
2011-04-26 00:55:30 +00:00
|
|
|
LIBOSMOVTY_CFLAGS=-I$(TOPDIR)/shared/libosmocore/include \
|
|
|
|
LIBOSMOGSM_CFLAGS=-I$(TOPDIR)/shared/libosmocore/include
|
2010-02-20 22:13:25 +00:00
|
|
|
|
2011-05-04 20:58:17 +00:00
|
|
|
all: libosmocore-target nofirmware firmware mtk-firmware
|
2010-11-21 17:24:10 +00:00
|
|
|
nofirmware: libosmocore-host layer23 osmocon gsmmap
|
2010-02-20 22:13:25 +00:00
|
|
|
|
|
|
|
libosmocore-host: shared/libosmocore/build-host/src/.libs/libosmocore.la
|
|
|
|
|
|
|
|
shared/libosmocore/build-host:
|
|
|
|
mkdir $@
|
|
|
|
|
2011-05-29 13:55:24 +00:00
|
|
|
shared/libosmocore/configure: shared/libosmocore/configure.ac
|
2010-02-20 22:13:25 +00:00
|
|
|
cd shared/libosmocore && autoreconf -i
|
|
|
|
|
|
|
|
shared/libosmocore/build-host/Makefile: shared/libosmocore/configure shared/libosmocore/build-host
|
2010-11-17 21:35:18 +00:00
|
|
|
cd shared/libosmocore/build-host && ../configure $(HOST_CONFARGS)
|
2010-02-20 22:13:25 +00:00
|
|
|
|
|
|
|
shared/libosmocore/build-host/src/.libs/libosmocore.la: shared/libosmocore/build-host/Makefile
|
|
|
|
cd shared/libosmocore/build-host && make
|
|
|
|
|
|
|
|
|
|
|
|
libosmocore-target: shared/libosmocore/build-target/src/.libs/libosmocore.a
|
|
|
|
|
|
|
|
shared/libosmocore/build-target:
|
|
|
|
mkdir $@
|
|
|
|
|
|
|
|
shared/libosmocore/build-target/Makefile: shared/libosmocore/configure shared/libosmocore/build-target
|
2010-03-07 19:42:17 +00:00
|
|
|
cd shared/libosmocore/build-target && ../configure \
|
2011-03-12 13:38:08 +00:00
|
|
|
--host=$(CROSS_HOST) --disable-vty --enable-panic-infloop \
|
2011-04-23 19:11:08 +00:00
|
|
|
--disable-shared --disable-talloc --disable-tests ac_cv_header_sys_select_h=no \
|
2011-03-12 13:38:08 +00:00
|
|
|
CFLAGS="-Os -ffunction-sections -I$(TOPDIR)/target/firmware/include -nostartfiles -nodefaultlibs"
|
2010-02-20 22:13:25 +00:00
|
|
|
|
|
|
|
shared/libosmocore/build-target/src/.libs/libosmocore.a: shared/libosmocore/build-target/Makefile
|
|
|
|
cd shared/libosmocore/build-target && make
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: osmocon
|
|
|
|
osmocon: host/osmocon/osmocon
|
|
|
|
|
|
|
|
host/osmocon/configure: host/osmocon/configure.ac
|
|
|
|
cd host/osmocon && autoreconf -i
|
|
|
|
|
|
|
|
host/osmocon/Makefile: host/osmocon/configure
|
2010-11-17 21:35:18 +00:00
|
|
|
cd host/osmocon && $(OSMOCORE_CONFIGURE_ENV) ./configure $(HOST_CONFARGS)
|
2010-02-20 22:13:25 +00:00
|
|
|
|
|
|
|
host/osmocon/osmocon: host/osmocon/Makefile libosmocore-host
|
|
|
|
make -C host/osmocon
|
|
|
|
|
|
|
|
|
2010-10-24 14:12:58 +00:00
|
|
|
.PHONY: gsmmap
|
|
|
|
gsmmap: host/gsmmap/gsmmap
|
|
|
|
|
|
|
|
host/gsmmap/configure: host/gsmmap/configure.ac
|
|
|
|
cd host/gsmmap && autoreconf -i
|
|
|
|
|
|
|
|
host/gsmmap/Makefile: host/gsmmap/configure
|
2010-11-17 21:35:18 +00:00
|
|
|
cd host/gsmmap && $(OSMOCORE_CONFIGURE_ENV) ./configure $(HOST_CONFARGS)
|
2010-10-24 14:12:58 +00:00
|
|
|
|
|
|
|
host/gsmmap/gsmmap: host/gsmmap/Makefile libosmocore-host
|
|
|
|
make -C host/gsmmap
|
|
|
|
|
|
|
|
|
2010-03-03 13:39:58 +00:00
|
|
|
.PHONY: layer23
|
|
|
|
layer23: host/layer23/layer23
|
2010-02-20 22:13:25 +00:00
|
|
|
|
2010-03-03 13:39:58 +00:00
|
|
|
host/layer23/configure: host/layer23/configure.ac
|
|
|
|
cd host/layer23 && autoreconf -i
|
2010-02-20 22:13:25 +00:00
|
|
|
|
2010-03-03 13:39:58 +00:00
|
|
|
host/layer23/Makefile: host/layer23/configure
|
2010-11-17 21:35:18 +00:00
|
|
|
cd host/layer23 && $(OSMOCORE_CONFIGURE_ENV) ./configure $(HOST_CONFARGS)
|
2010-02-20 22:13:25 +00:00
|
|
|
|
2010-03-03 13:39:58 +00:00
|
|
|
host/layer23/layer23: host/layer23/Makefile libosmocore-host
|
|
|
|
make -C host/layer23
|
2010-02-20 22:13:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
.PHONY: firmware
|
|
|
|
firmware: libosmocore-target
|
2010-03-07 01:02:44 +00:00
|
|
|
make -C target/firmware CROSS_COMPILE=$(CROSS_TOOL_PREFIX)
|
2010-02-20 22:13:25 +00:00
|
|
|
|
2011-05-04 20:58:17 +00:00
|
|
|
.PHONY: mtk-firmware
|
|
|
|
mtk-firmware: libosmocore-target
|
|
|
|
make -C target/firmware -f Makefile.mtk CROSS_COMPILE=$(CROSS_TOOL_PREFIX)
|
|
|
|
|
2010-02-20 22:13:25 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
make -C shared/libosmocore/build-host $@
|
|
|
|
make -C shared/libosmocore/build-target $@
|
2010-03-03 13:39:58 +00:00
|
|
|
make -C host/layer23 $@
|
2010-02-20 22:13:25 +00:00
|
|
|
make -C host/osmocon $@
|
|
|
|
make -C target/firmware $@
|
2011-05-04 20:58:17 +00:00
|
|
|
make -C target/firmware -f Makefile.mtk $@
|
2010-02-20 22:13:25 +00:00
|
|
|
|
|
|
|
distclean:
|
|
|
|
rm -rf shared/libosmocore/build-host
|
|
|
|
rm -rf shared/libosmocore/build-target
|
2010-03-03 13:39:58 +00:00
|
|
|
make -C host/layer23 $@
|
2010-02-20 22:13:25 +00:00
|
|
|
make -C host/osmocon $@
|
2011-05-04 20:58:17 +00:00
|
|
|
# 'firmware' also handles 'mtk-firmware'
|
2010-02-20 22:13:25 +00:00
|
|
|
make -C target/firmware $@
|