Daniel Willmann | 29b9e00 | 2015-12-15 15:10:31 +0100 | [diff] [blame] | 1 | SUBDIRS = hnbap rua ranap tests |
| 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 |
Neels Hofmeyr | 8345792 | 2016-08-26 23:56:44 +0200 | [diff] [blame] | 6 | BUILT_SOURCES = hnbap_decoder.c hnbap_encoder.c rua_decoder.c rua_encoder.c \ |
| 7 | gen_hnbap.stamp gen_rua.stamp gen_ranap.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 | 47bba70 | 2017-11-21 07:56:17 +0100 | [diff] [blame] | 45 | AM_CFLAGS = -Wall -I$(top_srcdir)/include -I$(top_builddir)/include \ |
Neels Hofmeyr | 8345792 | 2016-08-26 23:56:44 +0200 | [diff] [blame] | 46 | $(OSMOCORE_CFLAGS) $(OSMOVTY_CFLAGS) $(OSMOGSM_CFLAGS) \ |
| 47 | $(OSMONETIF_CFLAGS) $(ASN1C_CFLAGS) $(OSMOSIGTRAN_CFLAGS) |
Harald Welte | a95d5a5 | 2016-01-03 16:22:16 +0100 | [diff] [blame] | 48 | |
| 49 | # build the shared RANAP library |
| 50 | # |
Harald Welte | cc1afdf | 2017-10-27 22:20:16 +0200 | [diff] [blame] | 51 | RANAP_LIBVERSION=1:0:0 |
Harald Welte | a95d5a5 | 2016-01-03 16:22:16 +0100 | [diff] [blame] | 52 | lib_LTLIBRARIES = libosmo-ranap.la |
| 53 | libosmo_ranap_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(RANAP_LIBVERSION) |
Harald Welte | 493366e | 2017-10-28 13:55:29 +0200 | [diff] [blame] | 54 | libosmo_ranap_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOVTY_LIBS) $(OSMOSIGTRAN_LIBS) \ |
Neels Hofmeyr | dfc75df | 2017-11-16 09:47:08 +0100 | [diff] [blame] | 55 | $(ASN1C_LIBS) ranap/libosmo-asn1-ranap.la |
Harald Welte | 5c6bd51 | 2016-01-05 15:05:03 +0100 | [diff] [blame] | 56 | 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] | 57 | ranap_common_cn.c iu_client.c iu_client_vty.c |
Harald Welte | a95d5a5 | 2016-01-03 16:22:16 +0100 | [diff] [blame] | 58 | |
Harald Welte | a95d5a5 | 2016-01-03 16:22:16 +0100 | [diff] [blame] | 59 | # build the actual HomeNodeB gateway |
| 60 | # |
| 61 | bin_PROGRAMS = osmo-hnbgw |
| 62 | |
Harald Welte | a95d5a5 | 2016-01-03 16:22:16 +0100 | [diff] [blame] | 63 | osmo_hnbgw_SOURCES = hnbap_encoder.c hnbap_decoder.c hnbap_common.c \ |
| 64 | rua_encoder.c rua_decoder.c rua_common.c \ |
Neels Hofmeyr | 3da8608 | 2016-03-30 12:36:15 +0200 | [diff] [blame] | 65 | rua_msg_factory.c \ |
Harald Welte | a95d5a5 | 2016-01-03 16:22:16 +0100 | [diff] [blame] | 66 | hnbgw.c hnbgw_hnbap.c hnbgw_rua.c hnbgw_ranap.c \ |
Neels Hofmeyr | 4d8eb4c | 2016-08-18 01:03:44 +0200 | [diff] [blame] | 67 | hnbgw_vty.c \ |
Harald Welte | a95d5a5 | 2016-01-03 16:22:16 +0100 | [diff] [blame] | 68 | context_map.c hnbgw_cn.c |
| 69 | |
Harald Welte | 7235ea0 | 2017-10-28 13:49:19 +0200 | [diff] [blame] | 70 | osmo_hnbgw_LDADD = $(OSMOCORE_LIBS) $(OSMOVTY_LIBS) \ |
Neels Hofmeyr | dfc75df | 2017-11-16 09:47:08 +0100 | [diff] [blame] | 71 | $(ASN1C_LIBS) $(OSMOSIGTRAN_LIBS) \ |
Daniel Willmann | 6480cad | 2016-01-06 18:06:26 +0100 | [diff] [blame] | 72 | $(OSMONETIF_LIBS) \ |
Harald Welte | a95d5a5 | 2016-01-03 16:22:16 +0100 | [diff] [blame] | 73 | hnbap/libosmo-asn1-hnbap.a rua/libosmo-asn1-rua.a \ |
| 74 | libosmo-ranap.la |
Neels Hofmeyr | 5aabad1 | 2016-01-04 15:23:09 +0100 | [diff] [blame] | 75 | |
| 76 | |
| 77 | regen: regenerate-from-asn1-source |
| 78 | |
| 79 | regenerate-from-asn1-source: |
Neels Hofmeyr | fef2e86 | 2016-07-11 21:26:19 +0200 | [diff] [blame] | 80 | $(MAKE) -C hnbap regen |
| 81 | $(MAKE) -C ranap regen |
| 82 | $(MAKE) -C rua regen |
Neels Hofmeyr | 347f8ef | 2016-08-27 00:00:26 +0200 | [diff] [blame] | 83 | |
| 84 | DISTCLEANFILES = \ |
| 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 |