sha1.c snprintf.c strlcat.c strlcpy.c token.c udpfromto.c \
valuepair.c fifo.c
+LT_OBJS = $(SRCS:.c=.lo)
+
INCLUDES = ../include/radius.h ../include/libradius.h \
../include/missing.h ../include/autoconf.h
# the other end is doing.
CFLAGS += -DHMAC_SHA1_DATA_PROBLEMS
-TARGET=$(LIBPREFIX)radius
-
-all: $(TARGET).la
-
-STATIC_OBJS = $(SRCS:.c=.o)
-DYNAMIC_OBJS = $(SRCS:.c=.lo)
-
-$(STATIC_OBJS): $(INCLUDES)
-$(DYNAMIC_OBJS): $(INCLUDES)
+ifeq ($(USE_SHARED_LIBS),yes)
+LINK_MODE = -export-dynamic
+else
+LINK_MODE = -static
+endif
-#######################################################################
-#
-# define new rules
-#
-#######################################################################
-%.o : %.c
- $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c $< -o $@
+TARGET = $(LIBPREFIX)radius
+# Define new rule for libtool objects
%.lo : %.c
$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c $<
+all: $(TARGET).la
-ifneq ($(USE_SHARED_LIBS),yes)
-LINK_MODE=-static
-endif
-
-$(TARGET).la: $(DYNAMIC_OBJS)
+$(TARGET).la: $(LT_OBJS)
$(LIBTOOL) --mode=link $(CC) -release $(RADIUSD_VERSION) \
$(LDFLAGS) $(LINK_MODE) -o $@ -rpath $(libdir) $^
-static:
-
-dynamic: $(TARGET).la
+$(LT_OBJS): $(INCLUDES)
clean:
- rm -f *.o *.lo $(TARGET).a $(TARGET).la
+ rm -f *.o *.lo $(TARGET).la
rm -rf .libs
install: all
- $(LIBTOOL) --mode=install $(INSTALL) -c \
- $(TARGET).la $(R)$(libdir)/$(TARGET).la;
+ $(LIBTOOL) --mode=install $(INSTALL) -c $(TARGET).la $(R)$(libdir)
rm -f $(R)$(libdir)/$(TARGET)-$(RADIUSD_VERSION).la;
ln -s $(TARGET).la $(R)$(libdir)/$(TARGET)-$(RADIUSD_VERSION).la
#
-# Makefile
+# Makefile
#
# Version: $Id$
#
WHAT_TO_MAKE = all
-#
-# Build static AND dynamic libraries by default.
-# Later, we'll figure out how to get libtool to automagically do this.
-#
-TARGET_LIBS = static dynamic
-
all:
@$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
-static:
- @[$$USE_STATIC_LIBS = "yes" ] && $(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
-
-dynamic:
- @[$$USE_SHARED_LIBS = "yes" ] && $(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
-
install:
$(INSTALL) -d -m 755 $(R)$(libdir)
@$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
#
# Make a unique Acct-Unique-Session-Id
#
+# Version: $Id$
#
TARGET = rlm_acct_unique
SRCS = rlm_acct_unique.c
-HEADERS =
-RLM_CFLAGS =
-RLM_LIBS =
include ../rules.mak
-
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+#
+# Makefile
+#
+# Version: $Id$
+#
+
TARGET = rlm_always
SRCS = rlm_always.c
-HEADERS =
-RLM_CFLAGS =
-RLM_LIBS =
include ../rules.mak
-
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
#
-# $Id$
+# Makefile
+#
+# Version: $Id$
#
TARGET = rlm_attr_filter
SRCS = rlm_attr_filter.c
-HEADERS =
-RLM_CFLAGS =
-RLM_LIBS =
-# over-ride the previous assignment if we're not building anything
include ../rules.mak
-
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
-
+#
+# $Id$
+#
+
TARGET = @targetname@
SRCS = rlm_attr_rewrite.c
-HEADERS =
+HEADERS =
RLM_CFLAGS = @attr_rewrite_cflags@
RLM_LIBS = @attr_rewrite_ldflags@
-RLM_INSTALL =
+RLM_INSTALL =
include ../rules.mak
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
+#
+# $Id$
+#
+
TARGET = @targetname@
SRCS = rlm_caching.c
HEADERS =
include ../rules.mak
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
+#
+# $Id$
+#
+
TARGET = @targetname@
SRCS = rlm_checkval.c
-HEADERS =
+HEADERS =
RLM_CFLAGS = @checkval_cflags@
RLM_LIBS = @checkval_ldflags@
-RLM_INSTALL =
+RLM_INSTALL =
include ../rules.mak
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
+#
+# Makefile
+#
+# Version: $Id$
+#
+
TARGET = rlm_copy_packet
SRCS = rlm_copy_packet.c
-HEADERS =
-RLM_CFLAGS =
-RLM_LIBS =
include ../rules.mak
-
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+#
+# $Id$
+#
+
TARGET = @targetname@
SRCS = rlm_counter.c
HEADERS =
include ../rules.mak
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
+#
+# Makefile
+#
+# Version: $Id$
+#
+
TARGET = rlm_cram
SRCS = rlm_cram.c
-# over-ride the previous assignment if we're not building anything
include ../rules.mak
-
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+#
+# Makefile
+#
+# Version: $Id$
+#
+
TARGET = rlm_digest
SRCS = rlm_digest.c
-HEADERS =
-RLM_CFLAGS =
-RLM_LIBS =
include ../rules.mak
-
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
RLM_CFLAGS = $(INCLTDL) -Ilibeap
CLIENTLIBS = libeap/libeap.la
RLM_LIBS = libeap/libeap.la $(LIBLTDL)
-#RLM_LIBS = $(shell for x in types/rlm_eap*/rlm_eap*.la;do echo -dlpreopen $$x;done)
-RLM_INSTALL = install-types
+RLM_INSTALL = install-subdirs
RLM_SUBDIRS = libeap @eaptypes@
RLM_UTILS = radeapclient
-.PHONY: all install-types common
-
-$(STATIC_OBJS): $(HEADERS)
-
#
-# Statically link a few modules.
+# Not using shared libraries, add in ALL known static modules
+# at build time.
#
-STATIC_OBJS += $(shell ls -1 types/rlm_eap_gtc/rlm_eap_gtc.a types/rlm_eap_leap/rlm_eap_leap.a types/rlm_eap_md5/rlm_eap_md5.a types/rlm_eap_mschapv2/rlm_eap_mschapv2.a types/rlm_eap_peap/rlm_eap_peap.a types/rlm_eap_sim/rlm_eap_sim.a types/rlm_eap_tls/rlm_eap_tls.a types/rlm_eap_ttls/rlm_eap_ttls.a 2>/dev/null)
+#ifneq ($(USE_SHARED_LIBS),yes)
+#RLM_LIBS += $(shell for x in types/rlm_eap*/rlm_eap*.la;do echo -dlpreopen $$x;done)
+#endif
-$(DYNAMIC_OBJS): $(HEADERS)
+.PHONY: all install-subdirs common
+#
+# We need libeap.la before we can build anything else
+#
all: common
+$(LT_OBJS): $(HEADERS)
+
radeapclient: radeapclient.lo $(CLIENTLIBS)
- (cd libeap && $(MAKE) $(MFLAGS) $(WHAT_TO_MAKE)) || exit $?
$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(RLM_LDFLAGS) -static -o radeapclient radeapclient.lo $(CLIENTLIBS) $(LIBS)
-radeapclient.o: radeapclient.c $(HEADERS)
- $(CC) $(CFLAGS) $(RLM_CFLAGS) -c radeapclient.c
+radeapclient.lo: radeapclient.c $(HEADERS)
+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(RLM_CFLAGS) -c radeapclient.c
-install-types:
+install-subdirs:
@$(MAKE) $(MFLAGS) WHAT_TO_MAKE=install common
$(LIBTOOL) --mode=install $(INSTALL) -m 755 $(INSTALLSTRIP) radeapclient$(EXEEXT) $(R)$(bindir)
#
-# $Id$
+# Makefile
+#
+# Version: $Id$
#
-
-TARGET_LIBS = static dynamic
all:
$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
-static:
- $(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
-
-dynamic:
- $(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
-
clean:
$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
common:
@for mod in rlm_eap*; do \
- what=$(WHAT_TO_MAKE); \
- [ "$$what" = "all" ] && what="$(TARGET_LIBS)"; \
if [ -d $$mod ] && [ -f $$mod/Makefile ]; then \
- echo "Making $$what in $$mod..."; \
- (cd $$mod && $(MAKE) $(MFLAGS) $$what) || exit $?; \
+ echo "Making $(WHAT_TO_MAKE) in $$mod..."; \
+ $(MAKE) $(MFLAGS) -C $$mod $(WHAT_TO_MAKE) || exit $?; \
fi; \
done
-# Generated automatically from Makefile.in by configure.
+#
+# Makefile
+#
+# Version: $Id$
+#
+
TARGET = rlm_eap_gtc
SRCS = rlm_eap_gtc.c
RLM_CFLAGS = $(INCLTDL) -I../.. -I../../libeap
HEADERS = ../../rlm_eap.h ../../eap.h
-RLM_INSTALL =
-
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+RLM_INSTALL =
RLM_DIR=../../
include ${RLM_DIR}../rules.mak
+
+$(LT_OBJS): $(HEADERS)
-# Generated automatically from Makefile.in by configure.
+#
+# Makefile
+#
+# Version: $Id$
+#
+
TARGET = rlm_eap_leap
SRCS = rlm_eap_leap.c eap_leap.c smbdes.c
RLM_CFLAGS = $(INCLTDL) -I../.. -I../../libeap
HEADERS = eap_leap.h ../../eap.h ../../rlm_eap.h
-RLM_INSTALL =
-
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+RLM_INSTALL =
RLM_DIR=../../
include ${RLM_DIR}../rules.mak
+
+$(LT_OBJS): $(HEADERS)
RLM_LDFLAGS = @eap_md5_ldflags@
RLM_INSTALL =
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
-
RLM_DIR=../../
include ${RLM_DIR}../rules.mak
+
+$(LT_OBJS): $(HEADERS)
RLM_LDFLAGS = @eap_mschapv2_ldflags@
RLM_INSTALL =
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
-
RLM_DIR=../../
include ${RLM_DIR}../rules.mak
+
+$(LT_OBJS): $(HEADERS)
RLM_LIBS = @eap_peap_ldflags@ ../../libeap/libeap.la $(OPENSSL_LIBS)
RLM_INSTALL =
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
-
RLM_DIR=../../
include ${RLM_DIR}../rules.mak
+
+$(LT_OBJS): $(HEADERS)
RLM_LIBS = -lstdc++
RLM_INSTALL =
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
-
RLM_DIR=../../
include ${RLM_DIR}../rules.mak
+
+$(LT_OBJS): $(HEADERS)
TARGET = @targetname@
SRCS = rlm_eap_sim.c
-HEADERS = eap_sim.h
+HEADERS =
RLM_CFLAGS = $(INCLTDL) -I../.. -I../../libeap @eap_sim_cflags@
RLM_LIBS = @eap_sim_ldflags@ ../../libeap/libeap.la
RLM_INSTALL =
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
-
RLM_DIR=../../
include ${RLM_DIR}../rules.mak
+
+$(LT_OBJS): $(HEADERS)
TARGET = @targetname@
SRCS = rlm_eap_tls.c
-HEADERS = rlm_eap_tls.h eap_tls.h ../../eap.h ../../rlm_eap.h
+HEADERS = rlm_eap_tls.h ../../eap.h ../../rlm_eap.h
RLM_CFLAGS = $(INCLTDL) -I../.. $(OPENSSL_INCLUDE) -I../../libeap -DOPENSSL_NO_KRB5 @eap_tls_cflags@
RLM_LIBS = @eap_tls_ldflags@ ../../libeap/libeap.la $(OPENSSL_LIBS)
RLM_INSTALL =
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
-
RLM_DIR=../../
include ${RLM_DIR}../rules.mak
+
+$(LT_OBJS): $(HEADERS)
RLM_LIBS = @eap_ttls_ldflags@ ../../libeap/libeap.la $(OPENSSL_LIBS)
RLM_INSTALL =
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
-
RLM_DIR=../../
include ${RLM_DIR}../rules.mak
+
+$(LT_OBJS): $(HEADERS)
# ../main/Makefile for building the version of the server with
# statically linked modules. Get it from autoconf.
#
-# RLM_INSTALL is the names of additional rules you need to install
+# RLM_INSTALL is the names of additional rules you need to install
# some particular portion of the module. Usually, leave it blank.
#
#######################################################################
## this uses the RLM_CFLAGS and RLM_LIBS and SRCS defs to make TARGET.
include ../rules.mak
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
## the rule that RLM_INSTALL tells the parent rules.mak to use.
install-example:
#
-# $Id$
+# Makefile
+#
+# Version: $Id$
#
TARGET = rlm_exec
SRCS = rlm_exec.c
-HEADERS =
-RLM_CFLAGS =
-RLM_LDFLAGS =
include ../rules.mak
-
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+#
+# Makefile
+#
+# Version: $Id$
+#
+
TARGET = rlm_expr
SRCS = rlm_expr.c paircmp.c
-HEADERS =
-RLM_CFLAGS =
-RLM_LIBS =
include ../rules.mak
-
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+#
+# $Id$
+#
+
TARGET = @targetname@
SRCS = rlm_krb5.c
HEADERS =
include ../rules.mak
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
+#
+# $Id$
+#
+
TARGET = @targetname@
SRCS = rlm_ldap.c @edir@
HEADERS =
include ../rules.mak
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
-
+$(LT_OBJS): $(HEADERS)
+#
+# Makefile
+#
+# Version: $Id$
+#
+
TARGET = rlm_linelog
SRCS = rlm_linelog.c
-HEADERS =
-RLM_CFLAGS =
-RLM_LIBS =
include ../rules.mak
-
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+#
+# Makefile
+#
+# Version: $Id$
+#
+
TARGET = rlm_mschap
SRCS = rlm_mschap.c smbdes.c
-HEADERS =
+HEADERS =
RLM_CFLAGS =
-RLM_LDFLAGS =
+RLM_LDFLAGS =
RLM_UTILS = smbencrypt
RLM_INSTALL = smbencrypt-install
# over-ride the previous assignment if we're not building anything
include ../rules.mak
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
-smbencrypt: smbencrypt.o smbdes.o $(HEADERS)
- $(LIBTOOL) --mode=link $(CC) -I../../include $(LDFLAGS) $(LIBS) -o smbencrypt smbencrypt.o smbdes.o ../../lib/libradius.la
+smbencrypt: smbencrypt.lo smbdes.lo $(HEADERS)
+ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o smbencrypt smbencrypt.lo smbdes.lo ../../lib/libradius.la $(LIBS)
smbencrypt-install:
$(INSTALL) -d -m 755 $(R)$(bindir)
# ../main/Makefile for building the version of the server with
# statically linked modules. Get it from autoconf.
#
-# RLM_INSTALL is the names of additional rules you need to install
+# RLM_INSTALL is the names of additional rules you need to install
# some particular portion of the module. Usually, leave it blank.
#
#######################################################################
RLM_SUBDIRS = cardops
-## this uses the RLM_CFLAGS and RLM_LIBS and SRCS defs to make TARGET.
-include ../rules.mak
-
# Not part of RLM_CFLAGS to avoid propagation to subdirs
CFLAGS += -Wno-unused-label -Wno-cast-qual
-$(STATIC_OBJS): $(HEADERS) $(CARDOPS_LTLIBS)
+# We need to compile cardops before anything else.
+all: common
-$(DYNAMIC_OBJS): $(HEADERS) $(CARDOPS_LTLIBS)
+$(LT_OBJS): $(HEADERS) $(CARDOPS_LTLIBS)
# Note: dynamic libs only
$(CARDOPS_LTLIBS) common:
- @what=$(WHAT_TO_MAKE); \
- [ -z "$$what" ] && what=dynamic; \
for dir in $(RLM_SUBDIRS); do \
- echo "Making $$what in $$dir ..."; \
- $(MAKE) $(MFLAGS) -C $$dir RLM_CFLAGS="$(RLM_CFLAGS)" $$what || exit $?; \
+ echo "Making $(WHAT_TO_MAKE) in $$dir ..."; \
+ $(MAKE) $(MFLAGS) -C $$dir RLM_CFLAGS="$(RLM_CFLAGS)" $(WHAT_TO_MAKE) || exit $?; \
done
+
+## this uses the RLM_CFLAGS and RLM_LIBS and SRCS defs to make TARGET.
+include ../rules.mak
RLM_DIR=../
include $(RLM_DIR)../rules.mak
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
+#
+# $Id$
+#
+
TARGET = @targetname@
SRCS = rlm_pam.c
HEADERS =
include ../rules.mak
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
-# Generated automatically from Makefile.in by configure.
+#
+# Makefile
+#
+# Version: $Id$
+#
+
TARGET = rlm_pap
SRCS = rlm_pap.c
-HEADERS =
-RLM_CFLAGS =
-RLM_LIBS =
-RLM_INSTALL =
include ../rules.mak
-
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+#
+# Makefile
+#
+# Version: $Id$
+#
+
TARGET = rlm_passwd
SRCS = rlm_passwd.c
-HEADERS =
-RLM_CFLAGS =
include ../rules.mak
-
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+#
+# $Id$
+#
+
TARGET = @targetname@
SRCS = rlm_perl.c
-HEADERS =
+HEADERS =
RLM_CFLAGS = @perl_cflags@
RLM_LIBS = @perl_ldflags@
RLM_INSTALL = install-scripts
## this uses the RLM_CFLAGS and RLM_LIBS and SRCS defs to make TARGET.
include ../rules.mak
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
install-scripts:
$(INSTALL) -m 755 example.pl $(R)$(raddbdir)
+#
+# Makefile
+#
+# Version: $Id$
+#
+
TARGET = rlm_policy
SRCS = rlm_policy.c parse.c evaluate.c
HEADERS = rlm_policy.h
RLM_CFLAGS =
-RLM_LIBS =
+RLM_LIBS =
include ../rules.mak
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
+#
+# Makefile
+#
+# Version: $Id$
+#
+
TARGET = rlm_protocol_filter
SRCS = rlm_protocol_filter.c
-HEADERS =
-RLM_CFLAGS =
-RLM_LIBS =
include ../rules.mak
-
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+#
+# $Id$
+#
+
TARGET = @targetname@
SRCS = rlm_python.c
HEADERS =
include ../rules.mak
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
+#
+# $Id$
+#
+
TARGET = @targetname@
SRCS = rlm_radutmp.c
HEADERS =
include ../rules.mak
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
#
-# $Id$
+# Makefile
+#
+# Version: $Id$
#
TARGET = rlm_realm
SRCS = rlm_realm.c
-HEADERS =
-RLM_CFLAGS =
-RLM_LIBS =
-# over-ride the previous assignment if we're not building anything
include ../rules.mak
-
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
-
+#
+# $Id$
+#
+
TARGET = @targetname@
SRCS = rlm_smb.c rfcnb-io.c rfcnb-util.c rlm_smb.c session.c \
smbdes.c smbencrypt.c smblib.c smblib-util.c valid.c
include ../rules.mak
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
+#
+# $Id$
+#
+
TARGET = @targetname@
SRCS = rlm_sql.c sql.c
-HEADERS = rlm_sql.h rlm_sql_conf.h
+HEADERS = rlm_sql.h conf.h
RLM_INSTALL = install-drivers
RLM_CFLAGS = $(INCLTDL) -I$(top_builddir)/src/modules/rlm_sql
RLM_LIBS = $(LIBLTDL)
#RLM_LIBS += $(shell for x in drivers/rlm_*/rlm_*.la;do echo -dlpreopen $$x;done)
#endif
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
-
-
-all:
- @$(MAKE) $(MFLAGS) static dynamic
- @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
+# this uses the RLM_CFLAGS and RLM_LIBS and SRCS defs to make TARGET.
+include ../rules.mak
-allclean:
- @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=clean common
+$(LT_OBJS): $(HEADERS)
install-drivers:
@$(MAKE) $(MFLAGS) WHAT_TO_MAKE=install common
-common:
+common:
@for dir in $(RLM_SUBDIRS); do \
echo "Making $(WHAT_TO_MAKE) in $$dir..."; \
(cd $$dir && $(MAKE) $(MFLAGS) $(WHAT_TO_MAKE)) || exit $?;\
done
-
-include ../rules.mak
-
all:
$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
-static:
- $(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
-
-dynamic:
- $(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
-
clean:
$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
@rm -f lib/rlm_*
install:
$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
-common:
+common:
@[ -d lib/ ] || mkdir lib
@for mod in $(SQL_MODULES); do \
what=$(WHAT_TO_MAKE); \
- [ "$$what" = "all" ] && what="$(TARGET_LIBS)"; \
echo "Making $$what in $$mod..."; \
(cd $$mod && $(MAKE) $(MFLAGS) $$what) || exit $?;\
done
-
#
#######################################################################
-all: dynamic
+.PHONY: all build-module clean distclean install reconfig
+
+all: build-module
#######################################################################
#
#######################################################################
#
-# define static and dynamic objects for the libraries,
+# define libtool objects for the libraries,
# along with a number of other useful definitions.
#
#######################################################################
-STATIC_OBJS = $(SRCS:.c=.o)
-DYNAMIC_OBJS = $(SRCS:.c=.lo)
+LT_OBJS = $(SRCS:.c=.lo)
CFLAGS += -I../.. -I$(top_builddir)/src/
#######################################################################
#
#######################################################################
SERVER_HEADERS = ../../rlm_sql.h
-$(STATIC_OBJS): $(SERVER_HEADERS)
-$(DYNAMIC_OBJS): $(SERVER_HEADERS)
+$(LT_OBJS): $(SERVER_HEADERS)
#######################################################################
#
# define new rules
#
#######################################################################
-%.o : %.c
- $(CC) $(CFLAGS) $(RLM_SQL_CFLAGS) -c $< -o $@
-
-%.lo : %.c
+%.lo: %.c
$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(RLM_SQL_CFLAGS) -c $<
ifneq ($(TARGET),)
# Define a number of new targets
#
#######################################################################
-$(TARGET).a: $(STATIC_OBJS)
- $(LIBTOOL) --mode=link $(CC) -module -static $(CFLAGS) $(RLM_SQL_CFLAGS) $^ -o $@
#
# If the module is in the list of static modules, then the "dynamic"
LINK_MODE=-static
endif
-$(TARGET).la: $(DYNAMIC_OBJS)
- $(LIBTOOL) --mode=link $(CC) -release $(RADIUSD_VERSION) \
- -module $(LINK_MODE) $(CFLAGS) \
- $(RLM_SQL_CFLAGS) -o $@ -rpath $(libdir) $^ $(RLM_SQL_LIBS)
-
#######################################################################
#
# Generic targets so we can sweep through all modules
# a level, to the 'src/modules' directory, for general consumption.
#
#######################################################################
-static: $(TARGET).a
+build-module: $(TARGET).la
+ @[ -d .libs ] && cp .libs/* ../lib
@cp $< ../lib
-dynamic: $(TARGET).la
- @cp $< ../lib
+$(TARGET).la: $(LT_OBJS)
+ $(LIBTOOL) --mode=link $(CC) -release $(RADIUSD_VERSION) \
+ -module $(LINK_MODE) $(LDFLAGS) $(RLM_SQL_LDFLAGS) -o $@ \
+ -rpath $(libdir) $^ $(RLM_SQL_LIBS)
#######################################################################
#
#
#######################################################################
else
-static:
-
-dynamic:
+build-module:
# if $(TARGET) == ""
endif
# ../main/Makefile for building the version of the server with
# statically linked modules. Get it from autoconf.
#
-# RLM_INSTALL is the names of additional rules you need to install
+# RLM_INSTALL is the names of additional rules you need to install
# some particular portion of the module. Usually, leave it blank.
#
#######################################################################
HEADERS =
RLM_CFLAGS = @sql_log_cflags@
RLM_LIBS = @sql_log_ldflags@
-RLM_INSTALL = install-sql_log
+RLM_INSTALL =
## this uses the RLM_CFLAGS and RLM_LIBS and SRCS defs to make TARGET.
include ../rules.mak
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
-
-## the rule that RLM_INSTALL tells the parent rules.mak to use.
-install-sql_log:
- touch .
+$(LT_OBJS): $(HEADERS)
+#
+# $Id$
+#
+
TARGET = @targetname@
SRCS = rlm_sqlcounter.c
HEADERS =
include ../rules.mak
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
+#
+# $Id$
+#
INCLUDE += -I/usr/local/include/
-
TARGET = @targetname@
SRCS = rlm_sqlippool.c ip_set.c
HEADERS = ip_set.h
include ../rules.mak
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
+#
+# $Id$
+#
+
TARGET = @targetname@
SRCS = rlm_unix.c
HEADERS =
include ../rules.mak
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
include $(RLM_DIR)../../../Make.inc
-all: static dynamic
+.PHONY: all build-module clean distclean install reconfig
+
+all: build-module
#######################################################################
#
#######################################################################
#
-# define static and dynamic objects for the libraries,
+# define libtool objects for the libraries,
# along with a number of other useful definitions.
#
#######################################################################
-STATIC_OBJS += $(SRCS:.c=.o)
-STATIC_OBJS += $(SRCS:.cpp=.o)
-DYNAMIC_OBJS += $(SRCS:.c=.lo)
-DYNAMIC_OBJS += $(SRCS:.cpp=.lo)
+LT_OBJS += $(SRCS:.c=.lo)
+LT_OBJS += $(SRCS:.cpp=.lo)
CFLAGS += -I$(top_builddir)/src
#######################################################################
$(top_builddir)/src/include/radiusd.h \
$(top_builddir)/src/include/modules.h
-$(STATIC_OBJS): $(SERVER_HEADERS)
-$(DYNAMIC_OBJS): $(SERVER_HEADERS)
+$(LT_OBJS): $(SERVER_HEADERS)
#######################################################################
#
# define new rules
#
#######################################################################
-%.o : %.c
- $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(RLM_CFLAGS) -c $< -o $@
-
-%.o : %.cpp
- $(LIBTOOL) --mode=compile $(CXX) $(CFLAGS) $(RLM_CFLAGS) -c $< -o $@
-
-%.lo : %.c
+%.lo: %.c
$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(RLM_CFLAGS) -c $<
-%.lo : %.cpp
+%.lo: %.cpp
$(LIBTOOL) --mode=compile $(CXX) $(CFLAGS) $(RLM_CFLAGS) -c $<
ifneq ($(TARGET),)
LINK_MODE = -static
endif
-$(TARGET).la: $(DYNAMIC_OBJS)
- $(LIBTOOL) --mode=link $(CC) -release $(RADIUSD_VERSION) \
- -module $(LINK_MODE) $(LDFLAGS) $(RLM_LDFLAGS) \
- -o $@ -rpath $(libdir) $^ $(top_builddir)/src/lib/libradius.la \
- $(RLM_LIBS) $(LIBS)
-
#######################################################################
#
# Generic targets so we can sweep through all modules
# a level, to the 'src/modules' directory, for general consumption.
#
#######################################################################
-#static: $(TARGET).a $(RLM_UTILS)
-# @[ "x$(RLM_SUBDIRS)" = "x" ] || $(MAKE) $(MFLAGS) WHAT_TO_MAKE=static common
-# @cp $< $(top_builddir)/src/modules/lib
-static:
-dynamic: $(TARGET).la $(RLM_UTILS)
- @[ "x$(RLM_SUBDIRS)" = "x" ] || $(MAKE) $(MFLAGS) WHAT_TO_MAKE=dynamic common
+build-module: $(TARGET).la $(RLM_UTILS)
+ @[ "x$(RLM_SUBDIRS)" = "x" ] || $(MAKE) $(MFLAGS) WHAT_TO_MAKE=all common
@[ -d .libs ] && cp .libs/* $(top_builddir)/src/modules/lib
@cp $< $(top_builddir)/src/modules/lib
+$(TARGET).la: $(LT_OBJS)
+ $(LIBTOOL) --mode=link $(CC) -release $(RADIUSD_VERSION) \
+ -module $(LINK_MODE) $(LDFLAGS) $(RLM_LDFLAGS) -o $@ \
+ -rpath $(libdir) $^ $(top_builddir)/src/lib/libradius.la \
+ $(RLM_LIBS) $(LIBS)
+
#######################################################################
#
# It's a dummy target: don't build it
#
#######################################################################
else
-static:
-
-dynamic:
+build-module:
# if $(TARGET) == ""
endif