build: use $top_srcdir instead of ../
diff --git a/src/Makefile.am b/src/Makefile.am
index b0badc3..615b838 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -20,7 +20,7 @@
 #	this is ugly ^. ranap_ies_defs.h is generated from asn1tostruct.py here, but
 #	it should live in include/osmocom/ranap/.
 
-AM_CFLAGS = -I../include $(OSMOCORE_CFLAGS) $(OSMOVTY_CFLAGS) $(OSMOGSM_CFLAGS) $(OSMONETIF_CFLAGS) $(ASN1C_CFLAGS) $(OSMOSIGTRAN_CFLAGS)
+AM_CFLAGS = -I$(top_srcdir)/include $(OSMOCORE_CFLAGS) $(OSMOVTY_CFLAGS) $(OSMOGSM_CFLAGS) $(OSMONETIF_CFLAGS) $(ASN1C_CFLAGS) $(OSMOSIGTRAN_CFLAGS)
 COMMON_LDADD = -lsctp
 
 # build the shared RANAP library
diff --git a/src/hnbap/Makefile.am b/src/hnbap/Makefile.am
index 621dac3..131bef1 100644
--- a/src/hnbap/Makefile.am
+++ b/src/hnbap/Makefile.am
@@ -232,7 +232,7 @@
 	PrivateMessage.h	\
 	IE.h
 
-AM_CFLAGS = -I../../include $(ASN1C_CFLAGS) $(OSMOCORE_CFLAGS)
+AM_CFLAGS = -I$(top_srcdir)/include $(ASN1C_CFLAGS) $(OSMOCORE_CFLAGS)
 
 noinst_LIBRARIES=libosmo-asn1-hnbap.a
 libosmo_asn1_hnbap_a_SOURCES=$(ASN_MODULE_SOURCES)
@@ -241,8 +241,8 @@
 regen: regenerate-from-asn1-source
 
 regenerate-from-asn1-source:
-	asn1c -gen-PER -fnative-types ../../asn1/hnbap/HNBAP-CommonDataTypes.asn ../../asn1/hnbap/HNBAP-Constants.asn ../../asn1/hnbap/HNBAP-IEs.asn ../../asn1/hnbap/HNBAP-PDU.asn
+	asn1c -gen-PER -fnative-types $(top_srcdir)/asn1/hnbap/HNBAP-CommonDataTypes.asn $(top_srcdir)/asn1/hnbap/HNBAP-Constants.asn $(top_srcdir)/asn1/hnbap/HNBAP-IEs.asn $(top_srcdir)/asn1/hnbap/HNBAP-PDU.asn
 #	remove the local copy of the runtime code
 	-rm ANY.* BOOLEAN.* INTEGER.* NativeEnumerated.* NativeInteger.* OBJECT_IDENTIFIER.* asn_* OCTET_STRING.* converter-sample.c per_* xer_* constr* der_* ber_* BIT_STRING.*
 #	change include style to `#include <dir/foo.h>'
-	../../move-asn1-header-files.sh osmocom/hnbap $(ASN_MODULE_INC)
+	$(top_srcdir)/move-asn1-header-files.sh osmocom/hnbap $(ASN_MODULE_INC)
diff --git a/src/ranap/Makefile.am b/src/ranap/Makefile.am
index ccda5d2..0fb3cdf 100644
--- a/src/ranap/Makefile.am
+++ b/src/ranap/Makefile.am
@@ -1160,7 +1160,7 @@
 	RANAP_LeftMBMSBearerService-IEs.h	\
 	RANAP_UnsuccessfulLinking-IEs.h
 
-AM_CFLAGS = -I../../include $(ASN1C_CFLAGS) $(OSMOCORE_CFLAGS)
+AM_CFLAGS = -I$(top_srcdir)/include $(ASN1C_CFLAGS) $(OSMOCORE_CFLAGS)
 
 noinst_LTLIBRARIES=libosmo-asn1-ranap.la
 libosmo_asn1_ranap_la_SOURCES=$(ASN_MODULE_SRC)
@@ -1169,7 +1169,7 @@
 regen: regenerate-from-asn1-source
 
 regenerate-from-asn1-source:
