7 SERVER_SRCS = acct.c auth.c client.c conffile.c crypt.c exec.c files.c \
8 listen.c log.c mainconfig.c modules.c modcall.c proxy.c \
9 radiusd.c radius_snmp.c request_list.c request_process.c \
10 session.c smux.c threads.c util.c valuepair.c version.c \
13 SERVER_OBJS += $(SERVER_SRCS:.c=.lo)
15 INCLUDES = ../include/autoconf.h ../include/conf.h \
16 ../include/libradius.h ../include/radius.h \
19 CFLAGS += -I$(top_builddir)/src
20 CFLAGS += -DHOSTINFO=\"${HOSTINFO}\"
21 CFLAGS += -DRADIUSD_VERSION=\"${RADIUSD_VERSION}\"
22 CFLAGS += $(SNMP_INCLUDE)
23 VFLAGS = -DRADIUSD_MAJOR_VERSION=$(RADIUSD_MAJOR_VERSION)
24 VFLAGS += -DRADIUSD_MINOR_VERSION=$(RADIUSD_MINOR_VERSION)
25 MODULE_LIBS = $(STATIC_MODULES)
26 BINARIES = radiusd radwho radclient
31 PCAP_LIBS = @PCAP_LIBS@
37 # Not using shared libraries, add in ALL known static modules
40 ifneq ($(USE_SHARED_LIBS),yes)
42 # For static linking...
44 LINK_MODE = -static -all-static
46 SUB_MODULES += rlm_eap_md5 rlm_eap_leap rlm_eap_tls rlm_eap_ttls rlm_eap_sim
47 SUB_MODULES += rlm_eap_peap rlm_eap_mschapv2 rlm_eap_gtc
48 SUB_MODULES += rlm_sql_db2 rlm_sql_freetds rlm_sql_iodbc rlm_sql_mysql
49 SUB_MODULES += rlm_sql_oracle rlm_sql_postgresql rlm_sql_sybase rlm_sql_unixodbc
50 LIBS += $(shell test -f ../modules/rlm_eap/libeap/libeap.la && echo ../modules/rlm_eap/libeap/libeap.la)
52 MODULE_LIBS += $(shell for x in $(MODULES);do test -f ../modules/$$x/$$x.la && echo -dlpreopen ../modules/$$x/$$x.la;done)
53 MODULE_LIBS += $(shell for x in $(SUB_MODULES);do test -f ../modules/*/types/$$x/$$x.la && echo -dlpreopen ../modules/*/types/$$x/$$x.la;done)
54 MODULE_LIBS += $(shell for x in $(SUB_MODULES);do test -f ../modules/*/drivers/$$x/$$x.la && echo -dlpreopen ../modules/*/drivers/$$x/$$x.la;done)
57 LIBS += ../lib/libradius.la
62 $(SERVER_OBJS): $(INCLUDES)
64 radiusd: $(SERVER_OBJS) ../lib/libradius.la
65 $(LIBTOOL) --mode=link $(CC) -export-dynamic -dlopen self \
66 $(LDFLAGS) $(LINK_MODE) -o $@ $(SERVER_OBJS) \
67 $(MODULE_LIBS) $(LIBS) $(SNMP_LIBS) $(LCRYPT) \
68 $(PTHREADLIB) $(LIBLTDL) $(OPENSSL_LIBS)
70 radiusd.lo: radiusd.c ../include/request_list.h ../include/modules.h ../include/modcall.h ../include/modpriv.h
71 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c radiusd.c
73 acct.lo: acct.c ../include/modules.h
74 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c acct.c
76 auth.lo: auth.c ../include/modules.h
77 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c auth.c
79 client.lo: client.c ../include/conffile.h
80 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c client.c
82 conffile.lo: conffile.c ../include/conffile.h ../include/modules.h
83 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c conffile.c
86 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c crypt.c
89 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c exec.c
92 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c files.c
95 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c listen.c
98 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c log.c
100 mainconfig.lo: mainconfig.c ../include/modules.h
101 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c mainconfig.c
103 modcall.lo: modcall.c
104 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(INCLTDL) -c modcall.c
106 modules.lo: modules.c
107 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(VFLAGS) $(INCLTDL) -c modules.c
110 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c proxy.c
112 radius_snmp.lo: radius_snmp.c
113 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c radius_snmp.c
115 request_list.lo: request_list.c
116 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c request_list.c
118 request_process.lo: request_process.c
119 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c request_process.c
121 session.lo: session.c ../include/modules.h
122 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c session.c
125 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c smux.c
127 threads.lo: threads.c
128 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c threads.c
131 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c util.c
133 valuepair.lo: valuepair.c
134 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c valuepair.c
136 version.lo: version.c
137 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c version.c
140 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c xlat.c
146 radclient.lo: radclient.c $(INCLUDES)
147 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c radclient.c
149 radclient: radclient.lo ../lib/libradius.la
150 $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LINK_MODE) -o radclient radclient.lo $(LIBS)
152 radsniff.lo: radsniff.c $(INCLUDES) ../include/radsniff.h
153 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c radsniff.c
155 radsniff: radsniff.lo ../lib/libradius.la
156 $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LINK_MODE) -o radsniff radsniff.lo $(LIBS) $(PCAP_LIBS)
158 radwho.lo: radwho.c $(INCLUDES)
159 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c radwho.c
161 radwho: radwho.lo util.lo log.lo conffile.lo ../lib/libradius.la
162 $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LINK_MODE) -o radwho radwho.lo util.lo log.lo conffile.lo $(LIBS)
166 rm -rf *.o *.so *.lo *~ $(BINARIES) .libs
169 $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(INSTALLSTRIP) radiusd$(EXEEXT) $(R)$(sbindir)
170 $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(INSTALLSTRIP) radclient$(EXEEXT) $(R)$(bindir)
171 $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(INSTALLSTRIP) radsniff$(EXEEXT) $(R)$(bindir)
172 $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(INSTALLSTRIP) radwho$(EXEEXT) $(R)$(bindir)
173 $(INSTALL) -m 755 checkrad.pl $(R)$(sbindir)/checkrad
174 $(INSTALL) -m 755 radlast $(R)$(bindir)
175 $(INSTALL) -m 755 radtest $(R)$(bindir)
176 $(INSTALL) -m 755 radzap $(R)$(bindir)