Improved building of RFCs; added empty directory for ITU specs
authorRick van Rein <rick@openfortress.nl>
Thu, 10 Mar 2016 22:32:17 +0000 (22:32 +0000)
committerRick van Rein <rick@openfortress.nl>
Thu, 10 Mar 2016 22:32:17 +0000 (22:32 +0000)
itu/Makefile [new file with mode: 0644]
rfc/Makefile

diff --git a/itu/Makefile b/itu/Makefile
new file mode 100644 (file)
index 0000000..b9dfe7d
--- /dev/null
@@ -0,0 +1,41 @@
+#
+# This directory holds .asn1 files derived from the pristine versions in orig/
+# that were adapted (and commented with "--asn1ate" where this is done) to make
+# it pass through the compiler.
+#
+# Current TODO:
+#  - order definitions, the compiler now runs into problems
+#  - check for undefined names, if possible
+#  - map ... to DER_PACK_OPTIONAL, DER_PACK_LEAVE -- and process accordingly
+#
+
+PREFIX = /usr/local
+
+TARGETS = # rfc3280.h rfc4120.h rfc4511.h rfc5280.h
+
+ASN2QUICKDER_DIR = ../tool/asn1ate
+
+ASN2QUICKDER_CMD = $(ASN2QUICKDER_DIR)/asn1ate/asn2quickder.py
+ASN2QUICKDER_RUN = PYTHONPATH='$(ASN2QUICKDER_DIR)' $(ASN2QUICKDER_CMD)
+
+all: $(TARGETS) test
+
+test: $(TARGETS)
+       @ $(foreach h,$(TARGETS),echo > '$(h:.h=.c)' '#include "$(h)"' && gcc -c '$(h:.h=.c)' && ) echo 'Passed all header compilation tests'
+
+%.h: %.asn1
+       $(ASN2QUICKDER_RUN) $<
+
+clean:
+       rm -f $(TARGETS) $(foreach h,$(TARGETS),$(h:.h=.c) $(h:.h=.o))
+
+anew: clean all
+
+install: all
+       @ mkdir -p $(PREFIX)/include/quick-der
+       @ [ -r $(ASN2QUICKDER_CMD) ] && $(foreach h,$(TARGETS),install '$(h)' '$(PREFIX)/include/quick-der' && ) echo Installed header files
+
+uninstall:
+       @ $(foreach h,$(TARGETS),rm -f '$(PREFIX)/include/quick-der/$(h)' && ) echo Removed header files
+       @ rmdir --ignore-fail-on-non-empty '$(PREFIX)/include/quick-der'
+
index 942f4c0..01cb571 100644 (file)
@@ -15,7 +15,8 @@ TARGETS = rfc3280.h rfc4120.h rfc4511.h rfc5280.h
 
 ASN2QUICKDER_DIR = ../tool/asn1ate
 
-ASN2QUICKDER = PYTHONPATH='$(ASN2QUICKDER_DIR)' $(ASN2QUICKDER_DIR)/asn1ate/asn2quickder.py
+ASN2QUICKDER_CMD = $(ASN2QUICKDER_DIR)/asn1ate/asn2quickder.py
+ASN2QUICKDER_RUN = PYTHONPATH='$(ASN2QUICKDER_DIR)' $(ASN2QUICKDER_CMD)
 
 all: $(TARGETS) test
 
@@ -23,7 +24,7 @@ test: $(TARGETS)
        @ $(foreach h,$(TARGETS),echo > '$(h:.h=.c)' '#include "$(h)"' && gcc -c '$(h:.h=.c)' && ) echo 'Passed all header compilation tests'
 
 %.h: %.asn1
-       $(ASN2QUICKDER) $<
+       $(ASN2QUICKDER_RUN) $<
 
 clean:
        rm -f $(TARGETS) $(foreach h,$(TARGETS),$(h:.h=.c) $(h:.h=.o))
@@ -32,7 +33,7 @@ anew: clean all
 
 install: all
        @ mkdir -p $(PREFIX)/include/quick-der
-       @ [ -r $(ASN2QUICKDER) ] && $(foreach h,$(TARGETS),install '$(h)' '$(PREFIX)/include/quick-der' && ) echo Installed header files
+       @ [ -r $(ASN2QUICKDER_CMD) ] && $(foreach h,$(TARGETS),install '$(h)' '$(PREFIX)/include/quick-der' && ) echo Installed header files
 
 uninstall:
        @ $(foreach h,$(TARGETS),rm -f '$(PREFIX)/include/quick-der/$(h)' && ) echo Removed header files