Newer
Older
##########################################################
# 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_FILES = LibIts/CAM/CAM.asn \
LibIts/DENM/DENM.asn \
LibIts/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn \
LibIts/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn \
LibIts/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn \
LibIts/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn \
LibIts/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn \
LibIts/IS/ISO_TS_14816/AVIAEINumberingAndDataStructures.asn \
LibIts/IS/ISO_TS_14906/EfcDsrcApplication.asn \
LibIts/IS/ISO_TS_14906/EfcDsrcGeneric.asn \
LibIts/IS/ISO_TS_17419/CITSapplMgmtIDs.asn \
LibIts/IS/ISO_TS_19091/original/AddGrpC.asn \
LibIts/IS/ISO_TS_19091/original/DSRC.asn \
LibIts/IS/ISO_TS_19091/original/REGION.asn \
LibIts/IS/ISO_TS_19321/IVI.asn \
LibIts/IS/ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn \
LibIts/ITS-Container/ITS_Container.asn
PDU = CAM DENM MAPEM SPATEM SREM SSEM IVIM
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
TARGET = libItsAsn.so
OBJS = ${ASN_MODULE_SOURCES:.c=.o}
LDFLAGS = -shared
CONVERTER_OBJS=${ASN_CONVERTER_SOURCES:.c=.o}
Makefile.am.example: $(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