Introduced PKCS #5, PKCS #7, PKCS #8, PKCS #12 (it compiles, so let's ship it...)
[quick-der] / rfc / Makefile
1 #
2 # This directory holds .asn1 files derived from the pristine versions in orig/
3 # that were adapted (and commented with "--asn1ate" where this is done) to make
4 # it pass through the compiler.
5 #
6 # Current TODO:
7 #  - order definitions, the compiler now runs into problems
8 #  - check for undefined names, if possible
9 #  - map ... to DER_PACK_OPTIONAL, DER_PACK_LEAVE -- and process accordingly
10 #
11
12 PREFIX = /usr/local
13
14 TARGETS = rfc3280.h rfc4120.h rfc4511.h rfc5280.h \
15         rfc2898.h rfc2315.h rfc5208.h rfc7292.h
16 #DOWNWARD-SPIRAL-INTO-ITU# TARGETS += InformationFramework.h UsefulDefinitions.h
17
18 ASN2QUICKDER_DIR = ../tool/asn1ate
19
20 ASN2QUICKDER_CMD = $(ASN2QUICKDER_DIR)/asn1ate/asn2quickder.py
21 ASN2QUICKDER_RUN = PYTHONPATH='$(ASN2QUICKDER_DIR)' $(ASN2QUICKDER_CMD)
22
23 all: $(TARGETS) test
24
25 test: $(TARGETS)
26         rm -f quick-der
27         ln -s . quick-der
28         @ $(foreach h,$(TARGETS),echo > '$(h:.h=.c)' '#include "$(h)"' && [ -r $h ] && gcc -I . -c '$(h:.h=.c)' && ) echo 'Passed all header compilation tests' || echo Skipped compilation of skipped header files
29
30 %.h: %.asn1
31         @ [ -r $(ASN2QUICKDER_CMD) ] && $(ASN2QUICKDER_RUN) $< || echo Skipped ASN.1 header file generation for $<
32
33 clean:
34         rm -f $(TARGETS) $(foreach h,$(TARGETS),$(h:.h=.c) $(h:.h=.o))
35
36 anew: clean all
37
38 install: all
39         @ mkdir -p $(PREFIX)/include/quick-der
40         @ [ -r $(ASN2QUICKDER_CMD) ] && $(foreach h,$(TARGETS),install '$(h)' '$(PREFIX)/include/quick-der' && ) echo Installed header files
41
42 uninstall:
43         @ $(foreach h,$(TARGETS),rm -f '$(PREFIX)/include/quick-der/$(h)' && ) echo Removed header files
44         @ rmdir --ignore-fail-on-non-empty '$(PREFIX)/include/quick-der'
45