Browse Source

asn1: Cleanup Makefile.

* Use variables to remove redundant listing of ASN.1 file names.
* Use variables to remove redundant naming of asn1c options.
* Use automatic variable "$+" when running asn1c to avoid redundantly
  listing all dependencies again. (This variable is a GNU make extension.)
IPS-2
Hartmut Goebel 7 months ago
parent
commit
f94a029b41
1 changed files with 17 additions and 7 deletions
  1. +17
    -7
      asn.1/Makefile

+ 17
- 7
asn.1/Makefile View File

@ -7,6 +7,15 @@ ALL_SOURCE=$(subst $(NO_SOURCE),,$(wildcard *.c))
ALL_OBJECTS=$(subst .c,.o,$(ALL_SOURCE))
CPPFLAGS+=$(CPPFLAGS_GENERATED)
ASN1C_INC+= -I.
ASN1C_OPTIONS = -fincludes-quoted -fcompound-names -pdu=auto
DISTRIBUTION = distribution keyreset managedgroup exploration
SYNC = sync keysync trustsync groupsync
STORAGE = storage messagestorage
DISTRIBUTION_FILES = $(addsuffix .asn1, $(DISTRIBUTION))
SYNC_FILES = $(addsuffix .asn1, $(SYNC))
STORAGE_FILES = $(addsuffix .asn1, $(STORAGE))
.PHONY: all clean install uninstall
@ -19,23 +28,24 @@ libasn1.a: $(ALL_OBJECTS)
%.o: %.c %.h
$(CC) $(CFLAGS) $(CPPFLAGS) $(OPTIMIZE) $(ASN1C_INC) -c $< -o $@
Sync.c: sync.asn1 keysync.asn1 trustsync.asn1 groupsync.asn1 pEp.asn1 distribution.asn1
$(ASN1C) -gen-PER -fincludes-quoted -fcompound-names -pdu=auto pEp.asn1 keysync.asn1 trustsync.asn1 groupsync.asn1 distribution.asn1 keyreset.asn1 managedgroup.asn1 exploration.asn1 $<
Sync.c: $(SYNC_FILES) $(DISTRIBUTION_FILES) pEp.asn1
$(ASN1C) -gen-PER $(ASN1C_OPTIONS) $+
rm -f converter-sample.c
touch Sync.c
Distribution.c: distribution.asn1 keyreset.asn1 managedgroup.asn1 exploration.asn1 pEp.asn1
$(ASN1C) -gen-PER -fincludes-quoted -fcompound-names -pdu=auto pEp.asn1 keyreset.asn1 managedgroup.asn1 exploration.asn1 $<
Distribution.c: $(DISTRIBUTION_FILES) pEp.asn1
$(ASN1C) -gen-PER $(ASN1C_OPTIONS) $+
rm -f converter-sample.c
touch Distribution.c
Storage.c: storage.asn1 messagestorage.asn1 pEp.asn1
$(ASN1C) -gen-PER -fincludes-quoted -fcompound-names -pdu=auto pEp.asn1 messagestorage.asn1 $<
Storage.c: $(STORAGE_FILES) pEp.asn1
$(ASN1C) -gen-PER $(ASN1C_OPTIONS) $+
rm -f converter-sample.c
touch Storage.c
clean:
rm -f *.a *.o *.c *.h *.sample sync.asn1 keysync.asn1 trustsync.asn1 groupsync.asn1 distribution.asn1 keyreset.asn1 managedgroup.asn1 exploration.asn1 storage.asn1 messagestorage.asn1
rm -f *.a *.o *.c *.h *.sample \
$(SYNC_FILES) $(DISTRIBUTION_FILES) $(STORAGE_FILES)
install:


Loading…
Cancel
Save