Harald Welte | 27f9c4a | 2015-08-30 22:47:18 +0200 | [diff] [blame] | 1 | ASN1_ROOT=../asn1/ |
Harald Welte | 27f9c4a | 2015-08-30 22:47:18 +0200 | [diff] [blame] | 2 | ASN1_FILES=HNBAP-CommonDataTypes.asn |
Harald Welte | b3dae30 | 2015-08-30 12:20:09 +0200 | [diff] [blame] | 3 | |
Harald Welte | 27f9c4a | 2015-08-30 22:47:18 +0200 | [diff] [blame] | 4 | ASN1TOSTRUCT:=$(ASN1_ROOT)/utils/asn1tostruct.py |
Harald Welte | 27f9c4a | 2015-08-30 22:47:18 +0200 | [diff] [blame] | 5 | |
Harald Welte | 0ec7f13 | 2015-09-10 10:52:18 +0200 | [diff] [blame] | 6 | PKG_INCLUDES:=$(shell pkg-config --cflags libosmocore libosmovty libosmogsm libasn1c) |
| 7 | PKG_LDFLAGS:=$(shell pkg-config --libs libosmocore libosmovty libosmogsm libasn1c) |
Harald Welte | b3dae30 | 2015-08-30 12:20:09 +0200 | [diff] [blame] | 8 | |
Harald Welte | 0ec7f13 | 2015-09-10 10:52:18 +0200 | [diff] [blame] | 9 | CFLAGS:=-g -Wall $(PKG_INCLUDES) -Ihnbap/ |
| 10 | LDFLAGS:=$(PKG_LDFLAGS) -lsctp |
| 11 | |
Harald Welte | 656ad30 | 2015-09-10 18:33:47 +0200 | [diff] [blame] | 12 | HNBAP_OBJS=hnbap_encoder.o hnbap_decoder.o hnbap_common.o |
| 13 | RUA_OBJS=rua_encoder.o rua_decoder.o rua_common.o |
Harald Welte | 350814a | 2015-09-10 22:32:15 +0200 | [diff] [blame^] | 14 | RANAP_OBJS=ranap_common.o #ranap_encoder.o ranap_decoder.o |
Harald Welte | 0ec7f13 | 2015-09-10 10:52:18 +0200 | [diff] [blame] | 15 | |
| 16 | LIBS=hnbap/libosmo-asn1-hnbap.a rua/libosmo-asn1-rua.a ranap/libosmo-asn1-ranap.a |
Harald Welte | b90c37d | 2015-09-10 10:26:09 +0200 | [diff] [blame] | 17 | |
Harald Welte | b3dae30 | 2015-08-30 12:20:09 +0200 | [diff] [blame] | 18 | all: hnbgw |
| 19 | |
Harald Welte | 27f9c4a | 2015-08-30 22:47:18 +0200 | [diff] [blame] | 20 | .PHONY: hnbap_encoder.c |
Harald Welte | 9da9697 | 2015-08-31 09:38:13 +0200 | [diff] [blame] | 21 | hnbap_encoder.c: $(ASN1_ROOT)/hnbap/HNBAP-PDU-Contents.asn |
| 22 | $(ASN1TOSTRUCT) -f $< |
| 23 | |
| 24 | .PHONY: rua_encoder.c |
| 25 | rua_encoder.c: $(ASN1_ROOT)/rua/RUA-PDU-Contents.asn |
Harald Welte | 656ad30 | 2015-09-10 18:33:47 +0200 | [diff] [blame] | 26 | $(ASN1TOSTRUCT) -p RUA_ -f $< |
Harald Welte | 9da9697 | 2015-08-31 09:38:13 +0200 | [diff] [blame] | 27 | |
| 28 | .PHONY: ranap_encoder.c |
| 29 | ranap_encoder.c: $(ASN1_ROOT)/ranap/RANAP-PDU-Contents.asn |
Harald Welte | 656ad30 | 2015-09-10 18:33:47 +0200 | [diff] [blame] | 30 | $(ASN1TOSTRUCT) -p RANAP_ -f $< |
Harald Welte | 27f9c4a | 2015-08-30 22:47:18 +0200 | [diff] [blame] | 31 | |
Harald Welte | 0ec7f13 | 2015-09-10 10:52:18 +0200 | [diff] [blame] | 32 | hnbap/libosmo-asn1-hnbap.a: |
| 33 | $(MAKE) -C hnbap |
Harald Welte | 0bdea4d | 2015-08-30 23:13:06 +0200 | [diff] [blame] | 34 | |
Harald Welte | b90c37d | 2015-09-10 10:26:09 +0200 | [diff] [blame] | 35 | rua/libosmo-asn1-rua.a: |
| 36 | $(MAKE) -C rua |
| 37 | |
| 38 | ranap/libosmo-asn1-ranap.a: |
| 39 | $(MAKE) -C ranap |
| 40 | |
Harald Welte | 350814a | 2015-09-10 22:32:15 +0200 | [diff] [blame^] | 41 | hnbgw: asn1helpers.o hnbgw.o hnbgw_hnbap.o hnbgw_rua.o hnbgw_ranap.o $(HNBAP_OBJS) $(RUA_OBJS) $(RANAP_OBJS) $(LIBS) |
Harald Welte | b3dae30 | 2015-08-30 12:20:09 +0200 | [diff] [blame] | 42 | $(CC) $(LDFLAGS) -o $@ $^ |
| 43 | |
| 44 | %.o: %.c |
| 45 | $(CC) $(CFLAGS) -o $@ -c $^ |
| 46 | |
| 47 | clean: |
Harald Welte | 0ec7f13 | 2015-09-10 10:52:18 +0200 | [diff] [blame] | 48 | @rm -f hnbgw *.o |
| 49 | |
| 50 | mrproper: clean |
| 51 | $(MAKE) -C hnbap clean |
| 52 | $(MAKE) -C rua clean |
| 53 | $(MAKE) -C ranap clean |