ASN_MODULE_SOURCES=	\
	Address.c	\
	MetricMeasure.c	\
	UnitCode.c	\
	HealthCareProviderId.c	\
	INT-U64.c	\
	INT-I64.c	\
	INT-U32.c	\
	INT-I32.c	\
	INT-U16.c	\
	INT-I16.c	\
	INT-U8.c	\
	INT-I8.c	\
	BITS-32.c	\
	BITS-16.c	\
	BITS-8.c	\
	FEFString.c	\
	FEFFloat.c	\
	Fraction.c	\
	AbsoluteRange.c	\
	Handle.c	\
	HandleRef.c	\
	DeviceCode.c	\
	UnitsOfMeasurementCode.c	\
	MetricsCode.c	\
	BodySiteCode.c	\
	AlertCode.c	\
	ExtNomenclatureCode.c	\
	ParameterGroupCode.c	\
	PrivateCode.c	\
	Placeholder.c	\
	ManufacturerID.c	\
	AbsoluteTime.c	\
	RelativeTime.c	\
	HighResRelativeTime.c	\
	ObservationTime.c	\
	SimpleColour.c	\
	ExtNomenRef.c	\
	PersonNameGroup.c	\
	PersonName.c	\
	OID-Type.c	\
	SessionArchiveSection.c	\
	ArchiveProtection.c	\
	ManufacturerSpecificSection.c	\
	ManufacturerSpecificEncoded.c	\
	ManufacturerSpecificBinary.c	\
	HealthCareProviderSection.c	\
	HealthCareProfessionalSection.c	\
	Authorization.c	\
	PatientDemographicsSection.c	\
	PatMeasure.c	\
	PatientSex.c	\
	PatientType.c	\
	PatientRace.c	\
	SessionTestSection.c	\
	MedicalDeviceSystemSection.c	\
	SystemModel.c	\
	SystemSpecEntry.c	\
	ProdSpecEntryType.c	\
	ProdSpecEntry.c	\
	ApplicationArea.c	\
	PowerStatus.c	\
	LineFrequency.c	\
	MedicalDeviceComponents.c	\
	VirtualMedicalDeviceSection.c	\
	MsmtPrinciple.c	\
	ChannelDescriptionSection.c	\
	ChannelStatus.c	\
	MultimediaSection.c	\
	Comments.c	\
	ContentOrReference.c	\
	SessionPhaseSection.c	\
	DescriptiveDataSection.c	\
	MetricDescriptiveDataSection.c	\
	MetricStatus.c	\
	MetricCategory.c	\
	MetricCalEntry.c	\
	MetricCalType.c	\
	MetricCalState.c	\
	MeasurementStatus.c	\
	SampleArrayDescriptiveDataSection.c	\
	SaSpec.c	\
	StorageDataType.c	\
	SaFlags.c	\
	ScaleRangeSpec.c	\
	SaFilterEntry.c	\
	FilterType.c	\
	SaGridEntry.c	\
	SaCalData.c	\
	SaCalDataType.c	\
	SaSignalFrequency.c	\
	RealTimeSampleArrayDescriptiveDataSection.c	\
	TimeSampleArrayDescriptiveDataSection.c	\
	DistributionSampleArrayDescriptiveDataSection.c	\
	DsaRangeSpec.c	\
	NumericDescriptiveDataSection.c	\
	EnumerationDescriptiveDataSection.c	\
	MeasuredDataSection.c	\
	SampleArrayMeasuredDataSection.c	\
	SampleArrayMeasuredDataBlock.c	\
	RealTimeSampleArrayMeasuredDataSection.c	\
	TimeSampleArrayMeasuredDataSection.c	\
	MarkerEntryRelTim.c	\
	DistributionSampleArrayMeasuredDataSection.c	\
	NumericMeasuredDataSection.c	\
	ChoiceOfNuObsValue.c	\
	NuObsValue.c	\
	DispResolution.c	\
	EnumerationMeasuredDataSection.c	\
	ChoiceOfEnumObsValue.c	\
	EnumObsValue.c	\
	EnumVal.c	\
	EnumObject.c	\
	EnumRecordMetric.c	\
	EnumRecordOO.c	\
	ChoiceOfEnumTimeStamp.c	\
	AlertSection.c	\
	AlertCondition.c	\
	AlertControls.c	\
	AlertFlags.c	\
	AlertType.c	\
	LimitSpecEntry.c	\
	CurLimAlStat.c	\
	DynamicAttributeChangeSection.c	\
	SessionNotesSection.c

