blob: b4229a74b711edc2a446ded6884e4caadf1241e9 [file] [log] [blame]
ss412g07ef76d2019-08-12 17:26:40 +03001##############################################################################
2#
3# Copyright (c) 2019 AT&T Intellectual Property.
4#
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
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
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.
16#
17##############################################################################
18CFLAGS=-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
19export CFLAGS
20OBJDIR=lib
21LIB=$(OBJDIR)/libe2ap_codec.a
22LIBSRC=configuration_update_wrapper.c x2setup_request_wrapper.c asn1codec_utils.c
23LIBOBJ=$(addprefix $(OBJDIR)/,$(LIBSRC:.c=.o))
24TESTX2SETUPREQUEST=tests/x2setup_request_wrapper_test
25TESTCONFUPDATE=tests/configuration_update_wrapper_test
26
27.PHONY: all clean e2ap_engine
28
29all: $(LIB) $(TESTX2SETUPREQUEST) $(TESTCONFUPDATE)
30
31
32e2ap_engine/libasncodec.a:
33 cd e2ap_engine/ && make -f converter-example.mk
34
35$(OBJDIR)/%.o: src/%.c e2ap_engine/*.h
36 mkdir -p $(dir $@)
37 $(CC) $(CFLAGS) -c $< -o $@
38
39$(LIB): e2ap_engine/libasncodec.a $(LIBOBJ)
40 $(AR) -crv $(LIB) $(LIBOBJ)
41
42$(TESTX2SETUPREQUEST): % : $(LIB) src/%.c
43 mkdir -p $(dir $@)
44 $(CC) $(CFLAGS) src/$@.c -o $@ $(LIB) e2ap_engine/libasncodec.a
45
46$(TESTCONFUPDATE): % : $(LIB) src/%.c
47 mkdir -p $(dir $@)
48 $(CC) $(CFLAGS) src/$@.c -o $@ $(LIB) e2ap_engine/libasncodec.a
49
50clean:
51 rm -rf $(OBJDIR) tests
52clobber:
53 cd e2ap_engine/ && make -f converter-example.mk clean
54 rm -rf $(OBJDIR) tests