blob: ffdfef823cb95ffb506a48c3e6b2016af59528d4 [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
Daniel Willmann29b9e002015-12-15 15:10:31 +01004ASN1_ROOT = $(top_builddir)/asn1/
5ASN1TOSTRUCT = $(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
45AM_CFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include \
46 $(OSMOCORE_CFLAGS) $(OSMOVTY_CFLAGS) $(OSMOGSM_CFLAGS) \
47 $(OSMONETIF_CFLAGS) $(ASN1C_CFLAGS) $(OSMOSIGTRAN_CFLAGS)
Harald Weltea95d5a52016-01-03 16:22:16 +010048COMMON_LDADD = -lsctp
49
50# build the shared RANAP library
51#
52RANAP_LIBVERSION=0:0:0
53lib_LTLIBRARIES = libosmo-ranap.la
54libosmo_ranap_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(RANAP_LIBVERSION)
55libosmo_ranap_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(ASN1C_LIBS) $(COMMON_LDADD) 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 \
57 ranap_common_cn.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
Neels Hofmeyr83457922016-08-26 23:56:44 +020063noinst_HEADERS = context_map.h hnbgw.h hnbgw_cn.h \
Neels Hofmeyr3da86082016-03-30 12:36:15 +020064 hnbgw_hnbap.h hnbgw_rua.h hnbgw_ranap.h
Harald Weltea95d5a52016-01-03 16:22:16 +010065
66osmo_hnbgw_SOURCES = hnbap_encoder.c hnbap_decoder.c hnbap_common.c \
67 rua_encoder.c rua_decoder.c rua_common.c \
Neels Hofmeyr3da86082016-03-30 12:36:15 +020068 rua_msg_factory.c \
Harald Weltea95d5a52016-01-03 16:22:16 +010069 hnbgw.c hnbgw_hnbap.c hnbgw_rua.c hnbgw_ranap.c \
Neels Hofmeyr4d8eb4c2016-08-18 01:03:44 +020070 hnbgw_vty.c \
Harald Weltea95d5a52016-01-03 16:22:16 +010071 context_map.c hnbgw_cn.c
72
73osmo_hnbgw_LDADD = $(OSMOCORE_LIBS) $(OSMOVTY_LIBS) $(OSMOGSM_LIBS) \
74 $(ASN1C_LIBS) $(OSMOSIGTRAN_LIBS) $(COMMON_LDADD) \
Daniel Willmann6480cad2016-01-06 18:06:26 +010075 $(OSMONETIF_LIBS) \
Harald Weltea95d5a52016-01-03 16:22:16 +010076 hnbap/libosmo-asn1-hnbap.a rua/libosmo-asn1-rua.a \
77 libosmo-ranap.la
Neels Hofmeyr5aabad12016-01-04 15:23:09 +010078
79
80regen: regenerate-from-asn1-source
81
82regenerate-from-asn1-source:
Neels Hofmeyrfef2e862016-07-11 21:26:19 +020083 $(MAKE) -C hnbap regen
84 $(MAKE) -C ranap regen
85 $(MAKE) -C rua regen