Generate .x source files as .c source files

The generated .x source and .hx header files are plain C source files.
Generate them as .c source files and avoid unnecessary file copying
and special makefile rules.

Change-Id: Ifc4bbe3c46dd357fdd642040ad964c7cfe1d395c
This commit is contained in:
Jeffrey Altman
2022-01-05 15:45:23 -05:00
committed by Nicolas Williams
parent 4919daa7ab
commit 9427796f1a
10 changed files with 311 additions and 389 deletions

View File

@@ -13,38 +13,40 @@ AM_CPPFLAGS += -I$(DBHEADER)
endif
BUILT_SOURCES = \
$(gen_files_hdb:.x=.c) \
$(gen_files_hdb) \
hdb_err.c \
hdb_err.h
gen_files_hdb = \
asn1_Salt.x \
asn1_Key.x \
asn1_Event.x \
asn1_HDBFlags.x \
asn1_GENERATION.x \
asn1_HDB_Ext_PKINIT_acl.x \
asn1_HDB_Ext_PKINIT_cert.x \
asn1_HDB_Ext_PKINIT_hash.x \
asn1_HDB_Ext_Constrained_delegation_acl.x \
asn1_HDB_Ext_KeyRotation.x \
asn1_HDB_Ext_Lan_Manager_OWF.x \
asn1_HDB_Ext_Password.x \
asn1_HDB_Ext_Aliases.x \
asn1_HDB_Ext_KeySet.x \
asn1_HDB_extension.x \
asn1_HDB_extensions.x \
asn1_HDB_EncTypeList.x \
asn1_HDB_EntryOrAlias.x \
asn1_KeyRotation.x \
asn1_KeyRotationFlags.x \
asn1_HDB_entry.x \
asn1_HDB_entry_alias.x \
asn1_HDB_keyset.x \
asn1_Keys.x
asn1_Salt.c \
asn1_Key.c \
asn1_Event.c \
asn1_HDBFlags.c \
asn1_GENERATION.c \
asn1_HDB_Ext_PKINIT_acl.c \
asn1_HDB_Ext_PKINIT_cert.c \
asn1_HDB_Ext_PKINIT_hash.c \
asn1_HDB_Ext_Constrained_delegation_acl.c \
asn1_HDB_Ext_KeyRotation.c \
asn1_HDB_Ext_Lan_Manager_OWF.c \
asn1_HDB_Ext_Password.c \
asn1_HDB_Ext_Aliases.c \
asn1_HDB_Ext_KeySet.c \
asn1_HDB_extension.c \
asn1_HDB_extensions.c \
asn1_HDB_EncTypeList.c \
asn1_HDB_EntryOrAlias.c \
asn1_KeyRotation.c \
asn1_KeyRotationFlags.c \
asn1_HDB_entry.c \
asn1_HDB_entry_alias.c \
asn1_HDB_keyset.c \
asn1_Keys.c
CLEANFILES = $(BUILT_SOURCES) $(gen_files_hdb) \
hdb_asn1{,-priv}.h* hdb_asn1_files hdb_asn1-template.[cx]
hdb_asn1{,-priv}.h hdb_asn1_files hdb_asn1-template.c \
hdb_asn1_syms.c hdb_asn1_oids.c hdb_asn1.json \
testhdb-*
LDADD = libhdb.la \
../krb5/libkrb5.la \
@@ -139,7 +141,7 @@ $(srcdir)/hdb-protos.h: $(dist_libhdb_la_SOURCES)
$(srcdir)/hdb-private.h: $(dist_libhdb_la_SOURCES)
cd $(srcdir); perl ../../cf/make-proto.pl -q -P comment -p hdb-private.h $(dist_libhdb_la_SOURCES) || rm -f hdb-private.h
$(gen_files_hdb) hdb_asn1.hx hdb_asn1-priv.hx: hdb_asn1_files
$(gen_files_hdb) hdb_asn1.h hdb_asn1-priv.h: hdb_asn1_files
hdb_asn1_files: $(ASN1_COMPILE_DEP) $(srcdir)/hdb.asn1
$(ASN1_COMPILE) --sequence=HDB-extensions \

View File

@@ -35,15 +35,11 @@ intcflags=-DASN1_LIB
!include ../../windows/NTMakefile.w32
gen_files_hdb = $(OBJ)\asn1_hdb_asn1.x
$(gen_files_hdb) $(OBJ)\hdb_asn1.hx $(OBJ)\hdb_asn1-priv.hx: $(BINDIR)\asn1_compile.exe hdb.asn1
$(OBJ)\asn1_hdb_asn1.c $(OBJ)\hdb_asn1.h $(OBJ)\hdb_asn1-priv.h: $(BINDIR)\asn1_compile.exe hdb.asn1
cd $(OBJ)
$(BINDIR)\asn1_compile.exe --sequence=HDB-extensions --sequence=HDB-Ext-KeyRotation --sequence=HDB-Ext-KeySet --sequence=Keys --one-code-file $(SRCDIR)\hdb.asn1 hdb_asn1
cd $(SRCDIR)
$(gen_files_hdb:.x=.c): $$(@R).x
!ifdef OPENLDAP_MODULE
ldap_dll = $(BINDIR)\hdb_ldap.dll
@@ -100,7 +96,7 @@ libhdb_OBJs = \
$(OBJ)\mkey.obj \
$(OBJ)\ndbm.obj \
$(OBJ)\print.obj \
$(gen_files_hdb:.x=.obj) \
$(OBJ)\asn1_hdb_asn1.obj \
$(OBJ)\hdb_err.obj
$(OBJ)\hdb_err.c $(OBJ)\hdb_err.h: hdb_err.et