Wipe out last vestiges of static/dynamic rules.
authornbk <nbk>
Sun, 22 Jan 2006 21:46:35 +0000 (21:46 +0000)
committernbk <nbk>
Sun, 22 Jan 2006 21:46:35 +0000 (21:46 +0000)
50 files changed:
src/lib/Makefile
src/modules/Makefile
src/modules/rlm_acct_unique/Makefile
src/modules/rlm_always/Makefile
src/modules/rlm_attr_filter/Makefile
src/modules/rlm_attr_rewrite/Makefile.in
src/modules/rlm_caching/Makefile.in
src/modules/rlm_checkval/Makefile.in
src/modules/rlm_copy_packet/Makefile
src/modules/rlm_counter/Makefile.in
src/modules/rlm_cram/Makefile
src/modules/rlm_digest/Makefile
src/modules/rlm_eap/Makefile.in
src/modules/rlm_eap/types/Makefile
src/modules/rlm_eap/types/rlm_eap_gtc/Makefile
src/modules/rlm_eap/types/rlm_eap_leap/Makefile
src/modules/rlm_eap/types/rlm_eap_md5/Makefile.in
src/modules/rlm_eap/types/rlm_eap_mschapv2/Makefile.in
src/modules/rlm_eap/types/rlm_eap_peap/Makefile.in
src/modules/rlm_eap/types/rlm_eap_psk/Makefile.in
src/modules/rlm_eap/types/rlm_eap_sim/Makefile.in
src/modules/rlm_eap/types/rlm_eap_tls/Makefile.in
src/modules/rlm_eap/types/rlm_eap_ttls/Makefile.in
src/modules/rlm_example/Makefile.in
src/modules/rlm_exec/Makefile
src/modules/rlm_expr/Makefile
src/modules/rlm_krb5/Makefile.in
src/modules/rlm_ldap/Makefile.in
src/modules/rlm_linelog/Makefile
src/modules/rlm_mschap/Makefile
src/modules/rlm_otp/Makefile.in
src/modules/rlm_otp/cardops/Makefile
src/modules/rlm_pam/Makefile.in
src/modules/rlm_pap/Makefile
src/modules/rlm_passwd/Makefile
src/modules/rlm_perl/Makefile.in
src/modules/rlm_policy/Makefile
src/modules/rlm_protocol_filter/Makefile
src/modules/rlm_python/Makefile.in
src/modules/rlm_radutmp/Makefile.in
src/modules/rlm_realm/Makefile
src/modules/rlm_smb/Makefile.in
src/modules/rlm_sql/Makefile.in
src/modules/rlm_sql/drivers/Makefile.in
src/modules/rlm_sql/drivers/rules.mak
src/modules/rlm_sql_log/Makefile.in
src/modules/rlm_sqlcounter/Makefile.in
src/modules/rlm_sqlippool/Makefile.in
src/modules/rlm_unix/Makefile.in
src/modules/rules.mak

index 7835c10..f56f352 100644 (file)
@@ -11,6 +11,8 @@ SRCS          = dict.c filters.c hash.c hmac.c hmacsha1.c isaac.c log.c \
                  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
 
@@ -21,46 +23,31 @@ CFLAGS              += -D_LIBRADIUS -I$(top_builddir)/src
 # 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
index 571bb2c..945fe06 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Makefile     
+# Makefile
 #
 # Version:     $Id$
 #
@@ -8,21 +8,9 @@ include ../../Make.inc
 
 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
index 1a403b8..0d0ec1f 100644 (file)
@@ -1,15 +1,9 @@
 #
 #  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)
index dc5bc27..09c5d4f 100644 (file)
@@ -1,11 +1,10 @@
+#
+# Makefile
+#
+# Version:     $Id$
+#
+
 TARGET         = rlm_always
 SRCS           = rlm_always.c
-HEADERS                =
-RLM_CFLAGS     =
-RLM_LIBS       =
 
 include ../rules.mak
-
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
index 58a4f7a..d0b3f1a 100644 (file)
@@ -1,17 +1,10 @@
 #
