Harald Welte | e844bf7 | 2019-05-06 15:25:10 +0200 | [diff] [blame] | 1 | SUBDIRS = hnbap rua ranap sabp tests |
Daniel Willmann | 29b9e00 | 2015-12-15 15:10:31 +0100 | [diff] [blame] | 2 | |
Harald Welte | a95d5a5 | 2016-01-03 16:22:16 +0100 | [diff] [blame] | 3 | # Build {hnbap,rua,ranap}_{encoder,decoder}.c using asn1tostruct |
Neels Hofmeyr | ba03c43 | 2016-08-27 00:11:26 +0200 | [diff] [blame] | 4 | ASN1_ROOT = $(top_srcdir)/asn1 |
Daniel Willmann | 29b9e00 | 2015-12-15 15:10:31 +0100 | [diff] [blame] | 5 | ASN1TOSTRUCT = $(ASN1_ROOT)/utils/asn1tostruct.py |
Harald Welte | e844bf7 | 2019-05-06 15:25:10 +0200 | [diff] [blame] | 6 | BUILT_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 Hofmeyr | c51f735 | 2015-12-22 12:21:16 +0100 | [diff] [blame] | 8 | |
Neels Hofmeyr | 8345792 | 2016-08-26 23:56:44 +0200 | [diff] [blame] | 9 | gen_hnbap.stamp: $(ASN1_ROOT)/hnbap/HNBAP-PDU-Contents.asn $(ASN1TOSTRUCT) |
Daniel Willmann | 29b9e00 | 2015-12-15 15:10:31 +0100 | [diff] [blame] | 10 | $(ASN1TOSTRUCT) -f $< |
Neels Hofmeyr | 8345792 | 2016-08-26 23:56:44 +0200 | [diff] [blame] | 11 | # 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 Willmann | 29b9e00 | 2015-12-15 15:10:31 +0100 | [diff] [blame] | 18 | |
Neels Hofmeyr | 8345792 | 2016-08-26 23:56:44 +0200 | [diff] [blame] | 19 | hnbap_decoder.c hnbap_encoder.c: gen_hnbap.stamp |
| 20 | |
| 21 | gen_rua.stamp: $(ASN1_ROOT)/rua/RUA-PDU-Contents.asn $(ASN1TOSTRUCT) |
Daniel Willmann | 29b9e00 | 2015-12-15 15:10:31 +0100 | [diff] [blame] | 22 | $(ASN1TOSTRUCT) -p RUA_ -f $< |
Neels Hofmeyr | 8345792 | 2016-08-26 23:56:44 +0200 | [diff] [blame] | 23 | # 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 | |
| 31 | rua_decoder.c rua_encoder.c: gen_rua.stamp |
Daniel Willmann | 29b9e00 | 2015-12-15 15:10:31 +0100 | [diff] [blame] | 32 | |
Alexander Huemer | 156fa39 | 2016-05-15 04:24:54 +0200 | [diff] [blame] | 33 | gen_ranap.stamp: $(ASN1_ROOT)/ranap/RANAP-PDU-Contents.asn $(ASN1TOSTRUCT) |
Daniel Willmann | 29b9e00 | 2015-12-15 15:10:31 +0100 | [diff] [blame] | 34 | $(ASN1TOSTRUCT) -p RANAP_ -f $< |
Neels Hofmeyr | 96979af | 2016-01-05 15:19:44 +0100 | [diff] [blame] | 35 | # 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 Willmann | 8fda362 | 2016-01-06 14:18:51 +0100 | [diff] [blame] | 37 | sed -i 's,^#include "ranap_common.h",#include <osmocom/ranap/ranap_common.h>,' ranap_encoder.c ranap_decoder.c ranap_ies_defs.h |
Neels Hofmeyr | 8345792 | 2016-08-26 23:56:44 +0200 | [diff] [blame] | 38 | mv ranap_ies_defs.h $(top_builddir)/include/osmocom/ranap/ |
Daniel Willmann | 8fda362 | 2016-01-06 14:18:51 +0100 | [diff] [blame] | 39 | # this is ugly ^. ranap_ies_defs.h is generated from asn1tostruct.py here, but |
| 40 | # it should live in include/osmocom/ranap/. |
Neels Hofmeyr | 8345792 | 2016-08-26 23:56:44 +0200 | [diff] [blame] | 41 | touch $(top_builddir)/src/$@ |
Harald Welte | a95d5a5 | 2016-01-03 16:22:16 +0100 | [diff] [blame] | 42 | |
Neels Hofmeyr | 8345792 | 2016-08-26 23:56:44 +0200 | [diff] [blame] | 43 | ranap_decoder.c ranap_encoder.c: gen_ranap.stamp |
| 44 | |
Harald Welte | e844bf7 | 2019-05-06 15:25:10 +0200 | [diff] [blame] | 45 | gen_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 | |
| 55 | sabp_decoder.c sabp_encoder.c: gen_sabp.stamp |
| 56 | |
| 57 | |
Harald Welte | 47bba70 | 2017-11-21 07:56:17 +0100 | [diff] [blame] | 58 | AM_CFLAGS = -Wall -I$(top_srcdir)/include -I$(top_builddir)/include \ |
Max | ef72741 | 2017-12-26 19:27:43 +0100 | [diff] [blame] | 59 | $(OSMOCORE_CFLAGS) $(OSMOVTY_CFLAGS) $(OSMOCTRL_CFLAGS) $(OSMOGSM_CFLAGS) \ |
Neels Hofmeyr | 8345792 | 2016-08-26 23:56:44 +0200 | [diff] [blame] | 60 | $(OSMONETIF_CFLAGS) $(ASN1C_CFLAGS) $(OSMOSIGTRAN_CFLAGS) |
Harald Welte | a95d5a5 | 2016-01-03 16:22:16 +0100 | [diff] [blame] | 61 | |
Harald Welte | e844bf7 | 2019-05-06 15:25:10 +0200 | [diff] [blame] | 62 | # build the shared RANAP + SABP library |
Harald Welte | a95d5a5 | 2016-01-03 16:22:16 +0100 | [diff] [blame] | 63 | # |
Pau Espin Pedrol | 67d32a0 | 2020-01-03 17:04:15 +0100 | [diff] [blame] | 64 | RANAP_LIBVERSION=3:0:0 |
Harald Welte | e844bf7 | 2019-05-06 15:25:10 +0200 | [diff] [blame] | 65 | SABP_LIBVERSION=0:0:0 |
| 66 | lib_LTLIBRARIES = libosmo-ranap.la libosmo-sabp.la |
Harald Welte | a95d5a5 | 2016-01-03 16:22:16 +0100 | [diff] [blame] | 67 | libosmo_ranap_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(RANAP_LIBVERSION) |
Harald Welte | 493366e | 2017-10-28 13:55:29 +0200 | [diff] [blame] | 68 | libosmo_ranap_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOVTY_LIBS) $(OSMOSIGTRAN_LIBS) \ |
Neels Hofmeyr | dfc75df | 2017-11-16 09:47:08 +0100 | [diff] [blame] | 69 | $(ASN1C_LIBS) ranap/libosmo-asn1-ranap.la |
Harald Welte | 5c6bd51 | 2016-01-05 15:05:03 +0100 | [diff] [blame] | 70 | libosmo_ranap_la_SOURCES = ranap_common.c ranap_encoder.c ranap_decoder.c ranap_msg_factory.c iu_helpers.c \ |
Neels Hofmeyr | aae68b2 | 2017-07-05 14:38:52 +0200 | [diff] [blame] | 71 | ranap_common_cn.c iu_client.c iu_client_vty.c |
Harald Welte | a95d5a5 | 2016-01-03 16:22:16 +0100 | [diff] [blame] | 72 | |
Harald Welte | e844bf7 | 2019-05-06 15:25:10 +0200 | [diff] [blame] | 73 | libosmo_sabp_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(SABP_LIBVERSION) |
| 74 | libosmo_sabp_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOVTY_LIBS) $(OSMOSIGTRAN_LIBS) \ |
| 75 | $(ASN1C_LIBS) sabp/libosmo-asn1-sabp.la |
| 76 | libosmo_sabp_la_SOURCES = sabp_common.c sabp_encoder.c sabp_decoder.c |
| 77 | |
| 78 | |
Harald Welte | a95d5a5 | 2016-01-03 16:22:16 +0100 | [diff] [blame] | 79 | # build the actual HomeNodeB gateway |
| 80 | # |
| 81 | bin_PROGRAMS = osmo-hnbgw |
| 82 | |
Harald Welte | a95d5a5 | 2016-01-03 16:22:16 +0100 | [diff] [blame] | 83 | osmo_hnbgw_SOURCES = hnbap_encoder.c hnbap_decoder.c hnbap_common.c \ |
| 84 | rua_encoder.c rua_decoder.c rua_common.c \ |
Neels Hofmeyr | 3da8608 | 2016-03-30 12:36:15 +0200 | [diff] [blame] | 85 | rua_msg_factory.c \ |
Harald Welte | a95d5a5 | 2016-01-03 16:22:16 +0100 | [diff] [blame] | 86 | hnbgw.c hnbgw_hnbap.c hnbgw_rua.c hnbgw_ranap.c \ |
Neels Hofmeyr | 4d8eb4c | 2016-08-18 01:03:44 +0200 | [diff] [blame] | 87 | hnbgw_vty.c \ |
Harald Welte | a95d5a5 | 2016-01-03 16:22:16 +0100 | [diff] [blame] | 88 | context_map.c hnbgw_cn.c |
| 89 | |
Max | ef72741 | 2017-12-26 19:27:43 +0100 | [diff] [blame] | 90 | osmo_hnbgw_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOVTY_LIBS) $(OSMOCTRL_LIBS) \ |
Neels Hofmeyr | dfc75df | 2017-11-16 09:47:08 +0100 | [diff] [blame] | 91 | $(ASN1C_LIBS) $(OSMOSIGTRAN_LIBS) \ |
Daniel Willmann | 6480cad | 2016-01-06 18:06:26 +0100 | [diff] [blame] | 92 | $(OSMONETIF_LIBS) \ |
Harald Welte | a95d5a5 | 2016-01-03 16:22:16 +0100 | [diff] [blame] | 93 | hnbap/libosmo-asn1-hnbap.a rua/libosmo-asn1-rua.a \ |
| 94 | libosmo-ranap.la |
Neels Hofmeyr | 5aabad1 | 2016-01-04 15:23:09 +0100 | [diff] [blame] | 95 | |
| 96 | |
| 97 | regen: regenerate-from-asn1-source |
| 98 | |
| 99 | regenerate-from-asn1-source: |
Neels Hofmeyr | fef2e86 | 2016-07-11 21:26:19 +0200 | [diff] [blame] | 100 | $(MAKE) -C hnbap regen |
| 101 | $(MAKE) -C ranap regen |
| 102 | $(MAKE) -C rua regen |
Harald Welte | e844bf7 | 2019-05-06 15:25:10 +0200 | [diff] [blame] | 103 | $(MAKE) -C sabp regen |
Neels Hofmeyr | 347f8ef | 2016-08-27 00:00:26 +0200 | [diff] [blame] | 104 | |
| 105 | DISTCLEANFILES = \ |
| 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 Welte | e844bf7 | 2019-05-06 15:25:10 +0200 | [diff] [blame] | 112 | sabp_decoder.c \ |
| 113 | sabp_encoder.c \ |
Neels Hofmeyr | 347f8ef | 2016-08-27 00:00:26 +0200 | [diff] [blame] | 114 | gen_hnbap.stamp \ |
| 115 | gen_rua.stamp \ |
Harald Welte | e844bf7 | 2019-05-06 15:25:10 +0200 | [diff] [blame] | 116 | gen_ranap.stamp \ |
| 117 | gen_sabp.stamp |