blob: 586c689733d399a0d8d1523f960bc3964e8710cc [file] [log] [blame]
Daniel Willmann29b9e002015-12-15 15:10:31 +01001SUBDIRS = hnbap rua ranap tests
2
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
Neels Hofmeyr83457922016-08-26 23:56:44 +02006BUILT_SOURCES = hnbap_decoder.c hnbap_encoder.c rua_decoder.c rua_encoder.c \
7 gen_hnbap.stamp gen_rua.stamp gen_ranap.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 Welte47bba702017-11-21 07:56:17 +010045AM_CFLAGS = -Wall -I$(top_srcdir)/include -I$(top_builddir)/include \
Maxef727412017-12-26 19:27:43 +010046 $(OSMOCORE_CFLAGS) $(OSMOVTY_CFLAGS) $(OSMOCTRL_CFLAGS) $(OSMOGSM_CFLAGS) \
Neels Hofmeyr83457922016-08-26 23:56:44 +020047 $(OSMONETIF_CFLAGS) $(ASN1C_CFLAGS) $(OSMOSIGTRAN_CFLAGS)
Harald Weltea95d5a52016-01-03 16:22:16 +010048
49# build the shared RANAP library
50#
Harald Welte92a88ee2019-01-20 21:46:06 +010051RANAP_LIBVERSION=2:1:0
Harald Weltea95d5a52016-01-03 16:22:16 +010052lib_LTLIBRARIES = libosmo-ranap.la
53libosmo_ranap_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(RANAP_LIBVERSION)
Harald Welte493366e2017-10-28 13:55:29 +020054libosmo_ranap_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOVTY_LIBS) $(OSMOSIGTRAN_LIBS) \
Neels Hofmeyrdfc75df2017-11-16 09:47:08 +010055 $(ASN1C_LIBS) ranap/libosmo-asn1-ranap.la
Harald Welte5c6bd512016-01-05 15:05:03 +010056libosmo_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 +020057 ranap_common_cn.c iu_client.c iu_client_vty.c
Harald Weltea95d5a52016-01-03 16:22:16 +010058
Harald Weltea95d5a52016-01-03 16:22:16 +010059# build the actual HomeNodeB gateway
60#
61bin_PROGRAMS = osmo-hnbgw
62
Harald Weltea95d5a52016-01-03 16:22:16 +010063osmo_hnbgw_SOURCES = hnbap_encoder.c hnbap_decoder.c hnbap_common.c \
64 rua_encoder.c rua_decoder.c rua_common.c \
Neels Hofmeyr3da86082016-03-30 12:36:15 +020065 rua_msg_factory.c \
Harald Weltea95d5a52016-01-03 16:22:16 +010066 hnbgw.c hnbgw_hnbap.c hnbgw_rua.c hnbgw_ranap.c \
Neels Hofmeyr4d8eb4c2016-08-18 01:03:44 +020067 hnbgw_vty.c \
Harald Weltea95d5a52016-01-03 16:22:16 +010068 context_map.c hnbgw_cn.c
69
Maxef727412017-12-26 19:27:43 +010070osmo_hnbgw_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOVTY_LIBS) $(OSMOCTRL_LIBS) \
Neels Hofmeyrdfc75df2017-11-16 09:47:08 +010071 $(ASN1C_LIBS) $(OSMOSIGTRAN_LIBS) \
Daniel Willmann6480cad2016-01-06 18:06:26 +010072 $(OSMONETIF_LIBS) \
Harald Weltea95d5a52016-01-03 16:22:16 +010073 hnbap/libosmo-asn1-hnbap.a rua/libosmo-asn1-rua.a \
74 libosmo-ranap.la
Neels Hofmeyr5aabad12016-01-04 15:23:09 +010075
76
77regen: regenerate-from-asn1-source
78
79regenerate-from-asn1-source:
Neels Hofmeyrfef2e862016-07-11 21:26:19 +020080 $(MAKE) -C hnbap regen
81 $(MAKE) -C ranap regen
82 $(MAKE) -C rua regen
Neels Hofmeyr347f8ef2016-08-27 00:00:26 +020083
84DISTCLEANFILES = \
85 hnbap_decoder.c \
86 hnbap_encoder.c \
87 rua_decoder.c \
88 rua_encoder.c \
89 ranap_decoder.c \
90 ranap_encoder.c \
91 gen_hnbap.stamp \
92 gen_rua.stamp \
93 gen_ranap.stamp