2 # Makefile to build snacc-generated code for pkcs* and cms
4 ASN1_SRC= sm_vdatypes.asn sm_x501ud.asn sm_x411ub.asn sm_x411mtsas.asn \
5 sm_x501if.asn sm_x520sa.asn sm_x509cmn.asn sm_x509af.asn \
6 sm_x509ce.asn pkcs1oids.asn pkcs9oids.asn sm_cms.asn sm_ess.asn \
7 pkcs7.asn pkcs8.asn appleoids.asn pkcs10.asn
9 SNACC_SRC= $(SRCROOT)/..
11 GEN_SRC= $(ASN1_SRC:%.asn=%.cpp)
12 GEN_HDR= $(ASN1_SRC:%.asn=%.h)
14 PKCS_HOME=$(shell echo `pwd`)
16 ASN_SRC_DIR= $(PKCS_HOME)/asn
17 GEN_SRC_DIR= $(PKCS_HOME)/c++
18 GEN_HDR_DIR= $(PKCS_HOME)/inc
23 # get snacc headers from snacc project source, not from /usr/local/include
25 HDR_INCPATH= -I$(SNACC_SRC)/c++-lib/inc
28 # standard useful ASN1
30 ASN_USEFUL= asn-useful.asn1
33 # local build directory,
35 #LOCAL_BUILD= /Data_and_Apps/dmitchBuild
36 LOCAL_BUILD= $(BUILT_PRODUCTS_DIR)
38 CFLAGS= -g $(HDR_INCPATH) -DVDADER_RULES
39 LDFLAGS= -lstdc++ -lsnacc++ -L$(LOCAL_BUILD)
42 SNACC= /usr/local/bin/snacc
43 SNACC_FLAGS= -C -D -u $(ASN_USEFUL)
45 first: $(GEN_SRC) move_genfiles
48 (cd $(ASN_SRC_DIR); $(SNACC) $(SNACC_FLAGS) $(ASN1_SRC))
50 move_genfiles: clean_genfiles
52 mv *.cpp $(GEN_SRC_DIR); \
53 mv *.h $(GEN_HDR_DIR))
56 (cd $(GEN_SRC_DIR); rm -f *.cpp)
57 (cd $(GEN_HDR_DIR); rm -f *.h)