asn.1/Makefile
branchsync
changeset 2829 e444c3c960bb
parent 2210 17c30881c885
child 2830 d6f044e43e1a
     1.1 --- a/asn.1/Makefile	Tue Aug 07 14:24:15 2018 +0200
     1.2 +++ b/asn.1/Makefile	Tue Aug 07 17:16:03 2018 +0200
     1.3 @@ -1,35 +1,30 @@
     1.4 -# Copyright 2017, pEp Foundation
     1.5 -# This file is part of pEpEngine
     1.6 -# This file may be used under the terms of the GNU General Public License version 3
     1.7 +# This file is under GNU General Public License 3.0
     1.8  # see LICENSE.txt
     1.9  
    1.10  include ../default.conf
    1.11  
    1.12 -ALL_SOURCE=$(wildcard *.c)
    1.13 +ALL_SOURCE=$(subst $(NO_SOURCE),,$(wildcard *.c))
    1.14  ALL_OBJECTS=$(subst .c,.o,$(ALL_SOURCE))
    1.15  
    1.16 +all: generate
    1.17 +	make libasn1.a
    1.18 +
    1.19  libasn1.a: $(ALL_OBJECTS)
    1.20 -	ar -rc $@ $^
    1.21 +	ar -rc $@ $(ALL_OBJECTS)
    1.22  
    1.23 -# "converter-sample.c" is the example file containing a "main()" function generated by ans1c.
    1.24 -.PHONY: generate
    1.25 -generate: Sync-Protocols.c
    1.26 +generate: Sync.c
    1.27  	rm -f converter-sample.c
    1.28  
    1.29  %.o: %.c %.h
    1.30 -	$(CC) $(CFLAGS) $(CFLAGS_GENERATED) -I. $(ASN1C_INC) -c $< -o $@
    1.31 +	$(CC) $(CFLAGS) $(OPTIMIZE) -I. -I$(ASN1C_INC) -c $< -o $@
    1.32  
    1.33 -Sync-Protocols.c: pEp.asn1 devicegroup.asn1 protocols.asn1
    1.34 -	$(ASN1C) -gen-PER -fincludes-quoted -fcompound-names -pdu=PEP.Message $^
    1.35 +Sync.c: sync.asn1 keysync.asn1 pEp.asn1
    1.36 +	$(ASN1C) -gen-PER -fincludes-quoted -fcompound-names -pdu=PEP.Message pEp.asn1 keysync.asn1 $<
    1.37 +
    1.38 +sync.asn1 keysync.asn1 pEp.asn1:
    1.39 +	cp -f ../sync/generated/*.asn1 ../asn.1
    1.40  
    1.41  .PHONY: clean
    1.42 +
    1.43  clean:
    1.44 -	rm -f *.a *.o *.c *.h *.sample
    1.45 -
    1.46 -.PHONY: install
    1.47 -install: libasn1.a
    1.48 -	cp $< $(PREFIX)/lib/
    1.49 -
    1.50 -.PHONY: uninstall
    1.51 -uninstall:
    1.52 -	rm -f $(PREFIX)/lib/libasn1.a
    1.53 +	rm -f *.a *.o *.c *.h *.sample sync.asn1 keysync.asn1