1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
|
#
# OSP Toolkit Makefile for Debian
#
#
# Default install directory
#
INSTALL_PATH = $(DESTDIR)/usr
CONFIG_PATH = $(DESTDIR)/etc
PKGCFG_PATH = $(DESTDIR)/usr/lib/pkgconfig
#
# Compile tools
#
CC = gcc
D2M = docbook-to-man
#
# Compile flags
#
DEFFLAGS = -DOSP_ALLOW_DUP_TXN -DOSP_NO_DELETE_CHECK -DOSP_SDK -D_REENTRANT \
-D_POSIX_THREADS -DOPENSSL_NO_KRB5 -D_GNU_SOURCE
INCFLAGS = -I$(INCDIR) -I$(ENRDIR) -I$(EXPDIR)
# DEBFLAGS = -DOSPC_DEBUG=1
GFLAGS = -Wall
CFLAGS += $(DEFFLAGS) $(INCFLAGS) $(DEBFLAGS) $(GFLAGS) $(ADDFLAGS)
colon = :
period = .
LTFLAGS = -rpath /usr/lib -version-number $(subst $(period),$(colon),$(VERSION))
#
# General libries
#
GENLIBS = -lm -pthread
#
# SSL library selection for OpenSSL
#
SSL_OBJS = ospopenssl
SSLLIB = -lssl
CRYPTOLIB = -lcrypto
#
# OSP Toolkit directories
#
INCDIR = include
LIBDIR = lib
SRCDIR = src
ENRDIR = enroll
EXPDIR = test
BINDIR = bin
DEBDIR = debian
#
# OSP Toolkit Debian directories
#
DINCDIR = $(INSTALL_PATH)/include/osp
DLIBDIR = $(INSTALL_PATH)/lib
DBINDIR = $(INSTALL_PATH)/lib/osp
DMANDIR = $(INSTALL_PATH)/share/man/man1
DDOCDIR = $(INSTALL_PATH)/share/doc/osptoolkit
DCFGDIR = $(CONFIG_PATH)/osp
#
# OSP Toolkit objects & library
#
# Object files
OSP_OBJS = osppkcs1 osppkcs8 osppkcs7 ospcryptowrap ospasn1ids ospasn1object \
ospx509 ospasn1 ospasn1primitives ospasn1parse ospcrypto osptnlog \
ospsecssl ospsecurity osplist osphttp ospxml ospmime ospprovider \
ospproviderapi ospsocket ospcomm osputils ospmsgque ospmsginfo \
osptransapi osptrans ospinit ospmsgelem ospdest ospusage ospmsgattr \
ospcallid osptoken ospmsgutil ospmsgdesc ospostime ospxmltype \
ospxmlparse ospxmlattr ospxmlutil ospxmlenc ospxmlelem ospusageind \
ospstatus ospauthreq ospauthrsp ospauthind ospauthcnf ospreauthreq \
ospreauthrsp ospusagecnf ospb64 ospbfr osptokeninfo ospfail \
ospaltinfo ospssl ospstatistics osptnprobe ospaudit osptnaudit \
osptransids ospciscoext ospcapind ospcapcnf ospstir \
$(SSL_OBJS)
OSPOBJS = $(addprefix $(SRCDIR)/,$(addsuffix .lo,$(OSP_OBJS)))
# Library files
OSP_LIB = libosptk
OSPLIB = $(addprefix $(LIBDIR)/,$(addsuffix .la,$(OSP_LIB)))
DOSPLIB = $(addprefix $(DLIBDIR)/,$(addsuffix .la,$(OSP_LIB)))
DOSPLIBLT = $(addprefix $(DLIBDIR)/,$(addsuffix .la,$(OSP_LIB)))
DOSPSTATIC = $(addprefix $(DLIBDIR)/,$(addsuffix .a,$(OSP_LIB)))
DOSPSLIB = $(addprefix $(DLIBDIR)/,$(addsuffix .so,$(OSP_LIB)))
DOSPSHARED = $(addprefix $(DLIBDIR)/,$(addsuffix .so.$(VERSION),$(OSP_LIB)))
DOSPSLINK = $(addprefix $(DLIBDIR)/,$(addsuffix .so.$(MAJOR),$(OSP_LIB)))
# Document file
OSP_DOC = osptoolkit.txt
OSPDOC = $(addprefix $(DEBDIR)/,$(OSP_DOC))
DOSPDOC = $(addprefix $(DDOCDIR)/,$(OSP_DOC))
# Package config file
OSP_PC = $(OSP_LIB)$(MAJOR).pc
OSPPC = $(addprefix $(DEBDIR)/,$(OSP_PC))
DOSPPC = $(addprefix $(PKGCFG_PATH)/,$(OSP_PC))
#
# OSP Toolkit enroll application
#
ENR_OBJS = osptnepinit osptnepenroll osptnep osptneputil
ENROBJS = $(addprefix $(ENRDIR)/,$(addsuffix .o,$(ENR_OBJS)))
ENR_EXEC = enroll
ENREXEC = $(addprefix $(BINDIR)/,$(ENR_EXEC))
DENREXEC = $(addprefix $(DBINDIR)/,$(ENR_EXEC))
ENR_WRAP = enroll.sh
ENRWRAP = $(addprefix $(BINDIR)/,$(ENR_WRAP))
DENRWRAP = $(addprefix $(DBINDIR)/,$(ENR_WRAP))
ENR_CONF = openssl.cnf
ENRCONF = $(addprefix $(BINDIR)/,$(ENR_CONF))
DENRCONF = $(addprefix $(DCFGDIR)/,$(ENR_CONF))
ENR_SGML = ospenroll.sgml
ENRSGML = $(addprefix $(DEBDIR)/,$(ENR_SGML))
ENR_MAN = ospenroll.1
ENRMAN = $(addprefix $(DEBDIR)/,$(ENR_MAN))
DENRMAN = $(addprefix $(DMANDIR)/,$(ENR_MAN))
#
# OSP Toolkit test application
#
EXP_OBJS = nonblocking syncque test_app
EXPOBJS = $(addprefix $(EXPDIR)/,$(addsuffix .o,$(EXP_OBJS)))
EXP_EXEC = test_app
EXPEXEC = $(addprefix $(BINDIR)/,$(EXP_EXEC))
DEXPEXEC = $(addprefix $(DBINDIR)/,$(EXP_EXEC))
EXP_CONF = test.cfg
EXPCONF = $(addprefix $(BINDIR)/,$(EXP_CONF))
DEXPCONF = $(addprefix $(DCFGDIR)/,$(EXP_CONF))
EXP_SGML = osptest.sgml
EXPSGML = $(addprefix $(DEBDIR)/,$(EXP_SGML))
EXP_MAN = osptest.1
EXPMAN = $(addprefix $(DEBDIR)/,$(EXP_MAN))
DEXPMAN = $(addprefix $(DMANDIR)/,$(EXP_MAN))
.SUFFIXES: .lo .c
.c.o:
$(CC) $(CPPFLAGS) $(CFLAGS) -o $(@) -c $(<)
.c.lo:
libtool --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -o $(@) -c $(<)
build: $(OSPLIB) $(OSPPC)
$(OSPLIB): $(OSPOBJS)
libtool --mode=link $(CC) $(LDFLAGS) $(GFLAGS) $(ADDFLAGS) -o $(@) $(^) \
$(LTFLAGS) $(SSLLIB) $(CRYPTOLIB) $(GENLIBS)
$(OSPPC): Makefile
@ echo 'Building $(OSPPC) ...'
@ ( echo 'prefix=$(INSTALL_PATH)'; \
echo 'exec_prefix=$${prefix}'; \
echo 'libdir=$${exec_prefix}/lib'; \
echo 'includedir=$${prefix}/include'; \
echo ''; \
echo 'Name: OSPToolkit'; \
echo 'Description: OSP shared library'; \
echo 'Version: '$(VERSION); \
echo 'Requires: '; \
echo 'Libs: -L$${libdir} -losptk'; \
echo 'Libs.private: $(SSLLIB) $(CRYPTOLIB) $(GENLIBS)'; \
echo 'Cflags: -I$${includedir} -I$${includedir}/osp' ) > $(OSPPC)
enroll: $(ENREXEC)
$(ENREXEC): $(ENROBJS) $(OSPLIB)
libtool --mode=link $(CC) $(LDFLAGS) -o $(@) $(^) $(CRYPTOLIB)
test: $(EXPEXEC)
$(EXPEXEC): $(EXPOBJS) $(OSPLIB)
libtool --mode=link $(CC) $(LDFLAGS) -o $(@) $(^)
manpages: $(ENRMAN) $(EXPMAN)
$(ENRMAN): $(ENRSGML)
$(D2M) $(<) > $(@)
$(EXPMAN): $(EXPSGML)
$(D2M) $(<) > $(@)
install-lib: build
libtool --mode=install install -D $(OSPLIB) $(DOSPLIB)
rm -f $(DOSPLIBLT)
rm -f $(DOSPSTATIC)
rm -f $(DOSPSLIB)
install-dev: build
install -d $(DINCDIR)
libtool --mode=install install $(INCDIR)/osp/* $(DINCDIR)
libtool --mode=install install -D $(OSPLIB) $(DOSPLIB)
rm -f $(DOSPLIB)
rm -f $(DOSPSHARED)
rm -f $(DOSPSLINK)
libtool --mode=install install -D $(OSPPC) $(DOSPPC)
chmod 644 $(DOSPPC)
install-bin: enroll test manpages
libtool --mode=install install -D $(ENREXEC) $(DENREXEC)
libtool --mode=install install -D $(ENRWRAP) $(DENRWRAP)
libtool --mode=install install -D $(ENRCONF) $(DENRCONF)
chmod 644 $(DENRCONF)
libtool --mode=install install -D $(ENRMAN) $(DENRMAN)
libtool --mode=install install -D $(EXPEXEC) $(DEXPEXEC)
libtool --mode=install install -D $(EXPCONF) $(DEXPCONF)
chmod 644 $(DEXPCONF)
libtool --mode=install install -D $(EXPMAN) $(DEXPMAN)
libtool --mode=install install -D $(OSPDOC) $(DOSPDOC)
clean:
libtool --mode=clean rm -f $(OSPLIB) $(OSPOBJS)
libtool --mode=clean rm -f $(ENREXEC) $(ENROBJS)
libtool --mode=clean rm -f $(EXPEXEC) $(EXPOBJS)
libtool --mode=clean rm -f $(ENRMAN) $(EXPMAN) $(OSPPC)
|