-#      $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)
-
index 8f4f4f1..6c6222b 100644 (file)
@@ -1,12 +1,14 @@
+#
+# $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)
index 0634ab1..ff82a91 100644 (file)
@@ -1,3 +1,7 @@
+#
+# $Id$
+#
+
 TARGET      = @targetname@
 SRCS        = rlm_caching.c
 HEADERS     =
@@ -7,6 +11,4 @@ RLM_INSTALL =
 
 include ../rules.mak
 
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
index 6467f05..c022199 100644 (file)
@@ -1,12 +1,14 @@
+#
+# $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)
index 82283c5..2b182ac 100644 (file)
@@ -1,11 +1,10 @@
+#
+# 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)
index 178c629..465c019 100644 (file)
@@ -1,3 +1,7 @@
+#
+# $Id$
+#
+
 TARGET      = @targetname@
 SRCS        = rlm_counter.c
 HEADERS     =
@@ -7,6 +11,4 @@ RLM_INSTALL =
 
 include ../rules.mak
 
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
index e5bc6ff..1748acc 100644 (file)
@@ -1,9 +1,10 @@
+#
+# 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)
index 5db54e7..07c9f2b 100644 (file)
@@ -1,11 +1,10 @@
+#
+# Makefile
+#
+# Version:     $Id$
+#
+
 TARGET         = rlm_digest
 SRCS           = rlm_digest.c
-HEADERS                = 
-RLM_CFLAGS     =
-RLM_LIBS       = 
 
 include ../rules.mak
-
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
index 7ac59ab..c0654c5 100644 (file)
@@ -8,32 +8,34 @@ HEADERS     = eap.h rlm_eap.h
 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)
 
index 2d54a28..289c5d6 100644 (file)
@@ -1,18 +1,12 @@
 #
-# $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
 
@@ -21,10 +15,8 @@ install:
 
 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
index 6ac3076..f766537 100644 (file)
@@ -1,13 +1,16 @@
-# 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)
index 5a741ee..3dbf25e 100644 (file)
@@ -1,13 +1,16 @@
-# 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)
index 79f488c..1f0f528 100644 (file)
@@ -9,9 +9,7 @@ RLM_CFLAGS  = $(INCLTDL) -I../.. -I../../libeap @eap_md5_cflags@
 RLM_LDFLAGS = @eap_md5_ldflags@
 RLM_INSTALL =
 
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
-
 RLM_DIR=../../
 include ${RLM_DIR}../rules.mak
+
+$(LT_OBJS): $(HEADERS)
index 3e96c07..b95daa6 100644 (file)
@@ -9,9 +9,7 @@ RLM_CFLAGS  = $(INCLTDL) -I../.. -I../../libeap @eap_mschapv2_cflags@
 RLM_LDFLAGS = @eap_mschapv2_ldflags@
 RLM_INSTALL =
 
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
-
 RLM_DIR=../../
 include ${RLM_DIR}../rules.mak
+
+$(LT_OBJS): $(HEADERS)
index e1f7532..368a11f 100644 (file)
@@ -9,9 +9,7 @@ RLM_CFLAGS  = $(INCLTDL) -I../.. $(OPENSSL_INCLUDE) -I../../libeap -DOPENSSL_NO_
 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)
index 2271126..7d4aac9 100644 (file)
@@ -9,9 +9,7 @@ RLM_CFLAGS  = $(INCLTDL) -I../.. -I../../libeap
 RLM_LIBS    = -lstdc++
 RLM_INSTALL =
 
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
-
 RLM_DIR=../../
 include ${RLM_DIR}../rules.mak
+
+$(LT_OBJS): $(HEADERS)
index dd30afb..dcce43a 100644 (file)
@@ -4,14 +4,12 @@
 
 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)
index c1c1113..c0184f3 100644 (file)
@@ -4,14 +4,12 @@
 
 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)
index 6baaa2a..5ecea82 100644 (file)
@@ -9,9 +9,7 @@ RLM_CFLAGS  = $(INCLTDL) -I../.. $(OPENSSL_INCLUDE) -I../../libeap -DOPENSSL_NO_
 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)
index f8bd672..545eaf9 100644 (file)
@@ -16,7 +16,7 @@
 # ../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.
 #
 #######################################################################
@@ -30,9 +30,7 @@ RLM_INSTALL = install-example
 ## 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:
