gsmmap: Dump SYSTEM INFORMATION messages while processing
[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                         LIBOSMOCODEC_LIBS=$(TOPDIR)/shared/libosmocore/build-host/src/codec/.libs/libosmocodec.a \
17                         LIBOSMOCORE_CFLAGS=-I$(TOPDIR)/shared/libosmocore/include \
18                         LIBOSMOVTY_CFLAGS=-I$(TOPDIR)/shared/libosmocore/include \
19                         LIBOSMOGSM_CFLAGS=-I$(TOPDIR)/shared/libosmocore/include \
20                         LIBOSMOCODEC_CFLAGS=-I$(TOPDIR)/shared/libosmocore/include
21
22 all: libosmocore-target nofirmware firmware mtk-firmware
23 nofirmware: libosmocore-host layer23 osmocon gsmmap
24
25 libosmocore-host: shared/libosmocore/build-host/src/.libs/libosmocore.la
26
27 shared/libosmocore/build-host:
28         mkdir $@
29
30 shared/libosmocore/configure: shared/libosmocore/configure.ac
31         cd shared/libosmocore && autoreconf -i
32
33 shared/libosmocore/build-host/Makefile: shared/libosmocore/configure shared/libosmocore/build-host
34         cd shared/libosmocore/build-host && ../configure $(HOST_CONFARGS)
35
36 shared/libosmocore/build-host/src/.libs/libosmocore.la: shared/libosmocore/build-host/Makefile
37         cd shared/libosmocore/build-host && make
38
39
40 libosmocore-target: shared/libosmocore/build-target/src/.libs/libosmocore.a
41
42 shared/libosmocore/build-target:
43         mkdir $@
44
45 shared/libosmocore/build-target/Makefile: shared/libosmocore/configure shared/libosmocore/build-target
46         cd shared/libosmocore/build-target && ../configure \
47                         --host=$(CROSS_HOST) --disable-vty --enable-panic-infloop \
48                         --disable-shared --disable-talloc \
49                         --disable-tests ac_cv_header_sys_select_h=no \
50                         --disable-tests ac_cv_header_sys_socket_h=no \
51                 CFLAGS="-Os -ffunction-sections -I$(TOPDIR)/target/firmware/include -nostartfiles -nodefaultlibs"
52
53 shared/libosmocore/build-target/src/.libs/libosmocore.a: shared/libosmocore/build-target/Makefile
54         cd shared/libosmocore/build-target && make
55
56
57 .PHONY: osmocon
58 osmocon: host/osmocon/osmocon
59
60 host/osmocon/configure: host/osmocon/configure.ac
61         cd host/osmocon && autoreconf -i
62
63 host/osmocon/Makefile: host/osmocon/configure
64         cd host/osmocon && $(OSMOCORE_CONFIGURE_ENV) ./configure $(HOST_CONFARGS)
65
66 host/osmocon/osmocon: host/osmocon/Makefile libosmocore-host
67         make -C host/osmocon
68
69
70 .PHONY: gsmmap
71 gsmmap: host/gsmmap/gsmmap
72
73 host/gsmmap/configure: host/gsmmap/configure.ac
74         cd host/gsmmap && autoreconf -i
75
76 host/gsmmap/Makefile: host/gsmmap/configure
77         cd host/gsmmap && $(OSMOCORE_CONFIGURE_ENV) ./configure $(HOST_CONFARGS)
78
79 host/gsmmap/gsmmap: host/gsmmap/Makefile libosmocore-host
80         make -C host/gsmmap
81
82
83 .PHONY: layer23
84 layer23: host/layer23/layer23
85
86 host/layer23/configure: host/layer23/configure.ac
87         cd host/layer23 && autoreconf -i
88
89 host/layer23/Makefile: host/layer23/configure
90         cd host/layer23 && $(OSMOCORE_CONFIGURE_ENV) ./configure $(HOST_CONFARGS)
91
92 host/layer23/layer23: host/layer23/Makefile libosmocore-host
93         make -C host/layer23
94
95
96 .PHONY: firmware
97 firmware: libosmocore-target
98         make -C target/firmware CROSS_COMPILE=$(CROSS_TOOL_PREFIX)
99
100 .PHONY: mtk-firmware
101 mtk-firmware: libosmocore-target
102         make -C target/firmware -f Makefile.mtk CROSS_COMPILE=$(CROSS_TOOL_PREFIX)
103
104
105 clean:
106         make -C shared/libosmocore/build-host $@
107         make -C shared/libosmocore/build-target $@
108         make -C host/layer23 $@
109         make -C host/osmocon $@
110         make -C target/firmware $@
111         make -C target/firmware -f Makefile.mtk $@
112
113 distclean:
114         rm -rf shared/libosmocore/build-host
115         rm -rf shared/libosmocore/build-target
116         make -C host/layer23 $@
117         make -C host/osmocon $@
118 # 'firmware' also handles 'mtk-firmware'
119         make -C target/firmware $@