ASN_MODULE_HEADERS=	\
	Address.h	\
	MetricMeasure.h	\
	UnitCode.h	\
	HealthCareProviderId.h	\
	INT-U64.h	\
	INT-I64.h	\
	INT-U32.h	\
	INT-I32.h	\
	INT-U16.h	\
	INT-I16.h	\
	INT-U8.h	\
	INT-I8.h	\
	BITS-32.h	\
	BITS-16.h	\
	BITS-8.h	\
	FEFString.h	\
	FEFFloat.h	\
	Fraction.h	\
	AbsoluteRange.h	\
	Handle.h	\
	HandleRef.h	\
	DeviceCode.h	\
	UnitsOfMeasurementCode.h	\
	MetricsCode.h	\
	BodySiteCode.h	\
	AlertCode.h	\
	ExtNomenclatureCode.h	\
	ParameterGroupCode.h	\
	PrivateCode.h	\
	Placeholder.h	\
	ManufacturerID.h	\
	AbsoluteTime.h	\
	RelativeTime.h	\
	HighResRelativeTime.h	\
	ObservationTime.h	\
	SimpleColour.h	\
	ExtNomenRef.h	\
	PersonNameGroup.h	\
	PersonName.h	\
	OID-Type.h	\
	SessionArchiveSection.h	\
	ArchiveProtection.h	\
	ManufacturerSpecificSection.h	\
	ManufacturerSpecificEncoded.h	\
	ManufacturerSpecificBinary.h	\
	HealthCareProviderSection.h	\
	HealthCareProfessionalSection.h	\
	Authorization.h	\
	PatientDemographicsSection.h	\
	PatMeasure.h	\
	PatientSex.h	\
	PatientType.h	\
	PatientRace.h	\
	SessionTestSection.h	\
	MedicalDeviceSystemSection.h	\
	SystemModel.h	\
	SystemSpecEntry.h	\
	ProdSpecEntryType.h	\
	ProdSpecEntry.h	\
	ApplicationArea.h	\
	PowerStatus.h	\
	LineFrequency.h	\
	MedicalDeviceComponents.h	\
	VirtualMedicalDeviceSection.h	\
	MsmtPrinciple.h	\
	ChannelDescriptionSection.h	\
	ChannelStatus.h	\
	MultimediaSection.h	\
	Comments.h	\
	ContentOrReference.h	\
	SessionPhaseSection.h	\
	DescriptiveDataSection.h	\
	MetricDescriptiveDataSection.h	\
	MetricStatus.h	\
	MetricCategory.h	\
	MetricCalEntry.h	\
	MetricCalType.h	\
	MetricCalState.h	\
	MeasurementStatus.h	\
	SampleArrayDescriptiveDataSection.h	\
	SaSpec.h	\
	StorageDataType.h	\
	SaFlags.h	\
	ScaleRangeSpec.h	\
	SaFilterEntry.h	\
	FilterType.h	\
	SaGridEntry.h	\
	SaCalData.h	\
	SaCalDataType.h	\
	SaSignalFrequency.h	\
	RealTimeSampleArrayDescriptiveDataSection.h	\
	TimeSampleArrayDescriptiveDataSection.h	\
	DistributionSampleArrayDescriptiveDataSection.h	\
	DsaRangeSpec.h	\
	NumericDescriptiveDataSection.h	\
	EnumerationDescriptiveDataSection.h	\
	MeasuredDataSection.h	\
	SampleArrayMeasuredDataSection.h	\
	SampleArrayMeasuredDataBlock.h	\
	RealTimeSampleArrayMeasuredDataSection.h	\
	TimeSampleArrayMeasuredDataSection.h	\
	MarkerEntryRelTim.h	\
	DistributionSampleArrayMeasuredDataSection.h	\
	NumericMeasuredDataSection.h	\
	ChoiceOfNuObsValue.h	\
	NuObsValue.h	\
	DispResolution.h	\
	EnumerationMeasuredDataSection.h	\
	ChoiceOfEnumObsValue.h	\
	EnumObsValue.h	\
	EnumVal.h	\
	EnumObject.h	\
	EnumRecordMetric.h	\
	EnumRecordOO.h	\
	ChoiceOfEnumTimeStamp.h	\
	AlertSection.h	\
	AlertCondition.h	\
	AlertControls.h	\
	AlertFlags.h	\
	AlertType.h	\
	LimitSpecEntry.h	\
	CurLimAlStat.h	\
	DynamicAttributeChangeSection.h	\
	SessionNotesSection.h

