blob: 1c3a64a40010195d975487bc6d08345e30207934 [file] [log] [blame]
Harald Weltee844bf72019-05-06 15:25:10 +02001SUBDIRS = hnbap rua ranap sabp tests
Daniel Willmann29b9e002015-12-15 15:10:31 +01002
Harald Weltea95d5a52016-01-03 16:22:16 +01003# Build {hnbap,rua,ranap}_{encoder,decoder}.c using asn1tostruct
Neels Hofmeyrba03c432016-08-27 00:11:26 +02004ASN1_ROOT = $(top_srcdir)/asn1
Daniel Willmann29b9e002015-12-15 15:10:31 +01005ASN1TOSTRUCT = $(ASN1_ROOT)/utils/asn1tostruct.py
Harald Weltee844bf72019-05-06 15:25:10 +02006BUILT_SOURCES = hnbap_decoder.c hnbap_encoder.c rua_decoder.c rua_encoder.c sabp_encoder.c sabp_decoder.c \
7 gen_hnbap.stamp gen_rua.stamp gen_ranap.stamp gen_sabp.stamp
Neels Hofmeyrc51f7352015-12-22 12:21:16 +01008
Neels Hofmeyr83457922016-08-26 23:56:44 +02009gen_hnbap.stamp: $(ASN1_ROOT)/hnbap/HNBAP-PDU-Contents.asn $(ASN1TOSTRUCT)
Daniel Willmann29b9e002015-12-15 15:10:31 +010010 $(ASN1TOSTRUCT) -f $<
Neels Hofmeyr83457922016-08-26 23:56:44 +020011# We also need to replace the include in the newly generated .c files:
12 sed -i 's,^#include "hnbap_ies_defs.h",#include <osmocom/hnbap/hnbap_ies_defs.h>,' hnbap_encoder.c hnbap_decoder.c
13 sed -i 's,^#include "hnbap_common.h",#include <osmocom/hnbap/hnbap_common.h>,' hnbap_encoder.c hnbap_decoder.c hnbap_ies_defs.h
14 mv hnbap_ies_defs.h $(top_builddir)/include/osmocom/hnbap/
15# this is ugly ^. hnbap_ies_defs.h is generated from asn1tostruct.py here, but
16# it should live in include/osmocom/hnbap/.
17 touch $(top_builddir)/src/$@
Daniel Willmann29b9e002015-12-15 15:10:31 +010018
Neels Hofmeyr83457922016-08-26 23:56:44 +020019hnbap_decoder.c hnbap_encoder.c: gen_hnbap.stamp
20
21gen_rua.stamp: $(ASN1_ROOT)/rua/RUA-PDU-Contents.asn $(ASN1TOSTRUCT)
Daniel Willmann29b9e002015-12-15 15:10:31 +010022 $(ASN1TOSTRUCT) -p RUA_ -f $<
Neels Hofmeyr83457922016-08-26 23:56:44 +020023# We also need to replace the include in the newly generated .c files:
24 sed -i 's,^#include "rua_ies_defs.h",#include <osmocom/rua/rua_ies_defs.h>,' rua_encoder.c rua_decoder.c
25 sed -i 's,^#include "rua_common.h",#include <osmocom/rua/rua_common.h>,' rua_encoder.c rua_decoder.c rua_ies_defs.h
26 mv rua_ies_defs.h $(top_builddir)/include/osmocom/rua/
27# this is ugly ^. rua_ies_defs.h is generated from asn1tostruct.py here, but
28# it should live in include/osmocom/rua/.
29 touch $(top_builddir)/src/$@
30
31rua_decoder.c rua_encoder.c: gen_rua.stamp
Daniel Willmann29b9e002015-12-15 15:10:31 +010032
Alexander Huemer156fa392016-05-15 04:24:54 +020033gen_ranap.stamp: $(ASN1_ROOT)/ranap/RANAP-PDU-Contents.asn $(ASN1TOSTRUCT)
Daniel Willmann29b9e002015-12-15 15:10:31 +010034 $(ASN1TOSTRUCT) -p RANAP_ -f $<
Neels Hofmeyr96979af2016-01-05 15:19:44 +010035# We also need to replace the include in the newly generated .c files:
36 sed -i 's,^#include "ranap_ies_defs.h",#include <osmocom/ranap/ranap_ies_defs.h>,' ranap_encoder.c ranap_decoder.c
Daniel Willmann8fda3622016-01-06 14:18:51 +010037 sed -i 's,^#include "ranap_common.h",#include <osmocom/ranap/ranap_common.h>,' ranap_encoder.c ranap_decoder.c ranap_ies_defs.h
Neels Hofmeyr83457922016-08-26 23:56:44 +020038 mv ranap_ies_defs.h $(top_builddir)/include/osmocom/ranap/
Daniel Willmann8fda3622016-01-06 14:18:51 +010039# this is ugly ^. ranap_ies_defs.h is generated from asn1tostruct.py here, but
40# it should live in include/osmocom/ranap/.
Neels Hofmeyr83457922016-08-26 23:56:44 +020041 touch $(top_builddir)/src/$@
Harald Weltea95d5a52016-01-03 16:22:16 +010042
Neels Hofmeyr83457922016-08-26 23:56:44 +020043ranap_decoder.c ranap_encoder.c: gen_ranap.stamp
44
Harald Weltee844bf72019-05-06 15:25:10 +020045gen_sabp.stamp: $(ASN1_ROOT)/sabp/SABP-PDU-Contents.asn $(ASN1TOSTRUCT)
46 $(ASN1TOSTRUCT) -p SABP_ -f $<
47# We also need to replace the include in the newly generated .c files:
48 sed -i 's,^#include "sabp_ies_defs.h",#include <osmocom/sabp/sabp_ies_defs.h>,' sabp_encoder.c sabp_decoder.c
49 sed -i 's,^#include "sabp_common.h",#include <osmocom/sabp/sabp_common.h>,' sabp_encoder.c sabp_decoder.c sabp_ies_defs.h
50 mv sabp_ies_defs.h $(top_builddir)/include/osmocom/sabp/
51# this is ugly ^. sabp_ies_defs.h is generated from asn1tostruct.py here, but
52# it should live in include/osmocom/sabp/.
53 touch $(top_builddir)/src/$@
54
55sabp_decoder.c sabp_encoder.c: gen_sabp.stamp
56
57
Harald Welte47bba702017-11-21 07:56:17 +010058AM_CFLAGS = -Wall -I$(top_srcdir)/include -I$(top_builddir)/include \
Maxef727412017-12-26 19:27:43 +010059 $(OSMOCORE_CFLAGS) $(OSMOVTY_CFLAGS) $(OSMOCTRL_CFLAGS) $(OSMOGSM_CFLAGS) \
Neels Hofmeyr83457922016-08-26 23:56:44 +020060 $(OSMONETIF_CFLAGS) $(ASN1C_CFLAGS) $(OSMOSIGTRAN_CFLAGS)
Harald Weltea95d5a52016-01-03 16:22:16 +010061
Harald Weltee844bf72019-05-06 15:25:10 +020062# build the shared RANAP + SABP library
Harald Weltea95d5a52016-01-03 16:22:16 +010063#
Pau Espin Pedrol67d32a02020-01-03 17:04:15 +010064RANAP_LIBVERSION=3:0:0
Harald Weltee844bf72019-05-06 15:25:10 +020065SABP_LIBVERSION=0:0:0
66lib_LTLIBRARIES = libosmo-ranap.la libosmo-sabp.la
Harald Weltea95d5a52016-01-03 16:22:16 +010067libosmo_ranap_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(RANAP_LIBVERSION)
Harald Welte493366e2017-10-28 13:55:29 +020068libosmo_ranap_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOVTY_LIBS) $(OSMOSIGTRAN_LIBS) \
Neels Hofmeyrdfc75df2017-11-16 09:47:08 +010069 $(ASN1C_LIBS) ranap/libosmo-asn1-ranap.la
Harald Welte5c6bd512016-01-05 15:05:03 +010070libosmo_ranap_la_SOURCES = ranap_common.c ranap_encoder.c ranap_decoder.c ranap_msg_factory.c iu_helpers.c \
Neels Hofmeyraae68b22017-07-05 14:38:52 +020071 ranap_common_cn.c iu_client.c iu_client_vty.c
Harald Weltea95d5a52016-01-03 16:22:16 +010072
Harald Weltee844bf72019-05-06 15:25:10 +020073libosmo_sabp_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(SABP_LIBVERSION)
74libosmo_sabp_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOVTY_LIBS) $(OSMOSIGTRAN_LIBS) \
75 $(ASN1C_LIBS) sabp/libosmo-asn1-sabp.la
76libosmo_sabp_la_SOURCES = sabp_common.c sabp_encoder.c sabp_decoder.c
77
78
Harald Weltea95d5a52016-01-03 16:22:16 +010079# build the actual HomeNodeB gateway
80#
81bin_PROGRAMS = osmo-hnbgw
82
Harald Weltea95d5a52016-01-03 16:22:16 +010083osmo_hnbgw_SOURCES = hnbap_encoder.c hnbap_decoder.c hnbap_common.c \
84 rua_encoder.c rua_decoder.c rua_common.c \
Neels Hofmeyr3da86082016-03-30 12:36:15 +020085 rua_msg_factory.c \
Harald Weltea95d5a52016-01-03 16:22:16 +010086 hnbgw.c hnbgw_hnbap.c hnbgw_rua.c hnbgw_ranap.c \
Neels Hofmeyr4d8eb4c2016-08-18 01:03:44 +020087 hnbgw_vty.c \
Harald Weltea95d5a52016-01-03 16:22:16 +010088 context_map.c hnbgw_cn.c
89
Maxef727412017-12-26 19:27:43 +010090osmo_hnbgw_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOVTY_LIBS) $(OSMOCTRL_LIBS) \
Neels Hofmeyrdfc75df2017-11-16 09:47:08 +010091 $(ASN1C_LIBS) $(OSMOSIGTRAN_LIBS) \
Daniel Willmann6480cad2016-01-06 18:06:26 +010092 $(OSMONETIF_LIBS) \
Harald Weltea95d5a52016-01-03 16:22:16 +010093 hnbap/libosmo-asn1-hnbap.a rua/libosmo-asn1-rua.a \
94 libosmo-ranap.la
Neels Hofmeyr5aabad12016-01-04 15:23:09 +010095
96
97regen: regenerate-from-asn1-source
98
99regenerate-from-asn1-source:
Neels Hofmeyrfef2e862016-07-11 21:26:19 +0200100 $(MAKE) -C hnbap regen
101 $(MAKE) -C ranap regen
102 $(MAKE) -C rua regen
Harald Weltee844bf72019-05-06 15:25:10 +0200103 $(MAKE) -C sabp regen
Neels Hofmeyr347f8ef2016-08-27 00:00:26 +0200104
105DISTCLEANFILES = \
106 hnbap_decoder.c \
107 hnbap_encoder.c \
108 rua_decoder.c \
109 rua_encoder.c \
110 ranap_decoder.c \
111 ranap_encoder.c \
Harald Weltee844bf72019-05-06 15:25:10 +0200112 sabp_decoder.c \
113 sabp_encoder.c \
Neels Hofmeyr347f8ef2016-08-27 00:00:26 +0200114 gen_hnbap.stamp \
115 gen_rua.stamp \
Harald Weltee844bf72019-05-06 15:25:10 +0200116 gen_ranap.stamp \
117 gen_sabp.stamp