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.
damiano@1960
     1
# Copyright 2017, pEp Foundation
damiano@1954
     2
# This file is part of pEpEngine
damiano@1954
     3
# This file may be used under the terms of the GNU General Public License version 3
vb@1513
     4
# see LICENSE.txt
vb@1513
     5
vb@628
     6
include ../Makefile.conf
vb@628
     7
damiano@1954
     8
ALL_SOURCE=$(wildcard *.c)
vb@637
     9
ALL_OBJECTS=$(subst .c,.o,$(ALL_SOURCE))
vb@637
    10
vb@637
    11
libasn1.a: $(ALL_OBJECTS)
damiano@1954
    12
	ar -rc $@ $^
vb@637
    13
damiano@1966
    14
# "converter-sample.c" is the example file containing a "main()" function generated by ans1c.
damiano@1954
    15
.PHONY: generate
vb@743
    16
generate: Sync-Protocols.c
vb@637
    17
	rm -f converter-sample.c
vb@628
    18
damiano@1966
    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.
vb@628
    20
%.o: %.c %.h
damiano@1966
    21
	$(CC) $(CFLAGS) -Wno-cpp -I. $(ASN1C_INC) -c $< -o $@
vb@628
    22
damiano@1954
    23
Sync-Protocols.c: pEp.asn1 devicegroup.asn1 protocols.asn1
damiano@1954
    24
	$(ASN1C) -gen-PER -fincludes-quoted -fcompound-names -pdu=PEP.Message $^
vb@628
    25
vb@628
    26
.PHONY: clean
vb@628
    27
clean:
vb@637
    28
	rm -f *.a *.o *.c *.h *.sample
damiano@1919
    29
damiano@1954
    30
.PHONY: install
damiano@1919
    31
install: libasn1.a
damiano@1919
    32
	cp $< $(PREFIX)/lib/
damiano@1950
    33
damiano@1950
    34
.PHONY: uninstall
damiano@1950
    35
uninstall:
damiano@1954
    36
	rm -f $(PREFIX)/lib/libasn1.a