ASN_MODULE_HEADERS+=ANY.h
ASN_MODULE_SOURCES+=ANY.c
ASN_MODULE_HEADERS+=UTF8String.h
ASN_MODULE_HEADERS+=INTEGER.h
ASN_MODULE_HEADERS+=NativeEnumerated.h
ASN_MODULE_HEADERS+=GeneralizedTime.h
ASN_MODULE_SOURCES+=GeneralizedTime.c
ASN_MODULE_SOURCES+=INTEGER.c
ASN_MODULE_SOURCES+=NativeEnumerated.c
ASN_MODULE_HEADERS+=NativeInteger.h
ASN_MODULE_SOURCES+=NativeInteger.c
ASN_MODULE_HEADERS+=REAL.h
ASN_MODULE_HEADERS+=OBJECT_IDENTIFIER.h
ASN_MODULE_SOURCES+=OBJECT_IDENTIFIER.c
ASN_MODULE_SOURCES+=REAL.c
ASN_MODULE_SOURCES+=UTF8String.c
ASN_MODULE_HEADERS+=asn_SEQUENCE_OF.h
ASN_MODULE_SOURCES+=asn_SEQUENCE_OF.c
ASN_MODULE_HEADERS+=asn_SET_OF.h
ASN_MODULE_SOURCES+=asn_SET_OF.c
ASN_MODULE_HEADERS+=constr_CHOICE.h
ASN_MODULE_SOURCES+=constr_CHOICE.c
ASN_MODULE_HEADERS+=constr_SEQUENCE.h
ASN_MODULE_SOURCES+=constr_SEQUENCE.c
ASN_MODULE_HEADERS+=constr_SEQUENCE_OF.h
ASN_MODULE_SOURCES+=constr_SEQUENCE_OF.c
ASN_MODULE_HEADERS+=constr_SET_OF.h
ASN_MODULE_SOURCES+=constr_SET_OF.c
ASN_MODULE_HEADERS+=asn_application.h
ASN_MODULE_HEADERS+=asn_system.h
ASN_MODULE_HEADERS+=asn_codecs.h
ASN_MODULE_HEADERS+=asn_internal.h
ASN_MODULE_HEADERS+=OCTET_STRING.h
ASN_MODULE_SOURCES+=OCTET_STRING.c
ASN_MODULE_HEADERS+=BIT_STRING.h
ASN_MODULE_SOURCES+=BIT_STRING.c
ASN_MODULE_SOURCES+=asn_codecs_prim.c
ASN_MODULE_HEADERS+=asn_codecs_prim.h
ASN_MODULE_HEADERS+=ber_tlv_length.h
ASN_MODULE_SOURCES+=ber_tlv_length.c
ASN_MODULE_HEADERS+=ber_tlv_tag.h
ASN_MODULE_SOURCES+=ber_tlv_tag.c
ASN_MODULE_HEADERS+=ber_decoder.h
ASN_MODULE_SOURCES+=ber_decoder.c
ASN_MODULE_HEADERS+=constr_TYPE.h
ASN_MODULE_SOURCES+=constr_TYPE.c
ASN_MODULE_HEADERS+=constraints.h
ASN_MODULE_SOURCES+=constraints.c
ASN_MODULE_HEADERS+=der_encoder.h
ASN_MODULE_SOURCES+=der_encoder.c
ASN_MODULE_HEADERS+=xer_support.h
ASN_MODULE_SOURCES+=xer_support.c
ASN_MODULE_HEADERS+=xer_decoder.h
ASN_MODULE_SOURCES+=xer_decoder.c
ASN_MODULE_HEADERS+=xer_encoder.h
ASN_MODULE_SOURCES+=xer_encoder.c
ASN_MODULE_HEADERS+=per_opentype.h
ASN_MODULE_SOURCES+=per_opentype.c
ASN_MODULE_HEADERS+=per_support.h
ASN_MODULE_SOURCES+=per_support.c
ASN_MODULE_HEADERS+=per_decoder.h
ASN_MODULE_SOURCES+=per_decoder.c
ASN_MODULE_HEADERS+=per_encoder.h
ASN_MODULE_SOURCES+=per_encoder.c
#ASN_CONVERTER_SOURCES+=converter-sample.c



