8f52e04007c01043e4eb69566c5c6e578b1c3c56
[ric-plt/resource-status-manager.git] / RSM / 3rdparty / asn1codec / Makefile
1 ##############################################################################
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 ##############################################################################
18 #
19 #   This source code is part of the near-RT RIC (RAN Intelligent Controller)
20 #   platform project (RICP).
21 #
22 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
23 export CFLAGS
24 OBJDIR=lib
25 LIB=$(OBJDIR)/libe2ap_codec.a
26 LIBSRC=asn1codec_utils.c resource_status_request_wrapper.c
27 LIBOBJ=$(addprefix $(OBJDIR)/,$(LIBSRC:.c=.o))
28 TESTUNPACKXER=tests/unpack_xer
29 TESTRESOURCESTATUSREQUEST=tests/resource_status_request_wrapper_test
30
31 .PHONY: all clean e2ap_engine
32
33 all: $(LIB) $(TESTUNPACKXER) $(TESTRESOURCESTATUSREQUEST)
34
35 e2ap_engine/libasncodec.a:
36         cd e2ap_engine/ && make -f converter-example.mk
37
38 $(OBJDIR)/%.o: src/%.c e2ap_engine/*.h
39         mkdir -p $(dir $@)
40         $(CC) $(CFLAGS) -c $< -o $@
41
42 $(LIB): e2ap_engine/libasncodec.a $(LIBOBJ) 
43         $(AR) -crv $(LIB) $(LIBOBJ) 
44
45 $(TESTUNPACKXER): % : $(LIB) src/%.c
46         mkdir -p $(dir $@)
47         $(CC) $(CFLAGS) src/$@.c -o $@ $(LIB)  e2ap_engine/libasncodec.a
48
49 $(TESTRESOURCESTATUSREQUEST): % : $(LIB) src/%.c
50         mkdir -p $(dir $@)
51         $(CC) $(CFLAGS) src/$@.c -o $@ $(LIB)  e2ap_engine/libasncodec.a
52
53 clean:
54         rm -rf $(OBJDIR) tests 
55 clobber:
56         cd e2ap_engine/ && make -f converter-example.mk clean
57         rm -rf $(OBJDIR) tests