Home | History | Annotate | Line # | Download | only in comp_match
      1 # $OpenLDAP$
      2 # This work is part of OpenLDAP Software <http://www.openldap.org/>.
      3 #
      4 # Copyright 2003-2024 The OpenLDAP Foundation.
      5 # Portions Copyright 2004 by IBM Corporation.
      6 # All rights reserved.
      7 
      8 # Copyright 2004 Sang Seok Lim, IBM Corp. All Rights Reserved.
      9 #
     10 # Redistribution and use in source and binary forms, with or without
     11 # modification, are permitted only as authorized by the OpenLDAP
     12 # Public License.
     13 #
     14 # A copy of this license is available in the file LICENSE in the
     15 # top-level directory of the distribution or, alternatively, at
     16 # <http://www.OpenLDAP.org/license.html>.
     17 
     18 LDAP_SRC = ../../..
     19 LDAP_BUILD = $(LDAP_SRC)
     20 LDAP_INC = -I$(LDAP_BUILD)/include -I$(LDAP_SRC)/include -I$(LDAP_SRC)/servers/slapd
     21 LDAP_LIB = $(LDAP_BUILD)/libraries/libldap/libldap.la \
     22 	$(LDAP_BUILD)/libraries/liblber/liblber.la
     23 
     24 SNACC_DIR = ../$(LDAP_SRC)/snacc
     25 SNACC_INC = -I$(SNACC_DIR) -I$(SNACC_DIR)/c-lib/inc
     26 SNACC_LIB = $(SNACC_DIR)/c-lib/libcasn1.a
     27 
     28 SSL_DIR = /usr/local
     29 SSL_INC = -I$(SSL_DIR)/include/openssl
     30 SSL_LIB = -lcrypto -L$(SSL_DIR)/lib
     31 
     32 PLAT = UNIX
     33 NT_LIB = -L$(LDAP_BUILD)/servers/slapd -lslapd
     34 NT_LDFLAGS = -no-undefined -avoid-version
     35 UNIX_LDFLAGS = -version-info $(LTVER)
     36 
     37 LIBTOOL = $(LDAP_BUILD)/libtool
     38 CC = gcc
     39 OPT = -g -O2
     40 DEFS = -DLDAP_COMPONENT
     41 INCS = $(LDAP_INC) $(SNACC_INC) $(SSL_INC)
     42 LIBS = $($(PLAT)_LIB) $(LDAP_LIB) $(SNACC_LIB) $(SSL_LIB)
     43 LD_FLAGS = $(LDFLAGS) $($(PLAT)_LDFLAGS) -rpath $(moduledir) -module
     44 
     45 PROGRAMS = compmatch.la
     46 LTVER = 0:0:0
     47 
     48 prefix=/usr/local
     49 exec_prefix=$(prefix)
     50 ldap_subdir=/openldap
     51 
     52 libdir=$(exec_prefix)/lib
     53 libexecdir=$(exec_prefix)/libexec
     54 moduledir = $(libexecdir)$(ldap_subdir)
     55 
     56 .SUFFIXES: .c .o .lo
     57 
     58 .c.lo:
     59 	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(OPT) $(CPPFLAGS) $(DEFS) $(INCS) -c $<
     60 
     61 all: $(PROGRAMS)
     62 
     63 compmatch.la: componentlib.lo init.lo certificate.lo asn_to_syn_mr.lo authorityKeyIdentifier.lo crl.lo
     64 	$(LIBTOOL) --mode=link $(CC) $(LD_FLAGS) -o $@ $? $(LIBS)
     65 
     66 clean:
     67 	rm -rf *.o *.lo *.la .libs
     68 
     69 install: $(PROGRAMS)
     70 	mkdir -p $(DESTDIR)$(moduledir)
     71 	for p in $(PROGRAMS) ; do \
     72 		$(LIBTOOL) --mode=install cp $$p $(DESTDIR)$(moduledir) ; \
     73 	done
     74 
     75