index f9930b6..b34f57e 100644 (file)
@@ -1,15 +1,10 @@
 #
-# $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)
index caed0a4..fc22730 100644 (file)
@@ -1,11 +1,10 @@
+#
+# 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)
index d459469..ef6142b 100644 (file)
@@ -1,3 +1,7 @@
+#
+# $Id$
+#
+
 TARGET     = @targetname@
 SRCS       = rlm_krb5.c
 HEADERS    =
@@ -6,6 +10,4 @@ RLM_CFLAGS = @krb5_cflags@ -I/usr/include/et
 
 include ../rules.mak
 
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
index 5a0b98c..1f2824f 100644 (file)
@@ -1,3 +1,7 @@
+#
+# $Id$
+#
+
 TARGET     = @targetname@
 SRCS       = rlm_ldap.c @edir@
 HEADERS    =
@@ -6,7 +10,4 @@ RLM_LIBS   = @ldap_ldflags@
 
 include ../rules.mak
 
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
-
+$(LT_OBJS): $(HEADERS)
index e8c13eb..a863f82 100755 (executable)
@@ -1,11 +1,10 @@
+#
+# Makefile
+#
+# Version:     $Id$
+#
+
 TARGET         = rlm_linelog
 SRCS           = rlm_linelog.c
-HEADERS                = 
-RLM_CFLAGS     =
-RLM_LIBS       = 
 
 include ../rules.mak
-
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
index 36ef7ad..026aa06 100644 (file)
@@ -1,20 +1,24 @@
+#
+# 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)
index 99608c1..683940e 100644 (file)
@@ -16,7 +16,7 @@
 # ../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.
 #
 #######################################################################
@@ -30,21 +30,20 @@ RLM_LIBS       = @otp_ldflags@ $(OPENSSL_LIBS) $(CARDOPS_LTLIBS)
 
 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
index b693f73..687d69b 100644 (file)
@@ -6,6 +6,4 @@ HEADERS     = $(wildcard *.h)
 RLM_DIR=../
 include $(RLM_DIR)../rules.mak
 
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
index 35d4772..b7dbaf2 100644 (file)
@@ -1,3 +1,7 @@
+#
+# $Id$
+#
+
 TARGET     = @targetname@
 SRCS       = rlm_pam.c
 HEADERS    =
@@ -6,6 +10,4 @@ RLM_CFLAGS = @pam_cflags@
 
 include ../rules.mak
 
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
index e72b50d..8873d59 100644 (file)
@@ -1,13 +1,10 @@
-# 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)
index 87efa6b..dfc1ac4 100644 (file)
@@ -1,10 +1,10 @@
+#
+# Makefile
+#
+# Version:     $Id$
+#
+
 TARGET     = rlm_passwd
 SRCS       = rlm_passwd.c
-HEADERS    =
-RLM_CFLAGS = 
 
 include ../rules.mak
-
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS) 
index 62a61f0..5e5fed1 100644 (file)
@@ -1,6 +1,10 @@
+#
+# $Id$
+#
+
 TARGET      = @targetname@
 SRCS        = rlm_perl.c
-HEADERS     = 
+HEADERS     =
 RLM_CFLAGS  = @perl_cflags@
 RLM_LIBS    = @perl_ldflags@
 RLM_INSTALL = install-scripts
@@ -8,9 +12,7 @@ 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)
index 163da0f..808d84a 100644 (file)
@@ -1,11 +1,15 @@
+#
+# 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)
index 54360cd..9d08409 100755 (executable)
@@ -1,11 +1,10 @@
+#
+# 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)
index 5f21111..e116dbc 100644 (file)
@@ -1,3 +1,7 @@
+#
+# $Id$
+#
+
 TARGET     = @targetname@
 SRCS       = rlm_python.c
 HEADERS    =
@@ -6,6 +10,4 @@ RLM_CFLAGS = @python_cflags@
 
 include ../rules.mak
 
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
index 48c643c..d89067c 100644 (file)
@@ -1,3 +1,7 @@
+#
+# $Id$
+#
+
 TARGET     = @targetname@
 SRCS       = rlm_radutmp.c
 HEADERS    =
