1 ##############################################################################
3 # Copyright (c) 2019 AT&T Intellectual Property.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 ##############################################################################
18 CFLAGS=-Wall -Wpedantic -std=c11 -Og -I./inc -I./src -I./e2ap_engine -DASN_DISABLE_OER_SUPPORT -DASN_PDU_COLLECTION -D_POSIX_C_SOURCE=200809L -ggdb
21 LIB=$(OBJDIR)/libe2ap_codec.a
22 LIBSRC=configuration_update_wrapper.c x2setup_request_wrapper.c x2reset_request_wrapper.c x2reset_response_wrapper.c asn1codec_utils.c
23 LIBOBJ=$(addprefix $(OBJDIR)/,$(LIBSRC:.c=.o))
24 TESTX2SETUPREQUEST=tests/x2setup_request_wrapper_test
25 TESTCONFUPDATE=tests/configuration_update_wrapper_test
26 TESTX2RESETREQUEST=tests/x2reset_request_wrapper_test
27 TESTX2RESETRESPONSE=tests/x2reset_response_wrapper_test
28 TESTUNPACKXER=tests/unpack_xer
30 .PHONY: all clean e2ap_engine
32 all: $(LIB) $(TESTX2SETUPREQUEST) $(TESTCONFUPDATE) $(TESTX2RESETREQUEST) $(TESTUNPACKXER) $(TESTX2RESETRESPONSE)
34 e2ap_engine/libasncodec.a:
35 cd e2ap_engine/ && make -f converter-example.mk
37 $(OBJDIR)/%.o: src/%.c e2ap_engine/*.h
39 $(CC) $(CFLAGS) -c $< -o $@
41 $(LIB): e2ap_engine/libasncodec.a $(LIBOBJ)
42 $(AR) -crv $(LIB) $(LIBOBJ)
44 $(TESTX2SETUPREQUEST): % : $(LIB) src/%.c
46 $(CC) $(CFLAGS) src/$@.c -o $@ $(LIB) e2ap_engine/libasncodec.a
48 $(TESTCONFUPDATE): % : $(LIB) src/%.c
50 $(CC) $(CFLAGS) src/$@.c -o $@ $(LIB) e2ap_engine/libasncodec.a
52 $(TESTX2RESETREQUEST): % : $(LIB) src/%.c
54 $(CC) $(CFLAGS) src/$@.c -o $@ $(LIB) e2ap_engine/libasncodec.a
56 $(TESTUNPACKXER): % : $(LIB) src/%.c
58 $(CC) $(CFLAGS) src/$@.c -o $@ $(LIB) e2ap_engine/libasncodec.a
60 $(TESTX2RESETRESPONSE): % : $(LIB) src/%.c
62 $(CC) $(CFLAGS) src/$@.c -o $@ $(LIB) e2ap_engine/libasncodec.a
65 rm -rf $(OBJDIR) tests
67 cd e2ap_engine/ && make -f converter-example.mk clean
68 rm -rf $(OBJDIR) tests