Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
##########################################################
# This Makefile is to build the ASN1 library to be used
# for external codec in Titan
# This Makefile is expected that asn1c compiler is
# installed in the PATHs
##########################################################
# The name of the library
ASN_LIBRARY = libItsAsn.so
# ASN.1 files to be included in the library
ASN_FILES = LibIts/CAM/CAM.asn LibIts/DENM/DENM.asn LibIts/ITS-Container/ITS_Container.asn
# PDUs
PDU = CAM DENM
ifeq (,$(ASN_DIR))
##########################################################
# Build path for the library
BIN_DIR := ../bin/asn1
# Relative path from the build path to the directory with
# ASN.1 files
ASN_DIR := ../../asn1
.PHONY: FORCE
all: $(BIN_DIR)/$(ASN_LIBRARY)
clean:
make -C $(BIN_DIR) clean
$(BIN_DIR)/$(ASN_LIBRARY): $(BIN_DIR)/Makefile
make -C $(BIN_DIR) all
$(BIN_DIR):
mkdir -p $@
$(BIN_DIR)/Makefile: $(BIN_DIR) Makefile
echo ASN_DIR=$(ASN_DIR) >$@
cat Makefile >>$@
##########################################################
else
##########################################################
# This part is executed within the BIN_DIR directory to
# override variables from the Makefile.am.samples
# generated by asn1c
include Makefile.am.sample
TARGET = libItsAsn.so
OBJS = ${ASN_MODULE_SOURCES:.c=.o}
LDFLAGS = -shared
CONVERTER=converter
CONVERTER_OBJS=${ASN_CONVERTER_SOURCES:.c=.o}
Makefile.am.sample: $(addprefix $(ASN_DIR)/, $(ASN_FILES))
asn1c -gen-PER $(addprefix -pdu=,$(PDU)) $^
all: $(CONVERTER)
$(CONVERTER): $(CONVERTER_OBJS) $(ASN_LIBRARY)
$(CC) $(CFLAGS) -o $@ $(CONVERTER_OBJS) $(filter-out -shared, $(LDFLAGS)) $(ASN_LIBRARY) $(LIBS)
##########################################################
endif