@@ -6,6 +10,4 @@ RLM_LIBS   = @radutmp_ldflags@
 
 include ../rules.mak
 
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
index d5c1a2a..0cc1736 100644 (file)
@@ -1,17 +1,10 @@
 #
-#      $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)
-
index 1ec97e1..9bfe070 100644 (file)
@@ -1,3 +1,7 @@
+#
+# $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
@@ -10,6 +14,4 @@ RLM_CFLAGS = @smb_cflags@
 
 include ../rules.mak
 
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
index d16566f..c4b6761 100644 (file)
@@ -1,6 +1,10 @@
+#
+# $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)
@@ -14,26 +18,16 @@ RLM_SUBDIRS = drivers
 #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
-
index 376ae96..0617f0f 100644 (file)
@@ -3,12 +3,6 @@ SQL_MODULES            = @SQL_MODULES@
 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_*
@@ -17,12 +11,10 @@ clean:
 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
-
index 4b195c8..7d7fdc4 100644 (file)
@@ -20,7 +20,9 @@
 #
 #######################################################################
 
-all: dynamic
+.PHONY: all build-module clean distclean install reconfig
+
+all: build-module
 
 #######################################################################
 #
@@ -31,12 +33,11 @@ all: dynamic
 
 #######################################################################
 #
-# 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/
 
 #######################################################################
@@ -46,18 +47,14 @@ 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),)
@@ -66,8 +63,6 @@ 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"
@@ -90,11 +85,6 @@ ifneq ($(USE_SHARED_LIBS),yes)
 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
@@ -104,11 +94,14 @@ $(TARGET).la: $(DYNAMIC_OBJS)
 # 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)
 
 #######################################################################
 #
@@ -116,9 +109,7 @@ dynamic: $(TARGET).la
 #
 #######################################################################
 else
-static:
-
-dynamic:
+build-module:
 
 # if $(TARGET) == ""
 endif
index c47df3c..8d59df2 100644 (file)
@@ -16,7 +16,7 @@
 # ../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.
 #
 #######################################################################
@@ -25,15 +25,9 @@ SRCS        = rlm_sql_log.c
 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)
index 31df503..bd853f0 100644 (file)
@@ -1,3 +1,7 @@
+#
+# $Id$
+#
+
 TARGET      = @targetname@
 SRCS        = rlm_sqlcounter.c
 HEADERS     =
@@ -7,6 +11,4 @@ RLM_INSTALL =
 
 include ../rules.mak
 
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
index 4394b6a..d255fc6 100644 (file)
@@ -1,7 +1,9 @@
+#
+# $Id$
+#
 
 INCLUDE += -I/usr/local/include/
 
-
 TARGET      = @targetname@
 SRCS        = rlm_sqlippool.c ip_set.c
 HEADERS     = ip_set.h
@@ -11,6 +13,4 @@ RLM_INSTALL =
 
 include ../rules.mak
 
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
index e0be93d..4b891ec 100644 (file)
@@ -1,3 +1,7 @@
+#
+# $Id$
+#
+
 TARGET     = @targetname@
 SRCS       = rlm_unix.c
 HEADERS    =
@@ -6,6 +10,4 @@ RLM_CFLAGS = @unix_cflags@
 
 include ../rules.mak
 
-$(STATIC_OBJS): $(HEADERS)
-
-$(DYNAMIC_OBJS): $(HEADERS) 
+$(LT_OBJS): $(HEADERS)
index edfacff..1b1321b 100644 (file)
@@ -23,7 +23,9 @@
 
 include $(RLM_DIR)../../../Make.inc
 
-all: static dynamic
+.PHONY: all build-module clean distclean install reconfig
+
+all: build-module
 
 #######################################################################
 #
@@ -34,14 +36,12 @@ all: static dynamic
 
 #######################################################################
 #
-# 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
 
 #######################################################################
@@ -54,24 +54,17 @@ SERVER_HEADERS      = $(top_builddir)/src/include/radius.h  \
                  $(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),)
@@ -102,12 +95,6 @@ ifneq ($(USE_SHARED_LIBS),yes)
 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
@@ -117,25 +104,25 @@ $(TARGET).la: $(DYNAMIC_OBJS)
 # 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