asn.1/Makefile
author Damiano Boppart <damiano@pep-security.net>
Wed, 16 Aug 2017 15:27:54 +0000
branchENGINE-228
changeset 1966 0329556f28ab
parent 1960 3e0027330faa
child 1968 e30b1515b7b9
permissions -rw-r--r--
Remove the CPP warnings for asn1c generated code. Do not generate .d files when the goal is clean.
     1 # Copyright 2017, pEp Foundation
     2 # This file is part of pEpEngine
     3 # This file may be used under the terms of the GNU General Public License version 3
     4 # see LICENSE.txt
     5 
     6 include ../Makefile.conf
     7 
     8 ALL_SOURCE=$(wildcard *.c)
     9 ALL_OBJECTS=$(subst .c,.o,$(ALL_SOURCE))
    10 
    11 libasn1.a: $(ALL_OBJECTS)
    12 	ar -rc $@ $^
    13 
    14 # "converter-sample.c" is the example file containing a "main()" function generated by ans1c.
    15 .PHONY: generate
    16 generate: Sync-Protocols.c
    17 	rm -f converter-sample.c
    18 
    19 # '-Wno-cpp' is required to suppress the warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" otherwise printed during the compilation of every asn1c-generated C file.
    20 %.o: %.c %.h
    21 	$(CC) $(CFLAGS) -Wno-cpp -I. $(ASN1C_INC) -c $< -o $@
    22 
    23 Sync-Protocols.c: pEp.asn1 devicegroup.asn1 protocols.asn1
    24 	$(ASN1C) -gen-PER -fincludes-quoted -fcompound-names -pdu=PEP.Message $^
    25 
    26 .PHONY: clean
    27 clean:
    28 	rm -f *.a *.o *.c *.h *.sample
    29 
    30 .PHONY: install
    31 install: libasn1.a
    32 	cp $< $(PREFIX)/lib/
    33 
    34 .PHONY: uninstall
    35 uninstall:
    36 	rm -f $(PREFIX)/lib/libasn1.a