Added RFC 2578, SNMP. Barely useful; the MACRO definitions are all commented out.
[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         rfc2578.h
17 #DOWNWARD-SPIRAL-INTO-ITU# TARGETS += InformationFramework.h UsefulDefinitions.h
18
19 ASN2QUICKDER_DIR = ../tool/asn1ate
20
21 ASN2QUICKDER_CMD = $(ASN2QUICKDER_DIR)/asn1ate/asn2quickder.py
22 ASN2QUICKDER_RUN = PYTHONPATH='$(ASN2QUICKDER_DIR)' $(ASN2QUICKDER_CMD)
23
24 all: $(TARGETS) test
25
26 test: $(TARGETS)
27         rm -f quick-der
28         ln -s . quick-der
29         @ $(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
30
31 %.h: %.asn1
32         @ [ -r $(ASN2QUICKDER_CMD) ] && $(ASN2QUICKDER_RUN) $< || echo Skipped ASN.1 header file generation for $<
33
34 clean:
35         rm -f $(TARGETS) $(foreach h,$(TARGETS),$(h:.h=.c) $(h:.h=.o))
36
37 anew: clean all
38
39 install: all
40         @ mkdir -p $(PREFIX)/include/quick-der
41         @ [ -r $(ASN2QUICKDER_CMD) ] && $(foreach h,$(TARGETS),install '$(h)' '$(PREFIX)/include/quick-der' && ) echo Installed header files
42
43 uninstall:
44         @ $(foreach h,$(TARGETS),rm -f '$(PREFIX)/include/quick-der/$(h)' && ) echo Removed header files
45         @ rmdir --ignore-fail-on-non-empty '$(PREFIX)/include/quick-der'
46