lib_LTLIBRARIES=libsomething.la
libsomething_la_SOURCES=$(ASN_MODULE_SOURCES) $(ASN_MODULE_HEADERS)

# This file may be used as an input for make(3)
# Remove the lines below to convert it into a pure .am file
WIN32  = ../win32/libcnsfef.a ../win32/libcnsfef.dll
WIN64  = ../win64/libcnsfef.a ../win64/libcnsfef.dll
TARGET = libcnsfef.a $(WIN32)
CFLAGS += -pipe -fPIC -Wall -O2 -Wextra  -I.
OBJS=${ASN_MODULE_SOURCES:.c=.o} ${ASN_CONVERTER_SOURCES:.c=.o}
WINOBJS=${ASN_MODULE_SOURCES:.c=.obj} ${ASN_CONVERTER_SOURCES:.c=.obj}
W64OBJS=${ASN_MODULE_SOURCES:.c=.o64} ${ASN_CONVERTER_SOURCES:.c=.o64}

CC        = gcc
AR        = ar crs
MinGWCC   = $(CROSS)-gcc 
MinGW64CC = $(CROSS64)-gcc 

all: $(TARGET)

#$(TARGET): ${OBJS}
#	$(CC) $(CFLAGS) -o $(TARGET) ${OBJS} $(LDFLAGS) $(LIBS)

libcnsfef.a: $(OBJS) 
	$(AR) libcnsfef.a $(OBJS) 

../win32/libcnsfef.a: $(WINOBJS) 
	$(CROSS)-$(AR) ../win32/libcnsfef.a $(WINOBJS) 

../win64/libcnsfef.a: $(W64OBJS) 
	$(CROSS64)-$(AR) ../win64/libcnsfef.a $(W64OBJS) 

../win32/libcnsfef.dll: $(WINOBJS)
	$(MinGWCC) -shared -fPIC  $(WINOBJS)  -Wl,--output-def,../win32/libcnsfef.def,--out-implib,../win32/libcnsfef.dll

../win64/libcnsfef.dll: $(WINOBJS)
	$(MinGW64CC) -shared -fPIC  $(W64OBJS)  -Wl,--output-def,../win64/libcnsfef.def,--out-implib,../win64/libcnsfef.dll


.SUFFIXES:
.SUFFIXES: .c .o

%.obj: %.c
	$(CROSS)-$(CC) $(CFLAGS) -o $@ -c $<
%.o64: %.c
	$(CROSS64)-$(CC) $(CFLAGS) -o $@ -c $<

.c.o:
	$(CC) $(CFLAGS) -o $@ -c $<

clean:
#	rm -f $(ASN_MODULE_HEADERS)
#	rm -f $(ASN_MODULE_SOURCES)
	rm -f $(TARGET)
	rm -f $(OBJS)
	rm -f $(WINOBJS)
	rm -f $(W64OBJS)
	rm -f Makefile.am.sample libfef.a 

regen: regenerate-from-asn1-source 

regenerate-from-asn1-source:
	asn1c -fcompound-names ../annexb-snacc-122001.asn1 
	rm -f converter-sample.c Makefile.am.sample libfef.a



