asn.1/Makefile
author Krista Bennett <krista@pep-project.org>
Tue, 22 Aug 2017 15:57:25 +0200
changeset 1989 d3e5bc4a9854
parent 1988 ea7bceda4dc8
child 1993 efaeadf3e6f0
permissions -rw-r--r--
Keep me away from the default branch. Reverted to 1954:2f1ed8cf6b6f, because though damiano's Makefile changes are sexy, they'll break ppl.
     1 # This file is under GNU General Public License 3.0
     2 # see LICENSE.txt
     3 
     4 include ../Makefile.conf
     5 
     6 ifeq ($(BUILD_ON),Linux)
     7 ifeq ($(BUILD_FOR),Linux)
     8 
     9 CC=gcc
    10 CFLAGS?=-fPIC
    11 else
    12 $(error don't know how to make for $(BUILD_FOR) on $(BUILD_ON))
    13 endif
    14 endif
    15 
    16 ALL_SOURCE=$(subst $(NO_SOURCE),,$(wildcard *.c))
    17 ALL_OBJECTS=$(subst .c,.o,$(ALL_SOURCE))
    18 
    19 libasn1.a: $(ALL_OBJECTS)
    20 	ar -rc $@ $(ALL_OBJECTS)
    21 
    22 generate: Sync-Protocols.c
    23 	rm -f converter-sample.c
    24 
    25 %.o: %.c %.h
    26 	$(CC) $(CFLAGS) $(OPTIMIZE) -I. -I$(ASN1C_INCLUDE) -c $< -o $@
    27 
    28 Sync-Protocols.c: protocols.asn1 devicegroup.asn1 pEp.asn1
    29 	$(ASN1C) -gen-PER -fincludes-quoted -fcompound-names -pdu=PEP.Message pEp.asn1 devicegroup.asn1 $<
    30 
    31 .PHONY: clean
    32 
    33 clean:
    34 	rm -f *.a *.o *.c *.h *.sample
    35 
    36 install: libasn1.a
    37 	cp $< $(PREFIX)/lib/