generate with asn1c and nmake

master
Volker Birk 2 months ago
parent b7e2e67134
commit 993b76c4db

@ -1,4 +1,5 @@
YML2PROC=py "%YML_HOME%\yml2proc"
ASN1C=asn1c
!IF EXISTS(local.mak)
!include local.mak

@ -21,13 +21,7 @@ ifeq ($(BUILD_FOR),Linux)
CPPFLAGS+=-U_REENTRANT
endif
DISTRIBUTION = distribution keyreset managedgroup exploration echo
SYNC = sync keysync trustsync groupsync
STORAGE = storage messagestorage
DISTRIBUTION_FILES = $(addsuffix .asn1, $(DISTRIBUTION))
SYNC_FILES = $(addsuffix .asn1, $(SYNC))
STORAGE_FILES = $(addsuffix .asn1, $(STORAGE))
include files.mak
.PHONY: all clean install uninstall
@ -40,7 +34,7 @@ libasn1.a: $(ALL_OBJECTS)
%.o: %.c %.h
$(CC) $(CFLAGS) $(CPPFLAGS) $(OPTIMIZE) $(ASN1C_INC) -c $< -o $@
Sync.c: $(SYNC_FILES) $(DISTRIBUTION_FILES) pEp.asn1 # positrontofdik: is it correct that $(DISTRIBUTION_FILES) is among the dependencies? I would guess not
Sync.c: $(SYNC_FILES) pEp.asn1
$(ASN1C) -gen-PER $(ASN1C_OPTIONS) $+
rm -f converter-sample.c
touch Sync.c

@ -0,0 +1,36 @@
# This file is under GNU General Public License 3.0
# see LICENSE.txt
# other than on Unix this NMakefile does only the code generation part
# the library build is in build-win64 in the Visual Studio project
ASN1C_INC= -I.
!include ..\NMakefile.mak
ASN1C_OPTIONS = -fincludes-quoted -fcompound-names -pdu=auto
all: Sync.c Storage.c ASN1Message.c
!include files.mak
Sync.c: $(SYNC_FILES) pEp.asn1
$(ASN1C) -gen-PER $(ASN1C_OPTIONS) $(SYNC_FILES) pEp.asn1
del /f converter-sample.c *.sample 2>nul
# These files are generated with Sync.c because of the dependency
#
# Distribution.c: $(DISTRIBUTION_FILES) pEp.asn1
# $(ASN1C) -gen-PER $(ASN1C_OPTIONS) $(DISTRIBUTION_FILES) pEp.asn1
# del /f converter-sample.c 2>nul
Storage.c: $(STORAGE_FILES) pEp.asn1
$(ASN1C) -gen-PER $(ASN1C_OPTIONS) $(STORAGE_FILES) pEp.asn1
del /f converter-sample.c *.sample 2>nul
ASN1Message.c: message.asn1 pEp.asn1
$(ASN1C) -gen-PER $(ASN1C_OPTIONS) message.asn1 pEp.asn1
del /f converter-sample.c *.sample 2>nul
clean:
del /f/q *.c *.h

@ -0,0 +1,5 @@
# common for Unix and Windows build
DISTRIBUTION_FILES = distribution.asn1 keyreset.asn1 managedgroup.asn1 exploration.asn1 echo.asn1
SYNC_FILES = sync.asn1 keysync.asn1 trustsync.asn1 groupsync.asn1 $(DISTRIBUTION_FILES)
STORAGE_FILES = storage.asn1 messagestorage.asn1

@ -10,6 +10,8 @@ all: .copy
touch .generated
.copy: .generated
@$(MAKE) /f NMakefile copy
copy:
xcopy generated\*.c ..\src /y
xcopy generated\*.h ..\src /y
xcopy generated\*.asn1 ..\asn.1 /y

Loading…
Cancel
Save