Removed support for old-style "naslist" file, and updated
[freeradius.git] / src / main / Makefile.in
1 #
2 # $Id$
3 #
4
5 include ../../Make.inc
6
7 SERVER_SRCS     = radiusd.c files.c util.c acct.c log.c valuepair.c  \
8                   version.c proxy.c auth.c conffile.c modules.c modcall.c  \
9                   session.c xlat.c threads.c smux.c radius_snmp.c client.c \
10                   request_list.c mainconfig.c listen.c request_process.c
11
12 SERVER_OBJS     += $(SERVER_SRCS:.c=.o)
13
14 INCLUDES        = ../include/radiusd.h ../include/radius.h ../include/libradius.h ../include/conf.h ../include/autoconf.h
15
16 CFLAGS          += -I../include 
17 CFLAGS          += -DHOSTINFO=\"${HOSTINFO}\"
18 CFLAGS          += -DRADIUSD_VERSION=\"${RADIUSD_VERSION}\"
19 CFLAGS          += $(SNMP_INCLUDE) 
20 LDFLAGS         += -L../lib
21 MODULE_LIBS     = $(STATIC_MODULES)
22 MODULE_OBJS     =
23 VFLAGS          = -DRADIUSD_MAJOR_VERSION=$(RADIUSD_MAJOR_VERSION)
24 VFLAGS          += -DRADIUSD_MINOR_VERSION=$(RADIUSD_MINOR_VERSION)
25 BINARIES        = radiusd radwho radclient
26 LT_BIN_FLAGS    =
27
28 #
29 #  Not using shared libraries, add in ALL known static modules
30 # at build time.
31 #
32 ifneq ($(USE_SHARED_LIBS),yes)
33 #
34 #  For static linking...
35 #
36 LT_BIN_FLAGS    = -static -all-static
37
38 SUB_MODULES += rlm_eap_md5 rlm_eap_leap rlm_eap_tls rlm_eap_ttls rlm_eap_sim
39 SUB_MODULES += rlm_eap_peap rlm_eap_mschapv2 rlm_eap_gtc
40 SUB_MODULES += rlm_sql_db2 rlm_sql_freetds rlm_sql_iodbc rlm_sql_mysql
41 SUB_MODULES += rlm_sql_oracle rlm_sql_postgresql rlm_sql_sybase rlm_sql_unixodbc
42 LIBS        += $(shell test -f ../modules/rlm_eap/libeap/libeap.a && echo -L../modules/rlm_eap/libeap -leap)
43
44 #
45 MODULE_LIBS     += $(shell for x in $(MODULES);do test -f ../modules/$$x/$$x.la && echo -dlpreopen ../modules/$$x/$$x.la;done)
46 MODULE_LIBS     += $(shell for x in $(SUB_MODULES);do test -f ../modules/*/types/$$x/$$x.la && echo -dlpreopen ../modules/*/types/$$x/$$x.la;done)
47 MODULE_LIBS     += $(shell for x in $(SUB_MODULES);do test -f ../modules/*/drivers/$$x/$$x.la && echo -dlpreopen ../modules/*/drivers/$$x/$$x.la;done)
48 MODULE_OBJS     += $(shell for x in $(MODULES);do test -f ../modules/$$x/$$x.la && echo ../modules/$$x/$$x.la;done)
49 MODULE_OBJS     += $(shell for x in $(SUB_MODULES);do test -f ../modules/*/types/$$x/$$x.la && echo ../modules/*/types/$$x/$$x.la;done)
50 MODULE_OBJS     += $(shell for x in $(SUB_MODULES);do test -f ../modules/*/drivers/$$x/$$x.la && echo ../modules/*/drivers/$$x/$$x.la;done)
51 else
52
53 #
54 #  Weird EAP nonsense
55 #
56 ifeq ($(RLM_EAP_LINK_MODE),-static)
57 LIBS        += $(shell test -f ../modules/rlm_eap/libeap/libeap.a && echo -L../modules/rlm_eap/libeap -leap)
58 MODULE_LIBS     += $(shell for x in rlm_eap_tls rlm_eap_ttls rlm_eap_peap;do test -f ../modules/*/types/$$x/$$x.la && echo -dlpreopen ../modules/*/types/$$x/$$x.la;done)
59 endif
60 endif
61
62 LIBS            += -lradius $(SNMP_LIBS)
63
64
65 all:    $(BINARIES)
66
67 $(SERVER_OBJS): $(INCLUDES)
68
69 radiusd: $(SERVER_OBJS) ../lib/libradius.la $(MODULE_OBJS)
70         $(LIBTOOL) --mode=link $(CC) -export-dynamic -dlopen self \
71                 $(LT_BIN_FLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \
72                 $(SERVER_OBJS) $(LCRYPT) $(MODULE_LIBS) $(LIBS) \
73                 $(PTHREADLIB) $(LIBLTDL) $(LCRYPT) $(OPENSSL_LIBS)
74
75 radiusd.o: radiusd.c ../include/request_list.h ../include/modules.h ../include/modcall.h ../include/modpriv.h
76         $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c radiusd.c
77
78 acct.o: acct.c ../include/modules.h
79         $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c acct.c
80
81 files.o: files.c 
82         $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c files.c
83
84 util.o: util.c 
85         $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c util.c
86
87 log.o:  log.c 
88         $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c log.c
89
90 conffile.o: conffile.c ../include/modules.h
91         $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c conffile.c
92
93 mainconfig.o: mainconfig.c ../include/modules.h
94         $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c mainconfig.c
95
96 modules.o:  modules.c
97         $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(VFLAGS) $(INCLTDL) -c modules.c
98
99 modcall.o:  modcall.c
100         $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(INCLTDL) -c modcall.c
101
102 session.o:  session.c ../include/modules.h
103         $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c session.c
104
105 request_list.o:  request_list.c
106         $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c request_list.c
107
108 request_process.o:  request_process.c
109         $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c request_process.c
110
111 proxy.o:  proxy.c
112         $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c proxy.c
113
114 exec.o:  exec.c
115         $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c exec.c
116
117 auth.o:  auth.c ../include/modules.h
118         $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c auth.c
119
120 valuepair.o:  valuepair.c
121         $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c valuepair.c
122
123 version.o: version.c
124         $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -o version.o -c version.c
125
126 xlat.o: xlat.c
127         $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -o xlat.o -c xlat.c
128
129 threads.o: threads.c
130         $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -o threads.o -c threads.c
131
132 smux.o: smux.c
133         $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -o smux.o -c smux.c
134
135 radius_snmp.o: radius_snmp.c
136         $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -o radius_snmp.o -c radius_snmp.c
137
138 radclient: radclient.o ../lib/libradius.la
139         $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o radclient radclient.o ../lib/libradius.la $(LIBS)
140
141 radclient.o: radclient.c $(INCLUDES)
142         $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c radclient.c
143
144 radwho.o: radwho.c $(INCLUDES)
145         $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c radwho.c
146
147 radwho: radwho.o util.o log.o conffile.o ../lib/libradius.la
148         $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o radwho radwho.o util.o log.o conffile.o ../lib/libradius.la $(LIBS)
149
150 clean:
151         rm -rf *.o *.so *.lo *~ $(BINARIES) .libs
152
153 install:
154         $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(INSTALLSTRIP) radiusd$(EXEEXT)    $(R)$(sbindir)
155         $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(INSTALLSTRIP) radwho$(EXEEXT)     $(R)$(bindir)
156         $(INSTALL) -m 755    radzap                     $(R)$(bindir)
157         $(INSTALL) -m 755    radlast                    $(R)$(bindir)
158         $(LIBTOOL) --mode=install $(INSTALL) -m 755    radclient$(EXEEXT)               $(R)$(bindir)
159         $(INSTALL) -m 755    radtest                    $(R)$(bindir)
160         $(INSTALL) -m 755    checkrad.pl                $(R)$(sbindir)/checkrad