-	ASN1C_PREFIX="RANAP_" asn1c -gen-PER ../../asn1/ranap/RANAP-CommonDataTypes.asn ../../asn1/ranap/RANAP-Constants.asn ../../asn1/ranap/RANAP-IEs.asn ../../asn1/ranap/RANAP-PDU.asn
+	ASN1C_PREFIX="RANAP_" asn1c -gen-PER $(top_srcdir)/asn1/ranap/RANAP-CommonDataTypes.asn $(top_srcdir)/asn1/ranap/RANAP-Constants.asn $(top_srcdir)/asn1/ranap/RANAP-IEs.asn $(top_srcdir)/asn1/ranap/RANAP-PDU.asn
 	@rm ANY.* BOOLEAN.* INTEGER.* NativeEnumerated.* NativeInteger.* NULL.* OBJECT_IDENTIFIER.* asn_* OCTET_STRING.* converter-sample.c per_* xer_* constr* der_* ber_* BIT_STRING.*
 # 	some fixups in erroneous code that asn1c generates
 	sed -i '6i#include <constr_CHOICE.h>' RANAP_ChosenEncryptionAlgorithm.h RANAP_ChosenIntegrityProtectionAlgorithm.h RANAP_IMSI.h RANAP_PLMNidentity.h RANAP_RAB-ReleaseFailedList.c RANAP_RAB-ReleaseList.c RANAP_RAB-SetupOrModifyList.c RANAP_ResetResourceList.c RANAP_ResetResourceAckList.c
@@ -1187,5 +1187,5 @@
 	sed -i 's/Member/MemberM/' RANAP_PLMNs-in-shared-network.[ch]
 	sed -i 's/Member/MemberN/' RANAP_RABDataVolumeReport.[ch]
 #	change include style to `#include <dir/foo.h>'
-	../../move-asn1-header-files.sh osmocom/ranap $(ASN_MODULE_INC)
+	$(top_srcdir)/move-asn1-header-files.sh osmocom/ranap $(ASN_MODULE_INC)
 
diff --git a/src/rua/Makefile.am b/src/rua/Makefile.am
index 075fdf3..d8fb042 100644
--- a/src/rua/Makefile.am
+++ b/src/rua/Makefile.am
@@ -72,7 +72,7 @@
 	RUA_PrivateMessage.h	\
 	RUA_IE.h
 
-AM_CFLAGS = -I../../include $(ASN1C_CFLAGS) $(OSMOCORE_CFLAGS)
+AM_CFLAGS = -I$(top_srcdir)/include $(ASN1C_CFLAGS) $(OSMOCORE_CFLAGS)
 
 noinst_LIBRARIES=libosmo-asn1-rua.a
 libosmo_asn1_rua_a_SOURCES=$(ASN_MODULE_SOURCES)
@@ -81,9 +81,9 @@
 regen: regenerate-from-asn1-source
 
 regenerate-from-asn1-source:
-	ASN1C_PREFIX="RUA_" asn1c -gen-PER ../../asn1/rua/RUA-CommonDataTypes.asn ../../asn1/rua/RUA-Constants.asn ../../asn1/rua/RUA-IEs.asn ../../asn1/rua/RUA-PDU.asn
+	ASN1C_PREFIX="RUA_" asn1c -gen-PER $(top_srcdir)/asn1/rua/RUA-CommonDataTypes.asn $(top_srcdir)/asn1/rua/RUA-Constants.asn $(top_srcdir)/asn1/rua/RUA-IEs.asn $(top_srcdir)/asn1/rua/RUA-PDU.asn
 #	remove the local copy of the runtime code
 	@rm ANY.* BOOLEAN.* INTEGER.* NativeEnumerated.* NativeInteger.* OBJECT_IDENTIFIER.* asn_* OCTET_STRING.* converter-sample.c per_* xer_* constr* der_* ber_* BIT_STRING.*
 #	change include style to `#include <dir/foo.h>'
-	../../move-asn1-header-files.sh osmocom/rua $(ASN_MODULE_INC)
+	$(top_srcdir)/move-asn1-header-files.sh osmocom/rua $(ASN_MODULE_INC)