[layer23] Correctly report to restart mobile instance after band change
[osmocom-bb.git] / src / Makefile
1
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
5
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)
8
9 # this is the prefix of your cross-toolchain programs
10 CROSS_TOOL_PREFIX=$(CROSS_HOST)-
11
12 TOPDIR=$(shell pwd)
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
19
20 all: libosmocore-target nofirmware firmware mtk-firmware
21 nofirmware: libosmocore-host layer23 osmocon gsmmap
22
23 libosmocore-host: shared/libosmocore/build-host/src/.libs/libosmocore.la
24
25 shared/libosmocore/build-host:
26         mkdir $@
27
28 shared/libosmocore/configure: shared/libosmocore/configure.ac
29         cd shared/libosmocore && autoreconf -i
30
31 shared/libosmocore/build-host/Makefile: shared/libosmocore/configure shared/libosmocore/build-host
32         cd shared/libosmocore/build-host && ../configure $(HOST_CONFARGS)
33
34 shared/libosmocore/build-host/src/.libs/libosmocore.la: shared/libosmocore/build-host/Makefile
35         cd shared/libosmocore/build-host && make
36
37
38 libosmocore-target: shared/libosmocore/build-target/src/.libs/libosmocore.a
39
40 shared/libosmocore/build-target:
41         mkdir $@
42
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 \
47                         --disable-tests ac_cv_header_sys_select_h=no \
48                         --disable-tests ac_cv_header_sys_socket_h=no \
49                 CFLAGS="-Os -ffunction-sections -I$(TOPDIR)/target/firmware/include -nostartfiles -nodefaultlibs"
50
51 shared/libosmocore/build-target/src/.libs/libosmocore.a: shared/libosmocore/build-target/Makefile
52         cd shared/libosmocore/build-target && make
53
54
55 .PHONY: osmocon
56 osmocon: host/osmocon/osmocon
57
58 host/osmocon/configure: host/osmocon/configure.ac
59         cd host/osmocon && autoreconf -i
60
61 host/osmocon/Makefile: host/osmocon/configure
62         cd host/osmocon && $(OSMOCORE_CONFIGURE_ENV) ./configure $(HOST_CONFARGS)
63
64 host/osmocon/osmocon: host/osmocon/Makefile libosmocore-host
65         make -C host/osmocon
66
67
68 .PHONY: gsmmap
69 gsmmap: host/gsmmap/gsmmap
70
71 host/gsmmap/configure: host/gsmmap/configure.ac
72         cd host/gsmmap && autoreconf -i
73
74 host/gsmmap/Makefile: host/gsmmap/configure
75         cd host/gsmmap && $(OSMOCORE_CONFIGURE_ENV) ./configure $(HOST_CONFARGS)
76
77 host/gsmmap/gsmmap: host/gsmmap/Makefile libosmocore-host
78         make -C host/gsmmap
79
80
81 .PHONY: layer23
82 layer23: host/layer23/layer23
83
84 host/layer23/configure: host/layer23/configure.ac
85         cd host/layer23 && autoreconf -i
86
87 host/layer23/Makefile: host/layer23/configure
88         cd host/layer23 && $(OSMOCORE_CONFIGURE_ENV) ./configure $(HOST_CONFARGS)
89
90 host/layer23/layer23: host/layer23/Makefile libosmocore-host
91         make -C host/layer23
92
93
94 .PHONY: firmware
95 firmware: libosmocore-target
96         make -C target/firmware CROSS_COMPILE=$(CROSS_TOOL_PREFIX)
97
98 .PHONY: mtk-firmware
99 mtk-firmware: libosmocore-target
100         make -C target/firmware -f Makefile.mtk CROSS_COMPILE=$(CROSS_TOOL_PREFIX)
101
102
103 clean:
104         make -C shared/libosmocore/build-host $@
105         make -C shared/libosmocore/build-target $@
106         make -C host/layer23 $@
107         make -C host/osmocon $@
108         make -C target/firmware $@
109         make -C target/firmware -f Makefile.mtk $@
110
111 distclean:
112         rm -rf shared/libosmocore/build-host
113         rm -rf shared/libosmocore/build-target
114         make -C host/layer23 $@
115         make -C host/osmocon $@
116 # 'firmware' also handles 'mtk-firmware'
117         make -C target/firmware $@