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.
krista@1989
     1
# This file is under GNU General Public License 3.0
vb@1513
     2
# see LICENSE.txt
vb@1513
     3
vb@628
     4
include ../Makefile.conf
vb@628
     5
krista@1989
     6
ifeq ($(BUILD_ON),Linux)
krista@1989
     7
ifeq ($(BUILD_FOR),Linux)
krista@1989
     8
krista@1989
     9
CC=gcc
krista@1989
    10
CFLAGS?=-fPIC
krista@1989
    11
else
krista@1989
    12
$(error don't know how to make for $(BUILD_FOR) on $(BUILD_ON))
krista@1989
    13
endif
krista@1989
    14
endif
krista@1989
    15
krista@1989
    16
ALL_SOURCE=$(subst $(NO_SOURCE),,$(wildcard *.c))
vb@637
    17
ALL_OBJECTS=$(subst .c,.o,$(ALL_SOURCE))
vb@637
    18
vb@637
    19
libasn1.a: $(ALL_OBJECTS)
krista@1989
    20
	ar -rc $@ $(ALL_OBJECTS)
vb@637
    21
vb@743
    22
generate: Sync-Protocols.c
vb@637
    23
	rm -f converter-sample.c
vb@628
    24
vb@628
    25
%.o: %.c %.h
krista@1989
    26
	$(CC) $(CFLAGS) $(OPTIMIZE) -I. -I$(ASN1C_INCLUDE) -c $< -o $@
vb@628
    27
krista@1989
    28
Sync-Protocols.c: protocols.asn1 devicegroup.asn1 pEp.asn1
krista@1989
    29
	$(ASN1C) -gen-PER -fincludes-quoted -fcompound-names -pdu=PEP.Message pEp.asn1 devicegroup.asn1 $<
vb@628
    30
vb@628
    31
.PHONY: clean
krista@1989
    32
vb@628
    33
clean:
vb@637
    34
	rm -f *.a *.o *.c *.h *.sample
damiano@1919
    35
damiano@1919
    36
install: libasn1.a
damiano@1919
    37
	cp $< $(PREFIX)/lib/